schema-model 0.6.1 → 0.6.2

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: b2fe6429e537c3f66ec6bafb9b5f99b3883e291a727e2fe5abfe23ecc5b35c60
4
- data.tar.gz: 516b227ad2eba0f204291961c289ebe4bde6cbb4dc9d92b2e6469c20d45cadec
3
+ metadata.gz: e59fee146d573843a81c526d315006da111b586b628595717874c022234e503e
4
+ data.tar.gz: 23d0495e61a3a192445e189548988f0d36ff3c809ed8302784ac23ea0befe736
5
5
  SHA512:
6
- metadata.gz: 9dbc6f58dcf31d97b79b4c92e2adeaedf8c64be74cf799cc2b593c09929bfeb2837aa6463824bd08ebcccc5cfe6b10d42c47e1f3625174aa491df94fec045042
7
- data.tar.gz: 9e9bdb438366ded5ab84498ee183ab98adaa02df0fb53f3e588a6b977acad5d0fb9b0f4a3d2a62a54eba3b135fec6769a1aa761b04f0609ee3b13d1c70830ffa
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,9 +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
- gemfile: gemfiles/travis.gemfile
5
+ - 3.1.0
8
6
  language: ruby
9
7
  before_script:
10
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/lib/schema/model.rb CHANGED
@@ -114,7 +114,7 @@ STR
114
114
  next if opts[:select_filter] && !opts[:select_filter].call(field_name, value, field_options)
115
115
  next if opts[:reject_filter] && opts[:reject_filter].call(field_name, value, field_options)
116
116
 
117
- memo[field_name] = value
117
+ memo[field_name] = value.respond_to?(:as_json) ? value.as_json(opts) : value
118
118
  end
119
119
  end
120
120
  end
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.6.1'
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.6.1
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: 2020-04-01 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.8
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