rakuten_web_service 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.vscode/launch.json +30 -0
  3. data/.vscode/tasks.json +70 -0
  4. data/CHANGELOG.md +6 -0
  5. data/bin/rake +17 -0
  6. data/bin/rspec +17 -0
  7. data/lib/rakuten_web_service/books/resource.rb +1 -1
  8. data/lib/rakuten_web_service/books/total.rb +2 -2
  9. data/lib/rakuten_web_service/configuration.rb +1 -1
  10. data/lib/rakuten_web_service/genre.rb +13 -11
  11. data/lib/rakuten_web_service/gora/course.rb +1 -1
  12. data/lib/rakuten_web_service/gora/course_detail.rb +2 -2
  13. data/lib/rakuten_web_service/gora/plan.rb +1 -1
  14. data/lib/rakuten_web_service/ichiba/item.rb +1 -1
  15. data/lib/rakuten_web_service/ichiba/product.rb +1 -1
  16. data/lib/rakuten_web_service/ichiba/ranking.rb +1 -1
  17. data/lib/rakuten_web_service/kobo/ebook.rb +1 -1
  18. data/lib/rakuten_web_service/resource.rb +1 -1
  19. data/lib/rakuten_web_service/search_result.rb +5 -5
  20. data/lib/rakuten_web_service/version.rb +1 -1
  21. data/rakuten_web_service.gemspec +2 -0
  22. data/spec/fixtures/books/book_search_with_keyword_Ruby.json +1002 -1112
  23. data/spec/fixtures/books/cd_search_with_keyword_Ruby.json +949 -1
  24. data/spec/fixtures/books/dvd_search_with_keyword_Ruby.json +719 -1
  25. data/spec/fixtures/books/foreign_book_search_with_keyword_Ruby.json +865 -1
  26. data/spec/fixtures/books/game_search_with_keyword_Ruby.json +128 -1
  27. data/spec/fixtures/books/genre_search.json +45 -1
  28. data/spec/fixtures/books/magazine_search_with_keyword_Ruby.json +938 -1
  29. data/spec/fixtures/books/software_search_with_keyword_Ruby.json +591 -1
  30. data/spec/fixtures/books/total_search_with_keyword_Ruby.json +931 -1
  31. data/spec/fixtures/gora/course_detail_search.json +150 -1
  32. data/spec/fixtures/gora/course_search_with_Karuizawa.json +459 -1
  33. data/spec/fixtures/gora/plan_search_with_area_code.json +219 -1
  34. data/spec/fixtures/ichiba/genre_search.json +192 -1
  35. data/spec/fixtures/ichiba/item_search_with_keyword_Ruby.json +1468 -1805
  36. data/spec/fixtures/ichiba/parents_genre_search.json +385 -1
  37. data/spec/fixtures/ichiba/product_search.json +1774 -1
  38. data/spec/fixtures/ichiba/ranking_search.json +1290 -1
  39. data/spec/fixtures/kobo/ebook_search_with_Ruby.json +709 -807
  40. data/spec/fixtures/kobo/genre_search.json +105 -1
  41. data/spec/fixtures/recipe/category.json +11769 -1
  42. data/spec/fixtures/recipe/ranking.json +107 -1
  43. data/spec/rakuten_web_service/books/book_spec.rb +5 -4
  44. data/spec/rakuten_web_service/books/cd_spec.rb +3 -2
  45. data/spec/rakuten_web_service/books/dvd_spec.rb +3 -2
  46. data/spec/rakuten_web_service/books/foreign_book_spec.rb +3 -2
  47. data/spec/rakuten_web_service/books/game_spec.rb +3 -2
  48. data/spec/rakuten_web_service/books/genre_spec.rb +2 -1
  49. data/spec/rakuten_web_service/books/magazine_spec.rb +3 -2
  50. data/spec/rakuten_web_service/books/software_spec.rb +3 -2
  51. data/spec/rakuten_web_service/books/total_spec.rb +2 -1
  52. data/spec/rakuten_web_service/client_spec.rb +2 -1
  53. data/spec/rakuten_web_service/gora/course_detail_spec.rb +3 -2
  54. data/spec/rakuten_web_service/gora/course_spec.rb +3 -1
  55. data/spec/rakuten_web_service/gora/plan_spec.rb +2 -1
  56. data/spec/rakuten_web_service/ichiba/genre_spec.rb +40 -15
  57. data/spec/rakuten_web_service/ichiba/item_spec.rb +4 -3
  58. data/spec/rakuten_web_service/ichiba/product_search_spec.rb +2 -1
  59. data/spec/rakuten_web_service/ichiba/ranking_spec.rb +4 -2
  60. data/spec/rakuten_web_service/ichiba/shop_spec.rb +1 -0
  61. data/spec/rakuten_web_service/kobo/ebook_spec.rb +2 -2
  62. data/spec/rakuten_web_service/kobo/genre_spec.rb +1 -0
  63. data/spec/rakuten_web_service/recipe/category_spec.rb +1 -0
  64. data/spec/rakuten_web_service/recipe_spec.rb +3 -1
  65. metadata +34 -2
