shreddies 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -34
- data/lib/shreddies/as_json.rb +4 -0
- data/lib/shreddies/version.rb +1 -1
- data/shreddies.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b512a5aaa15bead3897d186b72c0232b806d21ec1b884689e7fac2b1f6c7db7b
|
4
|
+
data.tar.gz: 45c0d21700671b9ecb9c0ef6a19d0c29c1e45172f9567513b12182a6819d7b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c4aa3c08206be63b44798b22a644220fc536506810ad756f7a73b913bf9e8fd23b8f94014b2b1c6e00eaa1d590473b9786ea6dbb8585e52f16d0b465c528f0b
|
7
|
+
data.tar.gz: fa170d48d3d9e4f512bc3fdc06de984fc4370af74ee69a5e01a112b9e0ffb80ef05b75f52f5a9b0feaec643677a90f442120984a4c4c3587481fcdafec7676e6
|
data/Gemfile.lock
CHANGED
@@ -8,47 +8,47 @@ PATH
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionpack (6.
|
12
|
-
actionview (= 6.
|
13
|
-
activesupport (= 6.
|
14
|
-
rack (~> 2.0, >= 2.0.
|
11
|
+
actionpack (6.1.1)
|
12
|
+
actionview (= 6.1.1)
|
13
|
+
activesupport (= 6.1.1)
|
14
|
+
rack (~> 2.0, >= 2.0.9)
|
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.
|
19
|
-
activesupport (= 6.
|
18
|
+
actionview (6.1.1)
|
19
|
+
activesupport (= 6.1.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.
|
25
|
-
activesupport (= 6.
|
26
|
-
activerecord (6.
|
27
|
-
activemodel (= 6.
|
28
|
-
activesupport (= 6.
|
29
|
-
activesupport (6.
|
24
|
+
activemodel (6.1.1)
|
25
|
+
activesupport (= 6.1.1)
|
26
|
+
activerecord (6.1.1)
|
27
|
+
activemodel (= 6.1.1)
|
28
|
+
activesupport (= 6.1.1)
|
29
|
+
activesupport (6.1.1)
|
30
30
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
|
-
i18n (>=
|
32
|
-
minitest (
|
33
|
-
tzinfo (~>
|
34
|
-
zeitwerk (~> 2.
|
31
|
+
i18n (>= 1.6, < 2)
|
32
|
+
minitest (>= 5.1)
|
33
|
+
tzinfo (~> 2.0)
|
34
|
+
zeitwerk (~> 2.3)
|
35
35
|
autotest-suffix (1.1.0)
|
36
36
|
builder (3.2.4)
|
37
37
|
combustion (1.3.1)
|
38
38
|
activesupport (>= 3.0.0)
|
39
39
|
railties (>= 3.0.0)
|
40
40
|
thor (>= 0.14.6)
|
41
|
-
concurrent-ruby (1.1.
|
41
|
+
concurrent-ruby (1.1.8)
|
42
42
|
crass (1.0.6)
|
43
|
-
erubi (1.
|
44
|
-
i18n (1.8.
|
43
|
+
erubi (1.10.0)
|
44
|
+
i18n (1.8.7)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
|
-
loofah (2.
|
46
|
+
loofah (2.9.0)
|
47
47
|
crass (~> 1.0.2)
|
48
48
|
nokogiri (>= 1.5.9)
|
49
49
|
method_source (1.0.0)
|
50
|
-
mini_portile2 (2.
|
51
|
-
minitest (5.14.
|
50
|
+
mini_portile2 (2.5.0)
|
51
|
+
minitest (5.14.3)
|
52
52
|
minitest-autotest (1.1.1)
|
53
53
|
minitest-server (~> 1.0)
|
54
54
|
path_expander (~> 1.0)
|
@@ -56,9 +56,11 @@ GEM
|
|
56
56
|
minitest (>= 4, < 6)
|
57
57
|
minitest-server (1.0.6)
|
58
58
|
minitest (~> 5.0)
|
59
|
-
nokogiri (1.
|
60
|
-
mini_portile2 (~> 2.
|
59
|
+
nokogiri (1.11.1)
|
60
|
+
mini_portile2 (~> 2.5.0)
|
61
|
+
racc (~> 1.4)
|
61
62
|
path_expander (1.1.0)
|
63
|
+
racc (1.5.2)
|
62
64
|
rack (2.2.3)
|
63
65
|
rack-test (1.1.0)
|
64
66
|
rack (>= 1.0, < 3)
|
@@ -67,19 +69,18 @@ GEM
|
|
67
69
|
nokogiri (>= 1.6)
|
68
70
|
rails-html-sanitizer (1.3.0)
|
69
71
|
loofah (~> 2.3)
|
70
|
-
railties (6.
|
71
|
-
actionpack (= 6.
|
72
|
-
activesupport (= 6.
|
72
|
+
railties (6.1.1)
|
73
|
+
actionpack (= 6.1.1)
|
74
|
+
activesupport (= 6.1.1)
|
73
75
|
method_source
|
74
76
|
rake (>= 0.8.7)
|
75
|
-
thor (
|
76
|
-
rake (13.0.
|
77
|
+
thor (~> 1.0)
|
78
|
+
rake (13.0.3)
|
77
79
|
sqlite3 (1.4.2)
|
78
|
-
thor (1.0
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
zeitwerk (2.4.1)
|
80
|
+
thor (1.1.0)
|
81
|
+
tzinfo (2.0.4)
|
82
|
+
concurrent-ruby (~> 1.0)
|
83
|
+
zeitwerk (2.4.2)
|
83
84
|
|
84
85
|
PLATFORMS
|
85
86
|
ruby
|
data/lib/shreddies/as_json.rb
CHANGED
@@ -8,6 +8,8 @@ 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
|
11
13
|
end
|
12
14
|
|
13
15
|
serializer ? serializer.render_as_json(self, options) : super
|
@@ -20,6 +22,8 @@ module Shreddies
|
|
20
22
|
|
21
23
|
if serializer.is_a?(String) || serializer.is_a?(Symbol)
|
22
24
|
serializer = serializer.to_s.safe_constantize
|
25
|
+
elsif serializer.is_a?(Proc)
|
26
|
+
return serializer.call
|
23
27
|
end
|
24
28
|
|
25
29
|
serializer ? serializer.render_as_json(self, options) : super
|
data/lib/shreddies/version.rb
CHANGED
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.
|
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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements:
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 2.
|
80
|
+
version: 2.7.0
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - ">="
|