schema-model 0.5.6 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26adf1dd06c9423431abe3f91b7f3c62dd71621130b073f9084f04ed3a886d24
4
- data.tar.gz: 2897fd831fed4eb03297902846b166b023120328b41a10a1c56e6d3e701dcfd7
3
+ metadata.gz: e59fee146d573843a81c526d315006da111b586b628595717874c022234e503e
4
+ data.tar.gz: 23d0495e61a3a192445e189548988f0d36ff3c809ed8302784ac23ea0befe736
5
5
  SHA512:
6
- metadata.gz: 48c3abb46f720e799c6a9d246adc691f3add9035e51edec112787e1d37e272f24106b0bfed240e9c8b250223019e2ed10bf1dc2e45cda161534fa3661f6fe838
7
- data.tar.gz: 88bbf251505a4ba24309a00dfc707737594a9f9dbc4afe574fceeda64da2c4300c6384361d5a6a936dc6182e6ebb84f9385b69e7a29c291aed2a011aaa4a3071
6
+ metadata.gz: e1fe12a103e6f7150b29460ab6039068c960ac30f6796ee6263d7bb0217a3bee02a8903359fcdb1d9595e3f0efac78c22ed88e80f0e862b154017ad3f4d11837
7
+ data.tar.gz: ee5a679afb4beb3cec1c8dcd1ba9e1ba48cab00658ff50ed87b14bbf26845845b9344a9940480446d61bc335d4faa68b8cd6f1f0c32a86f545573ae8fce721cf
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 3.1.0
data/.travis.yml CHANGED
@@ -2,10 +2,7 @@ env:
2
2
  global:
3
3
  - CC_TEST_REPORTER_ID=f06234974aa4c4c52d14cb9ef800df79de52013c38e1d149fd04f2284e722f57
4
4
  rvm:
5
- - 2.6.3
6
- - 2.1.9
7
- - 1.9.3
8
- gemfile: gemfiles/travis.gemfile
5
+ - 3.1.0
9
6
  language: ruby
10
7
  before_script:
11
8
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
data/Gemfile CHANGED
@@ -5,16 +5,7 @@ source 'http://rubygems.org'
5
5
  gem 'inheritance-helper'
6
6
 
7
7
  group :development do
8
- activemodel_version =
9
- case ENV['RUBY_VERSION']
10
- when /1\.9\.3/
11
- 3
12
- when /2\.1\.9/
13
- 4
14
- else
15
- 5
16
- end
17
- gem 'activemodel', "~> #{activemodel_version}"
8
+ gem 'activemodel'
18
9
  gem 'rake'
19
10
  gem 'rubocop'
20
11
  end
data/Gemfile.lock CHANGED
@@ -1,64 +1,68 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (5.2.3)
5
- activesupport (= 5.2.3)
6
- activesupport (5.2.3)
4
+ activemodel (7.0.2.3)
5
+ activesupport (= 7.0.2.3)
6
+ activesupport (7.0.2.3)
7
7
  concurrent-ruby (~> 1.0, >= 1.0.2)
8
- i18n (>= 0.7, < 2)
9
- minitest (~> 5.1)
10
- tzinfo (~> 1.1)
11
- ast (2.4.0)
12
- concurrent-ruby (1.1.5)
13
- diff-lcs (1.3)
14
- docile (1.3.2)
15
- i18n (1.6.0)
8
+ i18n (>= 1.6, < 2)
9
+ minitest (>= 5.1)
10
+ tzinfo (~> 2.0)
11
+ ast (2.4.2)
12
+ concurrent-ruby (1.1.9)
13
+ diff-lcs (1.5.0)
14
+ docile (1.4.0)
15
+ i18n (1.10.0)
16
16
  concurrent-ruby (~> 1.0)