@@ -8,6 +8,7 @@ describe RakutenWebService::Ichiba::Item do
8
8
  {
9
9
  affiliateId: affiliate_id,
10
10
  applicationId: application_id,
11
+ formatVersion: '2',
11
12
  keyword: 'Ruby'
12
13
  }
13
14
  end
@@ -46,7 +47,7 @@ describe RakutenWebService::Ichiba::Item do
46
47
  describe 'a respond object' do
47
48
  let(:expected_json) do
48
49
  response = JSON.parse(fixture('ichiba/item_search_with_keyword_Ruby.json'))
49
- response['Items'][0]['Item']
50
+ response['Items'][0]
50
51
  end
51
52
 
52
53
  subject { @items.first }
@@ -178,7 +179,7 @@ describe RakutenWebService::Ichiba::Item do
178
179
  stub_request(:get, endpoint).with(query: expected_query).
179
180
  to_return(body: response.to_json)
180
181
 
181
- expected_item = response['Items'][0]['Item']
182
+ expected_item = response['Items'][0]
182
183
  expect(RakutenWebService::Ichiba::Genre).to receive('new').with(expected_item['genreId'])
183
184
  end
184
185
 
@@ -191,7 +192,7 @@ describe RakutenWebService::Ichiba::Item do
191
192
 
192
193
  describe '#shop' do
193
194
  let(:response) { JSON.parse(fixture('ichiba/item_search_with_keyword_Ruby.json')) }
194
- let(:expected_item) { response['Items'][0]['Item'] }
195
+ let(:expected_item) { response['Items'][0] }
195
196
 
196
197
  before do
197
198
  stub_request(:get, endpoint).with(query: expected_query).
@@ -8,6 +8,7 @@ describe RakutenWebService::Ichiba::Product do
8
8
  {
9
9
  affiliateId: affiliate_id,
10
10
  applicationId: application_id,
11
+ formatVersion: '2',
11
12
  keyword: 'Ruby'
12
13
  }
13
14
  end
@@ -42,7 +43,7 @@ describe RakutenWebService::Ichiba::Product do
42
43
 
43
44
  describe 'For an response' do
44
45
  let(:expected_product) do
45
- JSON.parse(fixture('ichiba/product_search.json'))['Products'].first['Product']
46
+ JSON.parse(fixture('ichiba/product_search.json'))['Products'].first
46
47
  end
47
48
  let(:product) { RakutenWebService::Ichiba::Product.search(keyword: 'Ruby').first }
48
49
 
@@ -7,7 +7,9 @@ describe RakutenWebService::Ichiba::RankingItem do
7
7
  let(:application_id) { 'application_id' }
8
8
  let(:expected_query) do
9
9
  {
10
- affiliateId: affiliate_id, applicationId: application_id
10
+ affiliateId: affiliate_id,
11
+ applicationId: application_id,
12
+ formatVersion: '2'
11
13
  }
12
14
  end
13
15
 
