arstotzka 1.4.4 → 1.5.0

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: f520b5c22013f3c900e0a89109e817cbab2b274df08162d3759e02141f56de17
4
- data.tar.gz: ffb858a6d0e8c3256f6bd08454bee2d6990b9b0222c11676a192003dc81fc3d5
3
+ metadata.gz: 3821d878e7f40912c328b3bfb6529d718264f6e3f6067087ac28e91e4e7e30b8
4
+ data.tar.gz: 2f027fe2670701cd6724e117acfccc576fac5ab15080cf3d9ed583009dcdf34c
5
5
  SHA512:
6
- metadata.gz: 50a60125621d7512905a788f477f40d0eca7c5d8aa1640153498c9e4838e2ecf5afbf56fb728587483d2beb9a7d47563ff174c2be074697f139ebfddcfc50148
7
- data.tar.gz: 4ff99c27757f48240bd0ab3b13acb8a5741fb35a7dd6b1a3c1945ec054653cce9a1db5a97a9f5ac9e169696ccde6be2a2d9aa5cdb5cb0b18034b6d356a0d6740
6
+ metadata.gz: 2df223a18047011324b177a1abee1f965badf8b898237f7c07964cf703425241b7f40636ed29e21c5a13b2a90e0cf584c0654067eb75091017015ea2557c8fbb
7
+ data.tar.gz: 19efad2d61ceac43e634a2d27aedd3243b923824dfb8cdab7e5507b6ccea3e70f08a078a71affd7d70af37a5fb901820bcc6e7726db2e0919bd657b4e091fb46
@@ -1,8 +1,24 @@
1
1
  version: 2
2
+ workflows:
3
+ version: 2
4
+ test-and-build:
5
+ jobs:
6
+ - test:
7
+ filters:
8
+ tags:
9
+ only: /.*/
10
+ - build-and-release:
11
+ requires: [test]
12
+ filters:
13
+ tags:
14
+ only: /\d+\.\d+\.\d+/
15
+ branches:
16
+ only:
17
+ - master
2
18
  jobs:
3
- build:
19
+ test:
4
20
  docker:
5
- - image: darthjee/circleci_ruby_gems:0.2.3
21
+ - image: darthjee/circleci_ruby_gems:0.5.3
6
22
  environment:
7
23
  PROJECT: arstotzka
8
24
  steps:
@@ -34,3 +50,22 @@ jobs:
34
50
  - run:
35
51
  name: Check unit tests
36
52
  command: check_specs
53
+ build-and-release:
54
+ docker:
55
+ - image: darthjee/circleci_ruby_gems:0.5.3
56
+ environment:
57
+ PROJECT: arstotzka
58
+ steps:
59
+ - checkout
60
+ - run:
61
+ name: Bundle Install
62
+ command: bundle install
63
+ - run:
64
+ name: Signin
65
+ command: build_gem.sh signin
66
+ - run:
67
+ name: Build Gem
68
+ command: build_gem.sh build
69
+ - run:
70
+ name: Push Gem
71
+ command: build_gem.sh push
@@ -18,7 +18,7 @@ Style/ClassVars:
18
18
  Exclude:
19
19
  - spec/support/models/arstotzka/fetcher/class_variable.rb
20
20
 
21
- Layout/AlignHash:
21
+ Layout/HashAlignment:
22
22
  EnforcedColonStyle: table
23
23
 
24
24
  Metrics/BlockLength:
@@ -26,3 +26,12 @@ Metrics/BlockLength:
26
26
  - 'spec/**/*_spec.rb'
27
27
  - 'spec/support/**/*.rb'
28
28
  - '*.gemspec'
29
+
30
+ Style/HashEachMethods:
31
+ Enabled: true
32
+
33
+ Style/HashTransformKeys:
34
+ Enabled: true
35
+
36
+ Style/HashTransformValues:
37
+ Enabled: true
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- FROM darthjee/ruby_gems:0.2.3 as base
2
- FROM darthjee/scripts:0.1.2 as scripts
1
+ FROM darthjee/rails_gems:0.5.3 as base
2
+ FROM darthjee/scripts:0.1.8 as scripts
3
3
 
4
4
  ######################################
