shreddies 0.6.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d29eb71728861282bd3c4a7e04ee829c4d647962951dfc494b311146142a84b
4
- data.tar.gz: 9281b757f6ac85f5d17879b54b4554a7cf4ea5853c04420f52a4755080157092
3
+ metadata.gz: f06b41abce0a2a20c7d9166746068b2522439de93081649a5e174e3cc6886d00
4
+ data.tar.gz: f5625641c4f0a4a713f40df3ccb73424bcccaac864dc0f5ab678f662c82bd0e2
5
5
  SHA512:
6
- metadata.gz: 70f1959dbd3cd6a7e134c3fb4404a8d75ea55e219ba8e01eaba675bcfbbdc597fc0e85a12df4574e73617cb5aec946f67fcb3a077d73ccbf068d5ec158e82996
7
- data.tar.gz: b8618164e87ad5d94279a5e9294ec7d975d2b96ec3966fe8b074f4733296b9c047348b718002942911442f9f4511a61909045baeccfb9d9705975c749ffa7fb7
6
+ metadata.gz: b48f382e57de7a13633c182d03a0c323322ff24f2509487ea015cdde536751230800d9c18c9ef29ca473a6d81c6ad78ba7b333783327058804338fbb8bc06005
7
+ data.tar.gz: dc7cf7b969beb3811c47ae10fb40e1baa2edb9dd1e8b6fce5ec3f3b0df1d9a6c4bdf7884c42db1ce2aa143910bd97ca829624af606dfbcd11ccae1b287f5453e
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /test/internal/db/*.sqlite
10
+ .DS_Store
data/Gemfile.lock CHANGED
@@ -1,85 +1,86 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shreddies (0.6.0)
4
+ shreddies (0.8.0)
5
5
  activerecord (>= 5)
6
6
  railties (>= 5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (6.0.3.4)
12
- actionview (= 6.0.3.4)
13
- activesupport (= 6.0.3.4)
14
- rack (~> 2.0, >= 2.0.8)
11
+ actionpack (7.0.1)
12
+ actionview (= 7.0.1)
13
+ activesupport (= 7.0.1)
14
+ rack (~> 2.0, >= 2.2.0)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.0.3.4)
19
- activesupport (= 6.0.3.4)
18
+ actionview (7.0.1)
19
+ activesupport (= 7.0.1)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (6.0.3.4)
25
- activesupport (= 6.0.3.4)
26
- activerecord (6.0.3.4)
27
- activemodel (= 6.0.3.4)
28
- activesupport (= 6.0.3.4)
29
- activesupport (6.0.3.4)
24
+ activemodel (7.0.1)
25
+ activesupport (= 7.0.1)
26
+ activerecord (7.0.1)
27
+ activemodel (= 7.0.1)
28
+ activesupport (= 7.0.1)
29
+ activesupport (7.0.1)
30
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
31
- i18n (>= 0.7, < 2)
32
- minitest (~> 5.1)
33
- tzinfo (~> 1.1)
34
- zeitwerk (~> 2.2, >= 2.2.2)
31
+ i18n (>= 1.6, < 2)
32
+ minitest (>= 5.1)
33
+ tzinfo (~> 2.0)
35
34
  autotest-suffix (1.1.0)
36
35
  builder (3.2.4)
37
- combustion (1.3.1)
36
+ combustion (1.3.5)
38
37
  activesupport (>= 3.0.0)
39
38
  railties (>= 3.0.0)
40
39
  thor (>= 0.14.6)
41
- concurrent-ruby (1.1.7)
40
+ concurrent-ruby (1.1.9)
42
41
  crass (1.0.6)
43
- erubi (1.9.0)
44
- i18n (1.8.5)
42
+ erubi (1.10.0)
43
+ i18n (1.9.1)
45
44
  concurrent-ruby (~> 1.0)
46
- loofah (2.7.0)
45
+ loofah (2.13.0)
47
46
  crass (~> 1.0.2)
48
47
  nokogiri (>= 1.5.9)
49
48
  method_source (1.0.0)
50
- mini_portile2 (2.4.0)
51
- minitest (5.14.2)
49
+ mini_portile2 (2.7.1)
50
+ minitest (5.15.0)
52
51
  minitest-autotest (1.1.1)
53
52
  minitest-server (~> 1.0)
54
53
  path_expander (~> 1.0)
55
- minitest-focus (1.2.1)
54
+ minitest-focus (1.3.1)
56
55
  minitest (>= 4, < 6)
57
56
  minitest-server (1.0.6)
58
57
  minitest (~> 5.0)
59
- nokogiri (1.10.10)
60
- mini_portile2 (~> 2.4.0)
58
+ nokogiri (1.13.1)
59
+ mini_portile2 (~> 2.7.0)
60
+ racc (~> 1.4)
61
61
  path_expander (1.1.0)
62
+ racc (1.6.0)
62
63
  rack (2.2.3)
63
64
  rack-test (1.1.0)
64
65
  rack (>= 1.0, < 3)
65
66
  rails-dom-testing (2.0.3)
66
67
  activesupport (>= 4.2.0)
67
68
  nokogiri (>= 1.6)
68
- rails-html-sanitizer (1.3.0)
69
+ rails-html-sanitizer (1.4.2)
69
70
  loofah (~> 2.3)
70
- railties (6.0.3.4)
71
- actionpack (= 6.0.3.4)
72
- activesupport (= 6.0.3.4)
71
+ railties (7.0.1)
72
+ actionpack (= 7.0.1)
73
+ activesupport (= 7.0.1)
73
74
  method_source
74
- rake (>= 0.8.7)
75
- thor (>= 0.20.3, < 2.0)
76
- rake (13.0.1)
75
+ rake (>= 12.2)
76
+ thor (~> 1.0)
77
+ zeitwerk (~> 2.5)
78
+ rake (13.0.6)
77
79
  sqlite3 (1.4.2)
78
- thor (1.0.1)
79
- thread_safe (0.3.6)
80
- tzinfo (1.2.8)
81
- thread_safe (~> 0.1)
82
- zeitwerk (2.4.1)
80
+ thor (1.2.1)
81
+ tzinfo (2.0.4)
82
+ concurrent-ruby (~> 1.0)
83
+ zeitwerk (2.5.4)
83
84
 
84
85
  PLATFORMS
85
86
  ruby
@@ -95,4 +96,4 @@ DEPENDENCIES
95
96
  sqlite3
96
97
 
97
98
  BUNDLED WITH
98
- 2.1.4
99
+ 2.2.31
@@ -8,6 +8,11 @@ module Shreddies
8
8
 
9
9
  if serializer.is_a?(String) || serializer.is_a?(Symbol)
10
10
  serializer = serializer.to_s.safe_constantize
11
+ elsif serializer.is_a?(Proc)
12
+ return serializer.call
13
+ elsif serializer.is_a?(Hash)
14
+ options = serializer
15
+ serializer = "#{model_name}Serializer".safe_constantize
11
16
  end
12
17
 
13
18
  serializer ? serializer.render_as_json(self, options) : super
@@ -20,6 +25,11 @@ module Shreddies
20
25
 
21
26
  if serializer.is_a?(String) || serializer.is_a?(Symbol)
22
27
  serializer = serializer.to_s.safe_constantize
28
+ elsif serializer.is_a?(Proc)
29
+ return serializer.call
30
+ elsif serializer.is_a?(Hash)
31
+ options = serializer
32
+ serializer = "#{model_name}Serializer".safe_constantize
23
33
  end
24
34
 
25
35
  serializer ? serializer.render_as_json(self, options) : super
@@ -1,3 +1,3 @@
1
1
  module Shreddies
2
- VERSION = "0.6.0"
2
+ VERSION = "0.9.0"
3
3
  end
data/shreddies.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Stupid simple Rails model and object serializer'
12
12
  spec.homepage = 'https://github.com/joelmoss/shreddies'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shreddies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-11 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5'
41
- description:
41
+ description:
42
42
  email:
43
43
  - joel@developwithstyle.com
44
44
  executables: []
@@ -69,7 +69,7 @@ metadata:
69
69
  homepage_uri: https://github.com/joelmoss/shreddies
70
70
  source_code_uri: https://github.com/joelmoss/shreddies
71
71
  changelog_uri: https://github.com/joelmoss/shreddies/releases
72
- post_install_message:
72
+ post_install_message:
73
73
  rdoc_options: []
74
74
  require_paths:
75
75
  - lib
@@ -77,15 +77,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 2.3.0
80
+ version: 2.7.0
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.1.4
88
- signing_key:
87
+ rubygems_version: 3.3.3
88
+ signing_key:
89
89
  specification_version: 4
90
90
  summary: Stupid simple Rails model and object serializer
91
91
  test_files: []