17
- inheritance-helper (0.1.0)
18
- jaro_winkler (1.5.3)
19
- json (2.2.0)
20
- minitest (5.11.3)
21
- parallel (1.17.0)
22
- parser (2.6.3.0)
23
- ast (~> 2.4.0)
24
- rainbow (3.0.0)
25
- rake (12.3.2)
26
- rspec (3.8.0)
27
- rspec-core (~> 3.8.0)
28
- rspec-expectations (~> 3.8.0)
29
- rspec-mocks (~> 3.8.0)
30
- rspec-core (3.8.2)
31
- rspec-support (~> 3.8.0)
32
- rspec-expectations (3.8.4)
17
+ inheritance-helper (0.2.5)
18
+ minitest (5.15.0)
19
+ parallel (1.21.0)
20
+ parser (3.1.1.0)
21
+ ast (~> 2.4.1)
22
+ rainbow (3.1.1)
23
+ rake (13.0.6)
24
+ regexp_parser (2.2.1)
25
+ rexml (3.2.5)
26
+ rspec (3.11.0)
27
+ rspec-core (~> 3.11.0)
28
+ rspec-expectations (~> 3.11.0)
29
+ rspec-mocks (~> 3.11.0)
30
+ rspec-core (3.11.0)
31
+ rspec-support (~> 3.11.0)
32
+ rspec-expectations (3.11.0)
33
33
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-mocks (3.8.1)
34
+ rspec-support (~> 3.11.0)
35
+ rspec-mocks (3.11.0)
36
36
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-support (3.8.2)
39
- rubocop (0.73.0)
40
- jaro_winkler (~> 1.5.1)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-support (3.11.0)
39
+ rubocop (1.26.0)
41
40
  parallel (~> 1.10)
42
- parser (>= 2.6)
41
+ parser (>= 3.1.0.0)
43
42
  rainbow (>= 2.2.2, < 4.0)
43
+ regexp_parser (>= 1.8, < 3.0)
44
+ rexml
45
+ rubocop-ast (>= 1.16.0, < 2.0)
44
46
  ruby-progressbar (~> 1.7)
45
- unicode-display_width (>= 1.4.0, < 1.7)
46
- ruby-progressbar (1.10.1)
47
- simplecov (0.17.0)
47
+ unicode-display_width (>= 1.4.0, < 3.0)
48
+ rubocop-ast (1.16.0)
49
+ parser (>= 3.1.1.0)
50
+ ruby-progressbar (1.11.0)
51
+ simplecov (0.21.2)
48
52
  docile (~> 1.1)
49
- json (>= 1.8, < 3)
50
- simplecov-html (~> 0.10.0)
51
- simplecov-html (0.10.2)
52
- thread_safe (0.3.6)
53
- tzinfo (1.2.5)
54
- thread_safe (~> 0.1)
55
- unicode-display_width (1.6.0)
53
+ simplecov-html (~> 0.11)
54
+ simplecov_json_formatter (~> 0.1)
55
+ simplecov-html (0.12.3)
56
+ simplecov_json_formatter (0.1.4)
57
+ tzinfo (2.0.4)
58
+ concurrent-ruby (~> 1.0)
59
+ unicode-display_width (2.1.0)
56
60
 
57
61
  PLATFORMS
58
- ruby
62
+ x86_64-darwin-21
59
63
 
60
64
  DEPENDENCIES
61
- activemodel (~> 5)
65
+ activemodel
62
66
  inheritance-helper
63
67
  rake
64
68
  rspec
@@ -66,4 +70,4 @@ DEPENDENCIES
66
70
  simplecov
67
71
 
68
72
  BUNDLED WITH
69
- 1.17.3
73
+ 2.3.3
data/README.md CHANGED
@@ -93,6 +93,15 @@ class CompanySchema
93
93
  validates :type, inclusion: { in: dynamic_type_names }
94
94
  end
95
95
 
96
+ has_many(:admins, from: :hash, hash_key_field: :username) do
97
+ attribute :username, :string
98
+ attribute :email, :string
99
+ attribute :name, :string
100
+
101
+ validates :username, presence: true
102
+ validates :email, presence: true
103
+ end
104
+
96
105
  validates :name, presence: true
97
106
  validates :industry_type, inclusion: { in: industry_schema.dynamic_type_names }
98
107
 
@@ -100,6 +109,7 @@ class CompanySchema
100
109
  validates :industry, presence: true, schema: true
101
110
  validates :locations, presence: true, schema: true
102
111
  validates :employees, presence: true, schema: true
112
+ validates :admins, presence: true, schema: true
103
113
  end
104
114
  ```
105
115
 
@@ -138,6 +148,16 @@ end
138
148
  "start_date": "2018-05-10",
139
149
  "manager_name": "Queen Bee"
140
150
  }
141
- ]
151
+ ],
152
+ "admins": {
153
+ "captain": {
154
+ "email": "captain@example.com",
155
+ "name": "Captain Kurk"
156
+ },
157
+ "joe": {
158
+ "email": "joe.smith@example.com",
159
+ "name": "Joe Smith"
160
+ }
161
+ }
142
162
  }
143
163
  ```
@@ -12,6 +12,8 @@ module Schema
12
12
  @schema_class = base_schema.class.const_get(options[:class_name])
13
13
  @aliases = options.fetch(:aliases, [])
