ruby-dmm 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -57
  3. data/.rubocop_todo.yml +59 -24
  4. data/.travis.yml +4 -2
  5. data/Guardfile +1 -1
  6. data/README.md +30 -28
  7. data/lib/ruby-dmm.rb +3 -18
  8. data/lib/ruby-dmm/client.rb +42 -59
  9. data/lib/ruby-dmm/response.rb +18 -32
  10. data/lib/ruby-dmm/version.rb +1 -1
  11. data/ruby-dmm.gemspec +7 -11
  12. data/spec/spec_helper.rb +63 -49
  13. metadata +39 -151
  14. data/lib/faraday/response/raise_dmm_error.rb +0 -26
  15. data/lib/faraday_middleware/response/dmm_rashify.rb +0 -34
  16. data/lib/multi_xml_tweaks.rb +0 -27
  17. data/lib/ruby-dmm/client/item_list.rb +0 -45
  18. data/lib/ruby-dmm/configuration.rb +0 -41
  19. data/lib/ruby-dmm/error.rb +0 -14
  20. data/lib/ruby-dmm/response/item.rb +0 -70
  21. data/lib/ruby-dmm/response/item_info.rb +0 -55
  22. data/spec/client_spec.rb +0 -32
  23. data/spec/fixtures/com.xml +0 -5987
  24. data/spec/fixtures/com_digital.xml +0 -1115
  25. data/spec/fixtures/com_digital_book.xml +0 -3407
  26. data/spec/fixtures/com_iroiro.xml +0 -1711
  27. data/spec/fixtures/com_lod.xml +0 -125
  28. data/spec/fixtures/com_mono.xml +0 -3723
  29. data/spec/fixtures/com_monthly.xml +0 -2075
  30. data/spec/fixtures/com_pcsoft.xml +0 -729
  31. data/spec/fixtures/com_rental.xml +0 -2691
  32. data/spec/fixtures/r18.xml +0 -4203
  33. data/spec/fixtures/r18_book.xml +0 -4965
  34. data/spec/fixtures/r18_digital.xml +0 -26987
  35. data/spec/fixtures/r18_doujin.xml +0 -2741
  36. data/spec/fixtures/r18_mono.xml +0 -3723
  37. data/spec/fixtures/r18_monthly.xml +0 -3515
  38. data/spec/fixtures/r18_pcgame.xml +0 -3373
  39. data/spec/fixtures/r18_ppm.xml +0 -2883
  40. data/spec/fixtures/r18_rental.xml +0 -12371
  41. data/spec/fixtures/request_error.xml +0 -24
  42. data/spec/fixtures/zero_items.xml +0 -37
  43. data/spec/response/item_info_spec.rb +0 -89
  44. data/spec/response/item_spec.rb +0 -67
  45. data/spec/response_spec.rb +0 -77
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module DMM
3
- VERSION = '0.1.5'
3
+ VERSION = '0.2.0'
4
4
  end
@@ -8,9 +8,9 @@ Gem::Specification.new do |gem|
8
8
  gem.version = DMM::VERSION
9
9
  gem.authors = ['meganemura']
10
10
  gem.email = ['mura2megane@gmail.com']
11
- gem.description = 'Client for the DMM Web Service API 2.0.'
12
- gem.summary = 'Client for the DMM Web Service API 2.0.'
13
- gem.homepage = ''
11
+ gem.description = 'Client for the DMM Web Service API v3.0.'
12
+ gem.summary = 'Client for the DMM Web Service API v3.0.'
13
+ gem.homepage = 'https://github.com/meganemura/ruby-dmm'
14
14
 
15
15
  gem.files = `git ls-files -z`.split("\x0")
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
@@ -19,18 +19,14 @@ Gem::Specification.new do |gem|
19
19
  gem.licenses = ['MIT']
20
20
  gem.homepage = 'https://github.com/meganemura/ruby-dmm'
21
21
 
22
- gem.add_dependency 'faraday', '~> 0.8'
22
+ gem.add_dependency 'activesupport'
23
+ gem.add_dependency 'faraday', '~> 0.9'
23
24
  gem.add_dependency 'faraday_middleware'
24
- gem.add_dependency 'multi_xml'
25
- gem.add_dependency 'rash'
26
25
 
27
26
  gem.add_development_dependency 'rake'
28
- gem.add_development_dependency 'rspec'
29
- gem.add_development_dependency 'webmock'
27
+ gem.add_development_dependency 'rspec', '~> 3.4.0'
30
28
  gem.add_development_dependency 'pry'
