rakuten_web_service 1.6.1 → 1.7.0
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +5 -0
- data/README.ja.md +3 -3
- data/lib/rakuten_web_service/response.rb +8 -0
- data/lib/rakuten_web_service/search_result.rb +8 -0
- data/lib/rakuten_web_service/version.rb +1 -1
- data/rakuten_web_service.gemspec +0 -2
- data/spec/rakuten_web_service/response_spec.rb +47 -0
- metadata +4 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a44bc4bde1ee8c5cf109a3152c876ccc4d276ee8
|
4
|
+
data.tar.gz: a8abf775e41e32344864581554cce436f607572e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edd42033899a2cb395efb22eee879988da13125d9128bd28ce0e78687a26e906850adbb970d53a50d6018165ff5cbd6439d6102203017cd76a2c846fb4255074
|
7
|
+
data.tar.gz: 49eed99b36cb80112f345d62db8e7b4972af621cc38a831374761f4352c4f9dd1793230561b0064265cdd216aded8910c0601367c2f36770aa29705870581d8b
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# v1.7.0 (2017/09/17)
|
2
|
+
|
3
|
+
## Enhancements
|
4
|
+
|
5
|
+
* Add Helpers for pagination. [#78](https://github.com/rakuten-ws/rws-ruby-sdk/pull/78)
|
6
|
+
|
7
|
+
## Improvements
|
8
|
+
|
9
|
+
* Minor fix for README.ja.md [#77](https://github.com/rakuten-ws/rws-ruby-sdk/pull/77)
|
10
|
+
* Suppressing installing gems required for debugging with VSCode in CI. [#79](https://github.com/rakuten-ws/rws-ruby-sdk/pull/79)
|
11
|
+
|
12
|
+
## Thanks
|
13
|
+
|
14
|
+
I'm pleasured to say thanks to @jinco13. He fixed wrong method names and links in README.ja.md.
|
15
|
+
|
1
16
|
# v1.6.1 (2017/08/21)
|
2
17
|
|
3
18
|
## Bug Fix
|
data/Gemfile
CHANGED
data/README.ja.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
rakuten\_web\_serviceは、 Rubyから楽天が提供しているAPIに簡単にアクセスできるSDK(Software Development Kit)です。
|
8
8
|
|
9
|
-
English version is [here](http://github.com/rakuten-ws/rws-ruby-sdk/blob/master/README.
|
9
|
+
English version is [here](http://github.com/rakuten-ws/rws-ruby-sdk/blob/master/README.md).
|
10
10
|
|
11
11
|
## インストール方法
|
12
12
|
|
@@ -73,10 +73,10 @@ bundlerを利用したアプリケーションの場合、Gemfileに以下の1
|
|
73
73
|
|
74
74
|
### 設定
|
75
75
|
|
76
|
-
`RakutenWebService.
|
76
|
+
`RakutenWebService.configure` メソッドを使い、Application IDとAffiliate ID(オプション)を指定することができます。
|
77
77
|
|
78
78
|
```ruby
|
79
|
-
RakutenWebService.
|
79
|
+
RakutenWebService.configure do |c|
|
80
80
|
c.application_id = 'YOUR_APPLICATION_ID'
|
81
81
|
c.affiliate_id = 'YOUR_AFFILIATE_ID'
|
82
82
|
end
|
@@ -71,6 +71,14 @@ module RakutenWebService
|
|
71
71
|
search(page: response.page + 1)
|
72
72
|
end
|
73
73
|
|
74
|
+
def has_previous_page?
|
75
|
+
response.has_previous_page?
|
76
|
+
end
|
77
|
+
|
78
|
+
def previous_page
|
79
|
+
search(page: response.page - 1)
|
80
|
+
end
|
81
|
+
|
74
82
|
def page(num)
|
75
83
|
search(page: num)
|
76
84
|
end
|
data/rakuten_web_service.gemspec
CHANGED
@@ -22,6 +22,4 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "webmock", "~> 1.20.4"
|
23
23
|
spec.add_development_dependency "rspec", '~> 3.5.0'
|
24
24
|
spec.add_development_dependency "tapp"
|
25
|
-
spec.add_development_dependency "ruby-debug-ide", "~> 0.6.0"
|
26
|
-
spec.add_development_dependency "debase", "0.2.2.beta10"
|
27
25
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RakutenWebService::Response do
|
4
|
+
|
5
|
+
describe "Pagenate helpers" do
|
6
|
+
let(:resource_class) { double(:resource_class) }
|
7
|
+
|
8
|
+
subject { RakutenWebService::Response.new(resource_class, json) }
|
9
|
+
|
10
|
+
context "When page is less than pageCount" do
|
11
|
+
let(:json) do
|
12
|
+
{
|
13
|
+
'page' => 1, 'pageCount' => 2
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
it { is_expected.to have_next_page }
|
18
|
+
it { is_expected.to_not be_last_page }
|
19
|
+
it { is_expected.to_not have_previous_page }
|
20
|
+
it { is_expected.to be_first_page }
|
21
|
+
end
|
22
|
+
context "When page is equal to pageCount" do
|
23
|
+
let(:json) do
|
24
|
+
{
|
25
|
+
'page' => 2, 'pageCount' => 2
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
it { is_expected.to_not have_next_page }
|
30
|
+
it { is_expected.to be_last_page }
|
31
|
+
it { is_expected.to have_previous_page }
|
32
|
+
it { is_expected.to_not be_first_page }
|
33
|
+
end
|
34
|
+
context "When current page is in pages" do
|
35
|
+
let(:json) do
|
36
|
+
{
|
37
|
+
'page' => 2, 'pageCount' => 3
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
it { is_expected.to have_next_page }
|
42
|
+
it { is_expected.to_not be_last_page }
|
43
|
+
it { is_expected.to have_previous_page }
|
44
|
+
it { is_expected.to_not be_last_page }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
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.
|
4
|
+
version: 1.7.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-
|
11
|
+
date: 2017-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,34 +80,6 @@ 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
|
111
83
|
description: Ruby Client for Rakuten Web Service
|
112
84
|
email:
|
113
85
|
- tatsuya.b.sato@mail.rakuten.com
|
@@ -216,6 +188,7 @@ files:
|
|
216
188
|
- spec/rakuten_web_service/kobo/genre_spec.rb
|
217
189
|
- spec/rakuten_web_service/recipe/category_spec.rb
|
218
190
|
- spec/rakuten_web_service/recipe_spec.rb
|
191
|
+
- spec/rakuten_web_service/response_spec.rb
|
219
192
|
- spec/spec_helper.rb
|
220
193
|
- spec/support/fixture_suppot.rb
|
221
194
|
homepage: http://webservice.rakuten.co.jp/
|
@@ -289,5 +262,6 @@ test_files:
|
|
289
262
|
- spec/rakuten_web_service/kobo/genre_spec.rb
|
290
263
|
- spec/rakuten_web_service/recipe/category_spec.rb
|
291
264
|
- spec/rakuten_web_service/recipe_spec.rb
|
265
|
+
- spec/rakuten_web_service/response_spec.rb
|
292
266
|
- spec/spec_helper.rb
|
293
267
|
- spec/support/fixture_suppot.rb
|