shreddies 0.5.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +42 -41
- data/lib/shreddies/as_json.rb +4 -0
- data/lib/shreddies/json.rb +1 -1
- data/lib/shreddies/version.rb +1 -1
- data/shreddies.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebd69b48f96960924658b650a604e9ca7795a2589d5662578ee1834feda91a1c
|
4
|
+
data.tar.gz: 2f46df7d1d6103ac1ffab0439f23216ebb665c9ba13bc5e44693587797cecdcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2552f5b23549788e298ff8638750da0dbcb19646ef3926d1bad0017bf97ee07cdd10fbc26b76acc55161ca7336985f158be44fb76dbe15a61e6b0074a2f1528b
|
7
|
+
data.tar.gz: 24868b411bd1ff05d95d1d2014961cedeebccb7ac69e0d9901d0572d277f37721716c712cbedf8a9cc123bc26a6aaf74d4cf72200006ef41d56a9d8337386a8a
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,85 +1,86 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shreddies (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.
|
12
|
-
actionview (= 6.
|
13
|
-
activesupport (= 6.
|
14
|
-
rack (~> 2.0, >= 2.0.
|
11
|
+
actionpack (6.1.4.1)
|
12
|
+
actionview (= 6.1.4.1)
|
13
|
+
activesupport (= 6.1.4.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.4.1)
|
19
|
+
activesupport (= 6.1.4.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.4.1)
|
25
|
+
activesupport (= 6.1.4.1)
|
26
|
+
activerecord (6.1.4.1)
|
27
|
+
activemodel (= 6.1.4.1)
|
28
|
+
activesupport (= 6.1.4.1)
|
29
|
+
activesupport (6.1.4.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
|
-
combustion (1.3.
|
37
|
+
combustion (1.3.5)
|
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.9)
|
42
42
|
crass (1.0.6)
|
43
|
-
erubi (1.
|
44
|
-
i18n (1.8.
|
43
|
+
erubi (1.10.0)
|
44
|
+
i18n (1.8.11)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
|
-
loofah (2.
|
46
|
+
loofah (2.12.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.6.1)
|
51
|
+
minitest (5.14.4)
|
52
52
|
minitest-autotest (1.1.1)
|
53
53
|
minitest-server (~> 1.0)
|
54
54
|
path_expander (~> 1.0)
|
55
|
-
minitest-focus (1.
|
55
|
+
minitest-focus (1.3.1)
|
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.12.5)
|
60
|
+
mini_portile2 (~> 2.6.1)
|
61
|
+
racc (~> 1.4)
|
61
62
|
path_expander (1.1.0)
|
63
|
+
racc (1.6.0)
|
62
64
|
rack (2.2.3)
|
63
65
|
rack-test (1.1.0)
|
64
66
|
rack (>= 1.0, < 3)
|
65
67
|
rails-dom-testing (2.0.3)
|
66
68
|
activesupport (>= 4.2.0)
|
67
69
|
nokogiri (>= 1.6)
|
68
|
-
rails-html-sanitizer (1.
|
70
|
+
rails-html-sanitizer (1.4.2)
|
69
71
|
loofah (~> 2.3)
|
70
|
-
railties (6.
|
71
|
-
actionpack (= 6.
|
72
|
-
activesupport (= 6.
|
72
|
+
railties (6.1.4.1)
|
73
|
+
actionpack (= 6.1.4.1)
|
74
|
+
activesupport (= 6.1.4.1)
|
73
75
|
method_source
|
74
|
-
rake (>= 0.
|
75
|
-
thor (
|
76
|
-
rake (
|
76
|
+
rake (>= 0.13)
|
77
|
+
thor (~> 1.0)
|
78
|
+
rake (13.0.6)
|
77
79
|
sqlite3 (1.4.2)
|
78
|
-
thor (1.0
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
zeitwerk (2.3.1)
|
80
|
+
thor (1.1.0)
|
81
|
+
tzinfo (2.0.4)
|
82
|
+
concurrent-ruby (~> 1.0)
|
83
|
+
zeitwerk (2.5.1)
|
83
84
|
|
84
85
|
PLATFORMS
|
85
86
|
ruby
|
@@ -90,9 +91,9 @@ DEPENDENCIES
|
|
90
91
|
minitest (~> 5.0)
|
91
92
|
minitest-autotest
|
92
93
|
minitest-focus
|
93
|
-
rake (~>
|
94
|
+
rake (~> 13.0)
|
94
95
|
shreddies!
|
95
96
|
sqlite3
|
96
97
|
|
97
98
|
BUNDLED WITH
|
98
|
-
2.
|
99
|
+
2.2.31
|
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/json.rb
CHANGED
@@ -48,7 +48,7 @@ module Shreddies
|
|
48
48
|
|
49
49
|
def initialize(subject, opts = {})
|
50
50
|
@subject = subject.is_a?(Hash) ? OpenStruct.new(subject) : subject
|
51
|
-
@options = { transform_keys: true }.merge(opts)
|
51
|
+
@options = { transform_keys: true }.merge(opts).with_indifferent_access
|
52
52
|
|
53
53
|
extend_with_modules
|
54
54
|
end
|
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.8.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:
|
11
|
+
date: 2021-11-29 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.
|
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.
|
88
|
-
signing_key:
|
87
|
+
rubygems_version: 3.2.22
|
88
|
+
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Stupid simple Rails model and object serializer
|
91
91
|
test_files: []
|