31
- gem.add_development_dependency 'guard-rspec'
32
- gem.add_development_dependency 'ox'
33
- gem.add_development_dependency 'rubocop'
29
+ gem.add_development_dependency 'rubocop', '~> 0.40.0'
34
30
  gem.add_development_dependency 'coveralls'
35
31
  gem.add_development_dependency 'simplecov'
36
32
  end
@@ -1,60 +1,74 @@
1
- # encoding: utf-8
2
- require 'ruby-dmm'
3
- require 'webmock/rspec'
4
-
5
- require 'coveralls'
6
- Coveralls.wear!
7
-
8
- # This file was generated by the `rspec --init` command. Conventionally, all
9
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
10
- # Require this file using `require "spec_helper"` to ensure that it is only
11
- # loaded once.
12
- #
13
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
14
1
  RSpec.configure do |config|
15
- config.run_all_when_everything_filtered = true
16
- config.filter_run :focus
2
+ # rspec-expectations config goes here. You can use an alternate
3
+ # assertion/expectation library such as wrong or the stdlib/minitest
4
+ # assertions if you prefer.
5
+ config.expect_with :rspec do |expectations|
6
+ # This option will default to `true` in RSpec 4. It makes the `description`
7
+ # and `failure_message` of custom matchers include text for helper methods
8
+ # defined using `chain`, e.g.:
9
+ # be_bigger_than(2).and_smaller_than(4).description
10
+ # # => "be bigger than 2 and smaller than 4"
11
+ # ...rather than:
12
+ # # => "be bigger than 2"
13
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
14
+ end
17
15
 
18
- # Run specs in random order to surface order dependencies. If you find an
19
- # order dependency and want to debug it, you can fix the order by providing
20
- # the seed, which is printed after each run.
21
- # --seed 1234
22
- config.order = 'random'
23
- end
16
+ # rspec-mocks config goes here. You can use an alternate test double
17
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
18
+ config.mock_with :rspec do |mocks|
19
+ # Prevents you from mocking or stubbing a method that does not exist on
20
+ # a real object. This is generally recommended, and will default to
21
+ # `true` in RSpec 4.
22
+ mocks.verify_partial_doubles = true
23
+ end
24
24
 
25
- def fixture_path
26
- File.expand_path(File.dirname(__FILE__) + '/fixtures/')
27
- end
25
+ # These two settings work together to allow you to limit a spec run
26
+ # to individual examples or groups you care about by tagging them with
27
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
28
+ # get run.
29
+ config.filter_run :focus
30
+ config.run_all_when_everything_filtered = true
28
31
 
29
- def fixture(file)
30
- File.new(fixture_path + '/' + file, 'rb')
31
- end
32
+ # Allows RSpec to persist some state between runs in order to support
33
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
34
+ # you configure your source control system to ignore this file.
35
+ config.example_status_persistence_file_path = "spec/examples.txt"
32
36
 
33
- def all_fixtures
34
- Dir.glob(fixture_path + '/' + '*.xml').map { |x| File.basename(x) }.sort
35
- end
37
+ # Limits the available syntax to the non-monkey patched syntax that is
38
+ # recommended. For more details, see:
39
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
40
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
41
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
42
+ config.disable_monkey_patching!
36
43
 
37
- def fixtures
38
- if ENV['GUARD_TEST']
39
- all_fixtures.shuffle.pop(2)
40
- else
41
- all_fixtures
44
+ # This setting enables warnings. It's recommended, but in some cases may
45
+ # be too noisy due to issues in dependencies.
46
+ config.warnings = true
47
+
48
+ # Many RSpec users commonly either run the entire suite or an individual
49
+ # file, and it's useful to allow more verbose output when running an
50
+ # individual spec file.
51
+ if config.files_to_run.one?
52
+ # Use the documentation formatter for detailed output,
53
+ # unless a formatter has already been configured
54
+ # (e.g. via a command-line flag).
55
+ config.default_formatter = 'doc'
42
56
  end
43
- end
44
57
 
45
- def random_fixture
46
- all_fixtures.shuffle.first
47
- end
58
+ # Print the 10 slowest examples and example groups at the
59
+ # end of the spec run, to help surface which specs are running
60
+ # particularly slow.
61
+ config.profile_examples = 10
48
62
 
49
- def xml_response(file)
50
- {
51
- :body => fixture(file),
52
- :headers => {
53
- :content_type => 'text/xml; charset=euc-jp'
54
- }
55
- }
56
- end
63
+ # Run specs in random order to surface order dependencies. If you find an
64
+ # order dependency and want to debug it, you can fix the order by providing
65
+ # the seed, which is printed after each run.
66
+ # --seed 1234
67
+ config.order = :random
57
68
 