@@ -25,7 +27,7 @@ describe RakutenWebService::Ichiba::RankingItem do
25
27
  describe '.search' do
26
28
  let(:expected_json) do
27
29
  response = JSON.parse(fixture('ichiba/ranking_search.json'))
28
- response['Items'][0]['Item']
30
+ response['Items'][0]
29
31
  end
30
32
 
31
33
  before do
@@ -14,6 +14,7 @@ describe RakutenWebService::Ichiba::Shop do
14
14
  {
15
15
  'affiliateId' => affiliate_id,
16
16
  'applicationId' => application_id,
17
+ 'formatVersion' => '2',
17
18
  'shopCode' => 'hogeshop'
18
19
  }
19
20
  end
@@ -8,6 +8,7 @@ describe RakutenWebService::Kobo::Ebook do
8
8
  {
9
9
  affiliateId: affiliate_id,
10
10
  applicationId: application_id,
11
+ formatVersion: '2',
11
12
  title: 'Ruby'
12
13
  }
13
14
  end
@@ -54,7 +55,6 @@ describe RakutenWebService::Kobo::Ebook do
54
55
 
55
56
  it "returns the current genre information" do
56
57
  expect(subject.name).to eq("電子書籍")
57
- expect(subject.item_count).to eq("660")
58
58
  end
59
59
  end
60
60
  end
@@ -66,7 +66,7 @@ describe RakutenWebService::Kobo::Ebook do
66
66
  stub_request(:get, endpoint).with(query: expected_query).
67
67
  to_return(body: response.to_json)
68
68
 
69
- expected_item = response['Items'][0]['Item']
69
+ expected_item = response['Items'][0]
70
70
  expect(RakutenWebService::Kobo::Genre).to receive('new').with(expected_item['koboGenreId'])
71
71
 
72
72
  RakutenWebService::Kobo::Ebook.search(title: 'Ruby').first.genre
@@ -9,6 +9,7 @@ describe RWS::Kobo::Genre do
9
9
  {
10
10
  affiliateId: affiliate_id,
11
11
  applicationId: application_id,
12
+ formatVersion: '2',
12
13
  koboGenreId: genre_id
13
14
  }
14
15
  end
@@ -8,6 +8,7 @@ describe RakutenWebService::Recipe::Category do
8
8
  {
9
9
  affiliateId: affiliate_id,
10
10
  applicationId: application_id,
11
+ formatVersion: '2',
11
12
  categoryType: category_type
12
13
  }
13
14
  end
@@ -8,13 +8,15 @@ describe RakutenWebService::Recipe do
8
8
  {
9
9
  affiliateId: affiliate_id,
10
10
  applicationId: application_id,
11
+ formatVersion: '2',
11
12
  categoryId: category_id
12
13
  }
13
14
  end
14
15
  let(:expected_query_without_category_id) do
15
16
  {
16
17
  affiliateId: affiliate_id,
17
- applicationId: application_id
18
+ applicationId: application_id,
19
+ formatVersion: '2'
18
20
  }
19
21
  end
20
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakuten_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Sato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: ruby-debug-ide
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.6.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.6.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: debase
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.2.beta10
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.2.beta10
83
111
  description: Ruby Client for Rakuten Web Service
84
112
  email:
85
113
  - tatsuya.b.sato@mail.rakuten.com
@@ -90,6 +118,8 @@ files:
90
118
  - ".codeclimate.yml"
91
119
  - ".gitignore"
92
120
  - ".travis.yml"
121
+ - ".vscode/launch.json"
122
+ - ".vscode/tasks.json"
93
123
  - CHANGELOG.md
94
124
  - CODE_OF_CONDUCT.md
95
125
  - Gemfile
@@ -97,6 +127,8 @@ files:
97
127
  - README.ja.md
98
128
  - README.md
99
129
  - Rakefile
130
+ - bin/rake
131
+ - bin/rspec
100
132
  - examples/books_item_search.rb
101
133
  - examples/gora_search.rb
102
134
  - examples/ichiba_item_search.rb