5
5
 
@@ -16,15 +16,9 @@ RUN bundle_builder.sh
16
16
  FROM base
17
17
  RUN mkdir lib/arstotzka -p
18
18
 
19
- USER root
20
-
21
- COPY --chown=app:app --from=builder /home/app/bundle/gems /usr/local/bundle/gems
22
- COPY --chown=app:app --from=builder /home/app/bundle/cache /usr/local/bundle/cache
23
- COPY --chown=app:app --from=builder /home/app/bundle/specifications /usr/local/bundle/specifications
24
- COPY --chown=app:app --from=builder /home/app/bundle/bin /usr/local/bundle/bin
25
- COPY --chown=app:app --from=builder /home/app/bundle/extensions /usr/local/bundle/extensions
19
+ COPY --chown=app:app --from=builder /home/app/bundle/ /usr/local/bundle/
26
20
 
27
21
  COPY --chown=app ./*.gemspec ./Gemfile /home/app/app/
28
22
  COPY --chown=app ./lib/arstotzka/version.rb /home/app/app/lib/arstotzka/
29
- USER app
23
+
30
24
  RUN bundle install
data/README.md CHANGED
@@ -6,7 +6,6 @@ Arstotzka
6
6
  [![Issue Count](https://codeclimate.com/github/darthjee/arstotzka/badges/issue_count.svg)](https://codeclimate.com/github/darthjee/arstotzka)
7
7
  [![Gem Version](https://badge.fury.io/rb/arstotzka.svg)](https://badge.fury.io/rb/arstotzka)
8
8
  [![Inline docs](http://inch-ci.org/github/darthjee/arstotzka.svg)](http://inch-ci.org/github/darthjee/arstotzka)
9
- [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
10
9
 
11
10
  ![arstotzka](https://raw.githubusercontent.com/darthjee/arstotzka/master/arstotzka.jpg)
12
11
 
@@ -22,7 +21,7 @@ JSON keys)
22
21
 
23
22
  Yard Documentation
24
23
  -------------------
25
- [https://www.rubydoc.info/gems/arstotzka/1.4.4](https://www.rubydoc.info/gems/arstotzka/1.4.4)
24
+ [https://www.rubydoc.info/gems/arstotzka/1.5.0](https://www.rubydoc.info/gems/arstotzka/1.5.0)
26
25
 
27
26
  Instalation
28
27
  ---------------
@@ -19,24 +19,24 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_runtime_dependency 'activesupport', '~> 5.x'
23
- gem.add_runtime_dependency 'sinclair', '>= 1.4.1'
22
+ gem.add_runtime_dependency 'activesupport', '~> 5.2.0'
23
+ gem.add_runtime_dependency 'sinclair', '>= 1.6.5'
24
24
 
25
- gem.add_development_dependency 'bundler', '~> 1.16.1'
25
+ gem.add_development_dependency 'bundler', '1.16.1'
26
26
  gem.add_development_dependency 'pry', '0.12.2'
27
27
  gem.add_development_dependency 'pry-nav', '0.3.0'
28
- gem.add_development_dependency 'rake', '12.3.3'
29
- gem.add_development_dependency 'reek', '5.4.0'
30
- gem.add_development_dependency 'rspec', '3.8.0'
31
- gem.add_development_dependency 'rspec-core', '3.8.0'
32
- gem.add_development_dependency 'rspec-expectations', '3.8.3'
33
- gem.add_development_dependency 'rspec-mocks', '3.8.0'
34
- gem.add_development_dependency 'rspec-support', '3.8.0'
35
- gem.add_development_dependency 'rubocop', '0.73.0'
36
- gem.add_development_dependency 'rubocop-rspec', '1.33.0'
37
- gem.add_development_dependency 'rubycritic', '4.1.0'
38
- gem.add_development_dependency 'simplecov', '0.17.0'
39
- gem.add_development_dependency 'yard', '0.9.20'
28
+ gem.add_development_dependency 'rake', '13.0.1'
29
+ gem.add_development_dependency 'reek', '5.6.0'
30
+ gem.add_development_dependency 'rspec', '3.9.0'
31
+ gem.add_development_dependency 'rspec-core', '3.9.1'
32
+ gem.add_development_dependency 'rspec-expectations', '3.9.1'
33
+ gem.add_development_dependency 'rspec-mocks', '3.9.1'
34
+ gem.add_development_dependency 'rspec-support', '3.9.2'
35
+ gem.add_development_dependency 'rubocop', '0.80.1'
36
+ gem.add_development_dependency 'rubocop-rspec', '1.38.1'
37
+ gem.add_development_dependency 'rubycritic', '4.4.1'
38
+ gem.add_development_dependency 'simplecov', '0.17.1'
39
+ gem.add_development_dependency 'yard', '0.9.24'
40
40
  gem.add_development_dependency 'yardstick', '0.9.9'
41
41
 
42
42
  gem.add_development_dependency 'safe_attribute_assignment'
@@ -243,7 +243,9 @@ module Arstotzka
243
243
  # # Danny LJ Robert Richard
244
244
  # # Linda Ariel
245
245
  # # ]
246
- class Options < ::OpenStruct
246
+ class Options < Sinclair::Options
247
+ with_options Config::DEFAULT_CONFIGS
248
+ with_options :full_path, :key, :instance, :path
247
249
  # Creates a new instance of Options
248
250
  #
249
251
  # @param options_hash [Hash] options hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arstotzka
4
- VERSION = '1.4.4'
4
+ VERSION = '1.5.0'
5
5
  end
@@ -55,7 +55,11 @@ describe Arstotzka::Config do
55
55
  flatten: false,
56
56
  json: :json,
57
57
  klass: Person,
58
- type: :none
58
+ type: :none,
59
+ full_path: nil,
60
+ key: nil,
61
+ instance: nil,
62
+ path: nil
59
63
  }
60
64
  end
61
65
 
@@ -49,6 +49,7 @@ describe Arstotzka::Options do
49
49
  ]
50
50
  end
51
51
 
52
+ # rubocop:disable RSpec/LeakyConstantDeclaration
52
53
  before do
53
54
  module Arstotzka::TypeCast
54
55
  def to_symbolized_hash(value)
@@ -56,12 +57,14 @@ describe Arstotzka::Options do
56
57
  end
57
58
  end
58
59
  end
60
+ # rubocop:enable RSpec/LeakyConstantDeclaration
59
61
 
60
62
  it 'returns inflated drinks' do
61
63
  expect(instance.drinks).to eq(expected)
62
64
  end
63
65
  end
64
66
 
67
+ # rubocop:disable RSpec/SubjectStub
65
68
  describe 'Using cached, compact, after and full_path' do
66
69
  let(:clazz) { Application }
67
70
 
@@ -85,9 +88,7 @@ describe Arstotzka::Options do
85
88
  end
86
89
 
87
90
  before do
88
- # rubocop:disable RSpec/SubjectStub
89
91
  allow(instance).to receive(:warn)
90
- # rubocop:enable RSpec/SubjectStub
91
92
  end
92
93
 
93
94
  it 'Returns created users' do
@@ -100,6 +101,7 @@ describe Arstotzka::Options do
100
101
  expect(instance).to have_received(:warn).exactly(3).times
101
102
  end
102
103
  end
104
+ # rubocop:enable RSpec/SubjectStub
103
105
 
104
106
  describe 'working with snake case hash' do
105
107
  let(:clazz) { JobSeeker }
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: truie
1
+ # frozen_string_literal: true
2
2
 
3
3
  describe Arstotzka::Wrapper do
4
4
  subject(:wrapper) { described_class.new(klass: klass, type: type) }
@@ -10,13 +10,22 @@ describe Arstotzka::Config do
10
10
  end
11
11
 
12
12
  describe '#options' do
13
+ let(:expected_options_hash) do
14
+ described_class::DEFAULT_CONFIGS.merge(
15
+ full_path: nil,
16
+ key: nil,
17
+ instance: nil,
18
+ path: nil
19
+ )
20
+ end
21
+
13
22
  it do
14
23
  expect(config.options).to be_a(Arstotzka::Options)
15
24
  end
16
25
 
17
26
  it 'generates options with default values' do
18
27
  expect(config.options.to_h)
19
- .to eq(described_class::DEFAULT_CONFIGS)
28
+ .to eq(expected_options_hash)
20
29
  end
21
30
 
22
31
  context 'when configuring it' do
@@ -31,7 +40,11 @@ describe Arstotzka::Config do
31
40
  flatten: true,
32
41
  json: :@hash,
33
42
  klass: Account,
34
- type: :string
43
+ type: :string,
44
+ full_path: nil,
45
+ key: nil,
46
+ instance: nil,
47
+ path: nil
35
48
  }
36
49
  end
37
50
 
@@ -72,7 +85,11 @@ describe Arstotzka::Config do
72
85
  flatten: true,
73
86
  json: :@hash,
74
87
  klass: Account,
75
- type: :string
88
+ type: :string,
89
+ full_path: nil,
90
+ key: nil,
91
+ instance: nil,
92
+ path: nil
76
93
  }
77
94
  end
78
95
 
@@ -163,7 +163,7 @@ describe Arstotzka::Fetcher do
163
163
  end
164
164
  end
165
165
 
166
- context 'when json is an instance variable' do
166
+ context 'when json is an class variable' do
167
167
  let(:instance) { described_class::ClassVariable.new }
168
168
  let(:hash) { { name: 'John Doe' } }
169
169
  let(:options_hash) { { key: :name, json: :@@json } }
@@ -159,13 +159,13 @@ describe Arstotzka::Options do
159
159
  end
160
160
  end
161
161
 
162
+ # rubocop:disable RSpec/SubjectStub
163
+ # rubocop:disable RSpec/AnyInstance
162
164
  describe '#klass' do
163
- # rubocop:disable RSpec/AnyInstance
164
165
  before do
165
166
  allow_any_instance_of(described_class)
166
167
  .to receive(:warn)
167
168
  end
168
- # rubocop:enable RSpec/AnyInstance
169
169
 
170
170
  context 'when initializing with old class key' do
171
171
  let(:options_hash) { { class: Star } }
@@ -191,6 +191,8 @@ describe Arstotzka::Options do
191
191
  end
192
192
  end
193
193
  end
194
+ # rubocop:enable RSpec/AnyInstance
195
+ # rubocop:enable RSpec/SubjectStub
194
196
 
195
197
  describe '#merge' do
196
198
  let(:options_hash) { { json: :hash, default: 10 } }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arstotzka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darthjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2020-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,40 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.x
19
+ version: 5.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.x
26
+ version: 5.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinclair
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.1
33
+ version: 1.6.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.1
40
+ version: 1.6.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.16.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.16.1
55
55
  - !ruby/object:Gem::Dependency
@@ -86,168 +86,168 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 12.3.3
89
+ version: 13.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 12.3.3
96
+ version: 13.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: reek
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 5.4.0
103
+ version: 5.6.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 5.4.0
110
+ version: 5.6.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 3.8.0
117
+ version: 3.9.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 3.8.0
124
+ version: 3.9.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec-core
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 3.8.0
131
+ version: 3.9.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 3.8.0
138
+ version: 3.9.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec-expectations
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 3.8.3
145
+ version: 3.9.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 3.8.3
152
+ version: 3.9.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec-mocks
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 3.8.0
159
+ version: 3.9.1
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 3.8.0
166
+ version: 3.9.1
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec-support
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 3.8.0
173
+ version: 3.9.2
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 3.8.0
180
+ version: 3.9.2
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rubocop
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 0.73.0
187
+ version: 0.80.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: 0.73.0
194
+ version: 0.80.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rubocop-rspec
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - '='
200
200
  - !ruby/object:Gem::Version
201
- version: 1.33.0
201
+ version: 1.38.1
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
- version: 1.33.0
208
+ version: 1.38.1
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: rubycritic
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 4.1.0
215
+ version: 4.4.1
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 4.1.0
222
+ version: 4.4.1
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: simplecov
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: 0.17.0
229
+ version: 0.17.1
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: 0.17.0
236
+ version: 0.17.1
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: yard
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 0.9.20
243
+ version: 0.9.24
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 0.9.20
250
+ version: 0.9.24
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: yardstick
253
253
  requirement: !ruby/object:Gem::Requirement