14
14
  @ignorecase = options[:type_ignorecase]
15
+ @is_list = options[:from] != :hash
16
+ @hash_key_field = options[:hash_key_field]
15
17
  configure_dynamic_schema_options(options)
16
18
  end
17
19
 
@@ -31,8 +33,14 @@ module Schema
31
33
  end
32
34
 
33
35
  def create_schemas(base_schema, list)
34
- if list.is_a?(Array)
36
+ if is_list? && list.is_a?(Array)
35
37
  list.each_with_index.map { |data, idx| create_schema(base_schema, data, "#{@schema_name}:#{idx}") }
38
+ elsif !is_list? && list.is_a?(Hash)
39
+ list.map do |(key, data)|
40
+ schema = create_schema(base_schema, data, "#{@schema_name}:#{key}")
41
+ schema.send(schema.class.schema[@hash_key_field][:setter], key)
42
+ schema
43
+ end
36
44
  elsif !list.nil?
37
45
  add_parsing_error(base_schema, @schema_name, INCOMPATABLE)
38
46
  nil
@@ -51,6 +59,10 @@ module Schema
51
59
  !@type_field.nil? || !@external_type_field.nil?
52
60
  end
53
61
 
62
+ def is_list?
63
+ @is_list
64
+ end
65
+
54
66
  def get_dynamic_schema_class(base_schema, data)
55
67
  type = get_dynamic_type(base_schema, data)
56
68
  type = type.to_s.downcase if @ignorecase
data/lib/schema/model.rb CHANGED
@@ -110,7 +110,11 @@ STR
110
110
  self.class.schema.each_with_object({}) do |(field_name, field_options), memo|
111
111
  unless field_options[:alias_of]
112
112
  value = public_send(field_options[:getter])
113
- memo[field_name] = value if !value.nil? || opts[:include_nils]
113
+ next if value.nil? && !opts[:include_nils]
114
+ next if opts[:select_filter] && !opts[:select_filter].call(field_name, value, field_options)
115
+ next if opts[:reject_filter] && opts[:reject_filter].call(field_name, value, field_options)
116
+
117
+ memo[field_name] = value.respond_to?(:as_json) ? value.as_json(opts) : value
114
118
  end
115
119
  end
116
120
  end
data/lib/schema/utils.rb CHANGED
@@ -28,6 +28,7 @@ module Schema
28
28
  options[:class_name] ||= 'Schema' + classify_name(schema_type.to_s) + classify_name(schema_name.to_s)
29
29
  options[:association] = true
30
30
  options[:aliases] = [options[:alias]] if options.key?(:alias)
31
+ options[:hash_key_field] ||= :id if options[:from] == :hash
31
32
  ::Schema::Model.default_attribute_options(schema_name, schema_type).merge(options)
32
33
  end
33
34
 
data/schema-model.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'schema-model'
5
- s.version = '0.5.6'
5
+ s.version = '0.6.2'
6
6
  s.licenses = ['MIT']
7
7
  s.summary = 'Schema Model'
8
8
  s.description = 'Easy way to create models from payloads'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-22 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inheritance-helper
@@ -42,13 +42,6 @@ files:
42
42
  - README.md
43
43
  - Rakefile
44
44
  - bin/schema-json2csv
45
- - gemfiles/ruby_1.9.3.gemfile
46
- - gemfiles/ruby_1.9.3.gemfile.lock
47
- - gemfiles/ruby_2.1.9.gemfile
48
- - gemfiles/ruby_2.1.9.gemfile.lock
49
- - gemfiles/ruby_2.6.3.gemfile
50
- - gemfiles/ruby_2.6.3.gemfile.lock
51
- - gemfiles/travis.gemfile
52
45
  - lib/schema-model.rb
53
46
  - lib/schema/active_model_validations.rb
54
47
  - lib/schema/all.rb
@@ -78,7 +71,7 @@ homepage: https://github.com/dougyouch/schema
78
71
  licenses:
79
72
  - MIT
80
73
  metadata: {}
81
- post_install_message:
74
+ post_install_message:
82
75
  rdoc_options: []
83
76
  require_paths:
84
77
  - lib
@@ -93,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
86
  - !ruby/object:Gem::Version
94
87
  version: '0'
95
88
  requirements: []
96
- rubygems_version: 3.0.6
97
- signing_key:
89
+ rubygems_version: 3.3.3
90
+ signing_key:
98
91
  specification_version: 4
99
92
  summary: Schema Model