58
- def stub_get
59
- stub_request(:get, Regexp.compile(Regexp.escape(DMM::Configuration::DEFAULT_API_ENDPOINT)))
69
+ # Seed global randomization in this process using the `--seed` CLI option.
70
+ # Setting this allows you to use `--seed` to deterministically reproduce
71
+ # test failures related to randomization by passing the same `--seed` value
72
+ # as the one that triggered the failure.
73
+ Kernel.srand config.seed
60
74
  end
metadata CHANGED
@@ -1,251 +1,163 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dmm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - meganemura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-09 00:00:00.000000000 Z
11
+ date: 2016-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '0.8'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '0.8'
27
- - !ruby/object:Gem::Dependency
28
- name: faraday_middleware
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
17
+ - - ">="
32
18
  - !ruby/object:Gem::Version
33
19
  version: '0'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - '>='
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
26
  version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
- name: multi_xml
28
+ name: faraday
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - '>='
31
+ - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '0'
33
+ version: '0.9'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '0'
40
+ version: '0.9'
55
41
  - !ruby/object:Gem::Dependency
56
- name: rash
42
+ name: faraday_middleware
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - '>='
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
47
  version: '0'
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - '>='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: '0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: webmock
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
73
+ - - "~>"
102
74
  - !ruby/object:Gem::Version
103
- version: '0'
75
+ version: 3.4.0
104
76
  type: :development
105
77
  prerelease: false
106
78
  version_requirements: !ruby/object:Gem::Requirement
107
79
  requirements:
108
- - - '>='
80
+ - - "~>"
109
81
  - !ruby/object:Gem::Version
110
- version: '0'
82
+ version: 3.4.0
111
83
  - !ruby/object:Gem::Dependency
112
84
  name: pry
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: guard-rspec
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '>='
87
+ - - ">="
130
88
  - !ruby/object:Gem::Version
131
89
  version: '0'
132
90
  type: :development
133
91
  prerelease: false
134
92
  version_requirements: !ruby/object:Gem::Requirement
135
93
  requirements:
136
- - - '>='
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: ox
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - '>='
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - '>='
94
+ - - ">="
151
95
  - !ruby/object:Gem::Version
152
96
  version: '0'
153
97
  - !ruby/object:Gem::Dependency
154
98
  name: rubocop
155
99
  requirement: !ruby/object:Gem::Requirement
156
100
  requirements:
157
- - - '>='
101
+ - - "~>"
158
102
  - !ruby/object:Gem::Version
159
- version: '0'
103
+ version: 0.40.0
160
104
  type: :development
161
105
  prerelease: false
162
106
  version_requirements: !ruby/object:Gem::Requirement
163
107
  requirements:
164
- - - '>='
108
+ - - "~>"
165
109
  - !ruby/object:Gem::Version
166
- version: '0'
110
+ version: 0.40.0
167
111
  - !ruby/object:Gem::Dependency
168
112
  name: coveralls
169
113
  requirement: !ruby/object:Gem::Requirement
170
114
  requirements:
171
- - - '>='
115
+ - - ">="
172
116
  - !ruby/object:Gem::Version
173
117
  version: '0'
174
118
  type: :development
175
119
  prerelease: false
176
120
  version_requirements: !ruby/object:Gem::Requirement
177
121
  requirements:
178
- - - '>='
122
+ - - ">="
179
123
  - !ruby/object:Gem::Version
180
124
  version: '0'
181
125
  - !ruby/object:Gem::Dependency
182
126
  name: simplecov
183
127
  requirement: !ruby/object:Gem::Requirement
184
128
  requirements:
185
- - - '>='
129
+ - - ">="
186
130
  - !ruby/object:Gem::Version
187
131
  version: '0'
188
132
  type: :development
189
133
  prerelease: false
190
134
  version_requirements: !ruby/object:Gem::Requirement
191
135
  requirements:
192
- - - '>='
136
+ - - ">="
193
137
  - !ruby/object:Gem::Version
194
138
  version: '0'
195
- description: Client for the DMM Web Service API 2.0.
139
+ description: Client for the DMM Web Service API v3.0.
196
140
  email:
197
141
  - mura2megane@gmail.com
198
142
  executables: []
199
143
  extensions: []
200
144
  extra_rdoc_files: []
201
145
  files:
