arstotzka 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +19 -8
  3. data/.gitignore +3 -0
  4. data/.rubocop.yml +1 -0
  5. data/.rubocop_todo.yml +6 -3
  6. data/.yardopts +1 -0
  7. data/Dockerfile +8 -0
  8. data/README.md +2 -3
  9. data/Rakefile +2 -0
  10. data/arstotzka.gemspec +11 -8
  11. data/config/yardstick.rb +13 -0
  12. data/config/yardstick.yml +69 -0
  13. data/docker-compose.yml +14 -9
  14. data/lib/arstotzka/builder.rb +72 -0
  15. data/lib/arstotzka/class_methods.rb +9 -2
  16. data/lib/arstotzka/crawler.rb +56 -5
  17. data/lib/arstotzka/fetcher.rb +43 -14
  18. data/lib/arstotzka/reader.rb +44 -1
  19. data/lib/arstotzka/type_cast.rb +114 -1
  20. data/lib/arstotzka/version.rb +1 -1
  21. data/lib/arstotzka/wrapper.rb +47 -2
  22. data/spec/integration/readme/arstotzka_spec.rb +41 -0
  23. data/spec/integration/readme/my_parser_spec.rb +14 -13
  24. data/spec/integration/yard/arstotzka/crawler_spec.rb +9 -9
  25. data/spec/integration/yard/arstotzka/fetcher_spec.rb +4 -4
  26. data/spec/integration/yard/arstotzka/reader_spec.rb +7 -7
  27. data/spec/integration/yard/arstotzka/type_cast_spec.rb +55 -0
  28. data/spec/integration/yard/arstotzka/wrapper_spec.rb +30 -14
  29. data/spec/integration/yard/arstotzka_spec.rb +9 -9
  30. data/spec/lib/arstotzka/builder_spec.rb +18 -16
  31. data/spec/lib/arstotzka/crawler_spec.rb +21 -13
  32. data/spec/lib/arstotzka/fetcher_spec.rb +12 -10
  33. data/spec/lib/arstotzka/reader_spec.rb +16 -16
  34. data/spec/lib/arstotzka/wrapper_spec.rb +8 -2
  35. data/spec/lib/arstotzka_spec.rb +23 -23
  36. data/spec/support/models/car.rb +10 -0
  37. data/spec/support/models/car_collector.rb +20 -0
  38. data/spec/support/models/request.rb +9 -0
  39. data/spec/support/models/type_caster.rb +13 -0
  40. data/spec/support/shared_examples/wrapper.rb +2 -2
  41. metadata +65 -23
  42. data/spec/integration/readme/default_spec.rb +0 -39
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.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darthjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-25 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: 1.17.x
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
- version: '1.6'
54
+ version: 1.17.x
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry-nav
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.2.4
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.2.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,58 +86,86 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '3.7'
89
+ version: '3.8'
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: '3.7'
96
+ version: '3.8'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 0.58.1
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: '0'
110
+ version: 0.58.1
111
111
  - !ruby/object:Gem::Dependency
112
- name: safe_attribute_assignment
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.30.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 1.30.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.16.x
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.16.x
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - ">="
116
144
  - !ruby/object:Gem::Version
117
- version: '0'
145
+ version: 0.9.18
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - ">="
123
151
  - !ruby/object:Gem::Version
124
- version: '0'
152
+ version: 0.9.18
125
153
  - !ruby/object:Gem::Dependency
126
- name: simplecov
154
+ name: yardstick
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - ">="
130
158
  - !ruby/object:Gem::Version
131
- version: '0'
159
+ version: 0.9.9
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - ">="
137
165
  - !ruby/object:Gem::Version
138
- version: '0'
166
+ version: 0.9.9
139
167
  - !ruby/object:Gem::Dependency
140
- name: yard
168
+ name: safe_attribute_assignment
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
171
  - - ">="
@@ -162,6 +190,8 @@ files:
162
190
  - ".rspec"
163
191
  - ".rubocop.yml"
164
192
  - ".rubocop_todo.yml"
193
+ - ".yardopts"
194
+ - Dockerfile
165
195
  - Gemfile
166
196
  - Guardfile
167
197
  - LICENSE
@@ -169,6 +199,8 @@ files:
169
199
  - Rakefile
170
200
  - arstotzka.gemspec
171
201
  - arstotzka.jpg
202
+ - config/yardstick.rb
203
+ - config/yardstick.yml
172
204
  - docker-compose.yml
173
205
  - lib/arstotzka.rb
174
206
  - lib/arstotzka/builder.rb
@@ -185,13 +217,14 @@ files:
185
217
  - spec/fixtures/arstotzka.json
186
218
  - spec/fixtures/complete_person.json
187
219
  - spec/fixtures/person.json
188
- - spec/integration/readme/default_spec.rb
220
+ - spec/integration/readme/arstotzka_spec.rb
189
221
  - spec/integration/readme/my_parser_spec.rb
