class2 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +20 -1
- data/Appraisals +11 -0
- data/Changes +4 -0
- data/README.md +5 -1
- data/class2.gemspec +3 -2
- data/gemfiles/as4.gemfile +7 -0
- data/gemfiles/as5.gemfile +7 -0
- data/gemfiles/as6.gemfile +7 -0
- data/lib/class2.rb +5 -4
- data/lib/class2/version.rb +1 -1
- metadata +31 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 49d91ca721e5cefa4ee9663e3e4ca8edbb584315300888561fa2b70e49eb7923
|
4
|
+
data.tar.gz: 486025e1a89a034b49dc9a5c243d5bae341e4880d10d2a204e07898acd5a0e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d85ef46fefd99c440a1fe0aa92724a3b217c8d14a6473d2ff025705604a40e40f234a0d0cbc730921301783d28f6ac5cfa2435bf631994bfc714fe649907d97
|
7
|
+
data.tar.gz: 46e2460f0924ce6c17413d7a15b0c6fc8685b0784e87a173ab6d51464a1b9a535e4d82f742c3c8b7c263a5ec7afe67c8514a12d7938dae549fa531c87b56142a
|
data/.travis.yml
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
+
cache: bundler
|
3
4
|
rvm:
|
4
5
|
- jruby-9
|
5
6
|
- 2.3
|
6
7
|
- 2.4
|
7
8
|
- 2.5
|
9
|
+
- 2.6
|
10
|
+
- 2.7
|
11
|
+
|
12
|
+
before_install:
|
13
|
+
- gem install bundler
|
14
|
+
|
15
|
+
gemfile:
|
16
|
+
- gemfiles/as4.gemfile
|
17
|
+
- gemfiles/as5.gemfile
|
18
|
+
- gemfiles/as6.gemfile
|
19
|
+
|
20
|
+
matrix:
|
21
|
+
exclude:
|
22
|
+
- rvm: 2.3
|
23
|
+
gemfile: gemfiles/as6.gemfile
|
24
|
+
- rvm: 2.4
|
25
|
+
gemfile: gemfiles/as6.gemfile
|
26
|
+
- rvm: 2.7
|
27
|
+
gemfile: gemfiles/as4.gemfile
|
8
28
|
|
9
|
-
before_install: gem install bundler
|
10
29
|
notifications:
|
11
30
|
email: false
|
data/Appraisals
ADDED
data/Changes
CHANGED
data/README.md
CHANGED
@@ -271,7 +271,6 @@ Now an `ArgumentError` will be raised if anything but `id`, `name`, or
|
|
271
271
|
|
272
272
|
Also see [Customizations](#customizations).
|
273
273
|
|
274
|
-
|
275
274
|
## See Also
|
276
275
|
|
277
276
|
The Perl modules that served as inspiration:
|
@@ -285,6 +284,11 @@ The Perl modules that served as inspiration:
|
|
285
284
|
|
286
285
|
Surely others I cannot remember...
|
287
286
|
|
287
|
+
And these Ruby modules:
|
288
|
+
|
289
|
+
* [`require3`](https://github.com/sshaw/require3)
|
290
|
+
* [`alias2`](https://github.com/sshaw/alias2)
|
291
|
+
|
288
292
|
## Author
|
289
293
|
|
290
294
|
Skye Shaw [sshaw AT gmail.com]
|
data/class2.gemspec
CHANGED
@@ -18,9 +18,10 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "activesupport", ">= 3.2"
|
21
|
+
spec.add_dependency "activesupport", ">= 3.2", "< 7"
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "appraisal"
|
25
26
|
spec.add_development_dependency "minitest"
|
26
27
|
end
|
data/lib/class2.rb
CHANGED
@@ -38,7 +38,7 @@ class Class2
|
|
38
38
|
}
|
39
39
|
|
40
40
|
CONVERSIONS[FalseClass] = CONVERSIONS[TrueClass]
|
41
|
-
CONVERSIONS[Fixnum] = CONVERSIONS[Integer]
|
41
|
+
CONVERSIONS[Fixnum] = CONVERSIONS[Integer]
|
42
42
|
CONVERSIONS.default = lambda { |v| v }
|
43
43
|
|
44
44
|
class << self
|
@@ -250,10 +250,11 @@ class Class2
|
|
250
250
|
|
251
251
|
name = key.to_s.classify
|
252
252
|
|
253
|
-
#
|
254
|
-
|
253
|
+
# parent is deprecated in ActiveSupport 6 and its warning uses Strong#squish! which they don't include!
|
254
|
+
parent = self.class.respond_to?(:module_parent) ? self.class.module_parent : self.class.parent
|
255
|
+
next unless parent.const_defined?(name)
|
255
256
|
|
256
|
-
klass =
|
257
|
+
klass = parent.const_get(name)
|
257
258
|
value = value.is_a?(Hash) ? klass.new(value) : value.map { |v| klass.new(v) }
|
258
259
|
end
|
259
260
|
|
data/lib/class2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: class2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skye Shaw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,20 +27,23 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '3.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +58,20 @@ dependencies:
|
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '10.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: appraisal
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
55
75
|
- !ruby/object:Gem::Dependency
|
56
76
|
name: minitest
|
57
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,12 +95,16 @@ extra_rdoc_files: []
|
|
75
95
|
files:
|
76
96
|
- ".gitignore"
|
77
97
|
- ".travis.yml"
|
98
|
+
- Appraisals
|
78
99
|
- Changes
|
79
100
|
- Gemfile
|
80
101
|
- LICENSE.txt
|
81
102
|
- README.md
|
82
103
|
- Rakefile
|
83
104
|
- class2.gemspec
|
105
|
+
- gemfiles/as4.gemfile
|
106
|
+
- gemfiles/as5.gemfile
|
107
|
+
- gemfiles/as6.gemfile
|
84
108
|
- lib/class2.rb
|
85
109
|
- lib/class2/autoload.rb
|
86
110
|
- lib/class2/autoload/namespaced.rb
|
@@ -105,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
129
|
version: '0'
|
106
130
|
requirements: []
|
107
131
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.6
|
132
|
+
rubygems_version: 2.7.6
|
109
133
|
signing_key:
|
110
134
|
specification_version: 4
|
111
135
|
summary: Easily create hierarchies of classes that support nested attributes, type
|