202
- - .gitignore
203
- - .rspec
204
- - .rubocop.yml
205
- - .rubocop_todo.yml
206
- - .travis.yml
146
+ - ".gitignore"
147
+ - ".rspec"
148
+ - ".rubocop.yml"
149
+ - ".rubocop_todo.yml"
150
+ - ".travis.yml"
207
151
  - Gemfile
208
152
  - Guardfile
209
153
  - LICENSE.txt
210
154
  - README.md
211
155
  - Rakefile
212
- - lib/faraday/response/raise_dmm_error.rb
213
- - lib/faraday_middleware/response/dmm_rashify.rb
214
- - lib/multi_xml_tweaks.rb
215
156
  - lib/ruby-dmm.rb
216
157
  - lib/ruby-dmm/client.rb
217
- - lib/ruby-dmm/client/item_list.rb
218
- - lib/ruby-dmm/configuration.rb
219
- - lib/ruby-dmm/error.rb
220
158
  - lib/ruby-dmm/response.rb
221
- - lib/ruby-dmm/response/item.rb
222
- - lib/ruby-dmm/response/item_info.rb
223
159
  - lib/ruby-dmm/version.rb
224
160
  - ruby-dmm.gemspec
225
- - spec/client_spec.rb
226
- - spec/fixtures/com.xml
227
- - spec/fixtures/com_digital.xml
228
- - spec/fixtures/com_digital_book.xml
229
- - spec/fixtures/com_iroiro.xml
230
- - spec/fixtures/com_lod.xml
231
- - spec/fixtures/com_mono.xml
232
- - spec/fixtures/com_monthly.xml
233
- - spec/fixtures/com_pcsoft.xml
234
- - spec/fixtures/com_rental.xml
235
- - spec/fixtures/r18.xml
236
- - spec/fixtures/r18_book.xml
237
- - spec/fixtures/r18_digital.xml
238
- - spec/fixtures/r18_doujin.xml
239
- - spec/fixtures/r18_mono.xml
240
- - spec/fixtures/r18_monthly.xml
241
- - spec/fixtures/r18_pcgame.xml
242
- - spec/fixtures/r18_ppm.xml
243
- - spec/fixtures/r18_rental.xml
244
- - spec/fixtures/request_error.xml
245
- - spec/fixtures/zero_items.xml
246
- - spec/response/item_info_spec.rb
247
- - spec/response/item_spec.rb
248
- - spec/response_spec.rb
249
161
  - spec/spec_helper.rb
250
162
  homepage: https://github.com/meganemura/ruby-dmm
251
163
  licenses:
@@ -257,43 +169,19 @@ require_paths:
257
169
  - lib
258
170
  required_ruby_version: !ruby/object:Gem::Requirement
259
171
  requirements:
260
- - - '>='
172
+ - - ">="
261
173
  - !ruby/object:Gem::Version
262
174
  version: '0'
263
175
  required_rubygems_version: !ruby/object:Gem::Requirement
264
176
  requirements:
265
- - - '>='
177
+ - - ">="
266
178
  - !ruby/object:Gem::Version
267
179
  version: '0'
268
180
  requirements: []
269
181
  rubyforge_project:
270
- rubygems_version: 2.0.3
182
+ rubygems_version: 2.5.1
271
183
  signing_key:
272
184
  specification_version: 4
273
- summary: Client for the DMM Web Service API 2.0.
185
+ summary: Client for the DMM Web Service API v3.0.
274
186
  test_files:
275
- - spec/client_spec.rb
276
- - spec/fixtures/com.xml
277
- - spec/fixtures/com_digital.xml
278
- - spec/fixtures/com_digital_book.xml
279
- - spec/fixtures/com_iroiro.xml
280
- - spec/fixtures/com_lod.xml
281
- - spec/fixtures/com_mono.xml
282
- - spec/fixtures/com_monthly.xml
283
- - spec/fixtures/com_pcsoft.xml
284
- - spec/fixtures/com_rental.xml
285
- - spec/fixtures/r18.xml
286
- - spec/fixtures/r18_book.xml
287
- - spec/fixtures/r18_digital.xml
288
- - spec/fixtures/r18_doujin.xml
289
- - spec/fixtures/r18_mono.xml
290
- - spec/fixtures/r18_monthly.xml
291
- - spec/fixtures/r18_pcgame.xml
292
- - spec/fixtures/r18_ppm.xml
293
- - spec/fixtures/r18_rental.xml
294
- - spec/fixtures/request_error.xml
295
- - spec/fixtures/zero_items.xml
296
- - spec/response/item_info_spec.rb
297
- - spec/response/item_spec.rb
298
- - spec/response_spec.rb
299
187
  - spec/spec_helper.rb