190
222
  - spec/integration/yard/arstotzka/builder_spec.rb
191
223
  - spec/integration/yard/arstotzka/class_methods_spec.rb
192
224
  - spec/integration/yard/arstotzka/crawler_spec.rb
193
225
  - spec/integration/yard/arstotzka/fetcher_spec.rb
194
226
  - spec/integration/yard/arstotzka/reader_spec.rb
227
+ - spec/integration/yard/arstotzka/type_cast_spec.rb
195
228
  - spec/integration/yard/arstotzka/wrapper_spec.rb
196
229
  - spec/integration/yard/arstotzka_spec.rb
197
230
  - spec/lib/arstotzka/builder_spec.rb
@@ -208,6 +241,8 @@ files:
208
241
  - spec/support/models/arstotzka/fetcher/dummy.rb
209
242
  - spec/support/models/arstotzka/type_cast.rb
210
243
  - spec/support/models/arstotzka/wrapper/dummy.rb
244
+ - spec/support/models/car.rb
245
+ - spec/support/models/car_collector.rb
211
246
  - spec/support/models/collector.rb
212
247
  - spec/support/models/collector/game.rb
213
248
  - spec/support/models/game.rb
@@ -215,9 +250,11 @@ files:
215
250
  - spec/support/models/my_model.rb
216
251
  - spec/support/models/my_parser.rb
217
252
  - spec/support/models/person.rb
253
+ - spec/support/models/request.rb
218
254
  - spec/support/models/star.rb
219
255
  - spec/support/models/star_gazer.rb
220
256
  - spec/support/models/transaction.rb
257
+ - spec/support/models/type_caster.rb
221
258
  - spec/support/shared_examples/wrapper.rb
222
259
  homepage: https://github.com/darthjee/arstotzka
223
260
  licenses: []
@@ -248,13 +285,14 @@ test_files:
248
285
  - spec/fixtures/arstotzka.json
249
286
  - spec/fixtures/complete_person.json
250
287
  - spec/fixtures/person.json
251
- - spec/integration/readme/default_spec.rb
288
+ - spec/integration/readme/arstotzka_spec.rb
252
289
  - spec/integration/readme/my_parser_spec.rb
253
290
  - spec/integration/yard/arstotzka/builder_spec.rb
254
291
  - spec/integration/yard/arstotzka/class_methods_spec.rb
255
292
  - spec/integration/yard/arstotzka/crawler_spec.rb
256
293
  - spec/integration/yard/arstotzka/fetcher_spec.rb
257
294
  - spec/integration/yard/arstotzka/reader_spec.rb
295
+ - spec/integration/yard/arstotzka/type_cast_spec.rb
258
296
  - spec/integration/yard/arstotzka/wrapper_spec.rb
259
297
  - spec/integration/yard/arstotzka_spec.rb
260
298
  - spec/lib/arstotzka/builder_spec.rb
@@ -271,6 +309,8 @@ test_files:
271
309
  - spec/support/models/arstotzka/fetcher/dummy.rb
272
310
  - spec/support/models/arstotzka/type_cast.rb
273
311
  - spec/support/models/arstotzka/wrapper/dummy.rb
312
+ - spec/support/models/car.rb
313
+ - spec/support/models/car_collector.rb
274
314
  - spec/support/models/collector.rb
275
315
  - spec/support/models/collector/game.rb
276
316
  - spec/support/models/game.rb
@@ -278,7 +318,9 @@ test_files:
278
318
  - spec/support/models/my_model.rb
279
319
  - spec/support/models/my_parser.rb
280
320
  - spec/support/models/person.rb
321
+ - spec/support/models/request.rb
281
322
  - spec/support/models/star.rb
282
323
  - spec/support/models/star_gazer.rb
283
324
  - spec/support/models/transaction.rb
325
+ - spec/support/models/type_caster.rb
284
326
  - spec/support/shared_examples/wrapper.rb
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe 'default option' do
6
- subject do
7
- StarGazer.new(hash).favorite_star
8
- end
9
-
10
- let(:hash) { {} }
11
-
12
- context 'when node is not found' do
13
- it 'returns the default before wrapping' do
14
- expect(subject.name).to eq('Sun')
15
- end
16
-
17
- it 'wraps the returned value in a class' do
18
- expect(subject).to be_a(Star)
19
- end
20
- end
21
-
22
- context 'when node is not missing' do
23
- let(:hash) do
24
- {
25
- universe: {
26
- star: { name: 'Antares' }
27
- }
28
- }
29
- end
30
-
31
- it 'returns the value before wrapping' do
32
- expect(subject.name).to eq('Antares')
33
- end
34
-
35
- it 'wraps the returned value in a class' do
36
- expect(subject).to be_a(Star)
37
- end
38
- end
39
- end