100
93
  test_files: []
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gem 'inheritance-helper'
6
-
7
- group :development do
8
- activemodel_version =
9
- case ENV['RUBY_VERSION']
10
- when /1\.9\.3/
11
- 3
12
- when /2\.1\.9/
13
- 4
14
- else
15
- 5
16
- end
17
- gem 'activemodel', "~> #{activemodel_version}"
18
- gem 'rake'
19
- gem 'rubocop'
20
- end
21
-
22
- group :spec do
23
- gem 'rspec'
24
- gem 'simplecov'
25
- end
@@ -1,65 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (3.2.22.5)
5
- activesupport (= 3.2.22.5)
6
- builder (~> 3.0.0)
7
- activesupport (3.2.22.5)
8
- i18n (~> 0.6, >= 0.6.4)
9
- multi_json (~> 1.0)
10
- ast (2.4.0)
11
- builder (3.0.4)
12
- concurrent-ruby (1.1.5)
13
- diff-lcs (1.3)
14
- docile (1.3.2)
15
- i18n (0.9.5)
16
- concurrent-ruby (~> 1.0)
17
- inheritance-helper (0.1.0)
18
- json (2.2.0)
19
- multi_json (1.13.1)
20
- parser (2.4.0.2)
21
- ast (~> 2.3)
22
- powerpack (0.1.2)
23
- rainbow (2.2.2)
24
- rake
25
- rake (12.2.1)
26
- rspec (3.8.0)
27
- rspec-core (~> 3.8.0)
28
- rspec-expectations (~> 3.8.0)
29
- rspec-mocks (~> 3.8.0)
30
- rspec-core (3.8.2)
31
- rspec-support (~> 3.8.0)
32
- rspec-expectations (3.8.4)
33
- diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-mocks (3.8.1)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-support (3.8.2)
39
- rubocop (0.41.2)
40
- parser (>= 2.3.1.1, < 3.0)
41
- powerpack (~> 0.1)
42
- rainbow (>= 1.99.1, < 3.0)
43
- ruby-progressbar (~> 1.7)
44
- unicode-display_width (~> 1.0, >= 1.0.1)
45
- ruby-progressbar (1.10.1)
46
- simplecov (0.17.0)
47
- docile (~> 1.1)
48
- json (>= 1.8, < 3)
49
- simplecov-html (~> 0.10.0)
50
- simplecov-html (0.10.2)
51
- unicode-display_width (1.6.0)
52
-
53
- PLATFORMS
54
- ruby
55
-
56
- DEPENDENCIES
57
- activemodel (~> 3)
58
- inheritance-helper
59
- rake
60
- rspec
61
- rubocop
62
- simplecov
63
-
64
- BUNDLED WITH
65
- 1.17.3
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gem 'inheritance-helper'
6
-
7
- group :development do
8
- activemodel_version =
9
- case ENV['RUBY_VERSION']
10
- when /1\.9\.3/
11
- 3
12
- when /2\.1\.9/
13
- 4
14
- else
15
- 5
16
- end
17
- gem 'activemodel', "~> #{activemodel_version}"
18
- gem 'rake'
19
- gem 'rubocop'
20
- end
21
-
22
- group :spec do
23
- gem 'rspec'
24
- gem 'simplecov'
25
- end
@@ -1,73 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (4.2.11.1)
5
- activesupport (= 4.2.11.1)
6
- builder (~> 3.1)
7
- activesupport (4.2.11.1)
8
- i18n (~> 0.7)
9
- minitest (~> 5.1)
10
- thread_safe (~> 0.3, >= 0.3.4)
11
- tzinfo (~> 1.1)
12
- ast (2.4.0)
13
- builder (3.2.3)
14
- concurrent-ruby (1.1.5)
15
- diff-lcs (1.3)
16
- docile (1.3.2)
17
- i18n (0.9.5)
18
- concurrent-ruby (~> 1.0)
19
- inheritance-helper (0.1.0)
20
- jaro_winkler (1.5.3)
21
- json (2.2.0)
22
- minitest (5.11.3)
23
- parallel (1.13.0)
24
- parser (2.6.3.0)
25
- ast (~> 2.4.0)
26
- powerpack (0.1.2)
27
- rainbow (3.0.0)
28
- rake (12.3.3)
29
- rspec (3.8.0)
30
- rspec-core (~> 3.8.0)
31
- rspec-expectations (~> 3.8.0)
32
- rspec-mocks (~> 3.8.0)
33
- rspec-core (3.8.2)
34
- rspec-support (~> 3.8.0)
35
- rspec-expectations (3.8.4)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-mocks (3.8.1)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.8.0)
41
- rspec-support (3.8.2)
42
- rubocop (0.57.2)
43
- jaro_winkler (~> 1.5.1)
44
- parallel (~> 1.10)
45
- parser (>= 2.5)
46
- powerpack (~> 0.1)
47
- rainbow (>= 2.2.2, < 4.0)
48
- ruby-progressbar (~> 1.7)
49
- unicode-display_width (~> 1.0, >= 1.0.1)
50
- ruby-progressbar (1.10.1)
51
- simplecov (0.17.0)
52
- docile (~> 1.1)
53
- json (>= 1.8, < 3)
54
- simplecov-html (~> 0.10.0)
55
- simplecov-html (0.10.2)
56
- thread_safe (0.3.6)
57
- tzinfo (1.2.5)
58
- thread_safe (~> 0.1)
59
- unicode-display_width (1.6.0)
60
-
61
- PLATFORMS
62
- ruby
63
-
64
- DEPENDENCIES
65
- activemodel (~> 4)
66
- inheritance-helper
67
- rake
68
- rspec
69
- rubocop
70
- simplecov
71
-
72
- BUNDLED WITH
73
- 1.17.3
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gem 'inheritance-helper'
6
-
7
- group :development do
8
- activemodel_version =
9
- case ENV['RUBY_VERSION']
10
- when /1\.9\.3/
11
- 3
12
- when /2\.1\.9/
13
- 4
14
- else
15
- 5
16
- end
17
- gem 'activemodel', "~> #{activemodel_version}"
18
- gem 'rake'
19
- gem 'rubocop'
20
- end
21
-
22
- group :spec do
23
- gem 'rspec'
24
- gem 'simplecov'
25
- end
@@ -1,69 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (5.2.3)
5
- activesupport (= 5.2.3)
6
- activesupport (5.2.3)
7
- concurrent-ruby (~> 1.0, >= 1.0.2)
8
- i18n (>= 0.7, < 2)
9
- minitest (~> 5.1)
10
- tzinfo (~> 1.1)
11
- ast (2.4.0)
12
- concurrent-ruby (1.1.5)
13
- diff-lcs (1.3)
14
- docile (1.3.2)
15
- i18n (1.6.0)
16
- concurrent-ruby (~> 1.0)
17
- inheritance-helper (0.1.0)
18
- jaro_winkler (1.5.3)
19
- json (2.2.0)
20
- minitest (5.11.3)
21
- parallel (1.17.0)
22
- parser (2.6.3.0)
23
- ast (~> 2.4.0)
24
- rainbow (3.0.0)
25
- rake (12.3.3)
26
- rspec (3.8.0)
27
- rspec-core (~> 3.8.0)
28
- rspec-expectations (~> 3.8.0)
29
- rspec-mocks (~> 3.8.0)
30
- rspec-core (3.8.2)
31
- rspec-support (~> 3.8.0)
32
- rspec-expectations (3.8.4)
33
- diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-mocks (3.8.1)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-support (3.8.2)
39
- rubocop (0.74.0)
40
- jaro_winkler (~> 1.5.1)
41
- parallel (~> 1.10)
42
- parser (>= 2.6)
43
- rainbow (>= 2.2.2, < 4.0)
44
- ruby-progressbar (~> 1.7)
45
- unicode-display_width (>= 1.4.0, < 1.7)
46
- ruby-progressbar (1.10.1)
47
- simplecov (0.17.0)
48
- docile (~> 1.1)
49
- json (>= 1.8, < 3)
50
- simplecov-html (~> 0.10.0)
51
- simplecov-html (0.10.2)
52
- thread_safe (0.3.6)
53
- tzinfo (1.2.5)
54
- thread_safe (~> 0.1)
55
- unicode-display_width (1.6.0)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- activemodel (~> 5)
62
- inheritance-helper
63
- rake
64
- rspec
65
- rubocop
66
- simplecov
67
-
68
- BUNDLED WITH
69
- 1.17.2
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'http://rubygems.org'
4
-
5
- gem 'inheritance-helper'
6
-
7
- group :development do
8
- activemodel_version =
9
- case ENV['RUBY_VERSION']
10
- when /1\.9\.3/
11
- 3
12
- when /2\.1\.9/
13
- 4
14
- else
15
- 5
16
- end
17
- gem 'activemodel', "~> #{activemodel_version}"
18
- gem 'rake'
19
- gem 'rubocop'
20
- end
21
-
22
- group :spec do
23
- gem 'rspec'
24
- gem 'simplecov'
25
- end