rakuten_web_service 1.13.0 → 1.13.1

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: bdb4eed0f6b4075f460d74c30218551f0345c9bc12cda1a433bdcf9525e4ff64
4
- data.tar.gz: ce188517ae7113a4322b35b271c9c5fccda23f0bb5694a8047bea1afdbf25a0c
3
+ metadata.gz: 77a989e998fd6a3271a5f1e999a0a42f6858ea20cacd06ebd05753212d97aee3
4
+ data.tar.gz: 90ceb9449c4aeb5c3bf01b46f7660d3f76a603fd8a28bd102f1fa33d66d45bae
5
5
  SHA512:
6
- metadata.gz: 8b996cb29aa1fc0dd7634ee33dced0386e0d320711a42e98a20af695815df35709778d2150327551fa2dffe27a69407eb04f0aa4a3c72d01ba485e8e6ac172b7
7
- data.tar.gz: 265354c69faacb14e9fe3aa3565b44d9813a8011562b913a3fe4ee017ea3e18bc4cf4df0e1f97295a5eb5c235a3beecc75e9efa37ecb89543fee5543c8e49307
6
+ metadata.gz: f083fede7c88df4046d4ca2c2f41429b1f37c9b4a814dace5e7b8b7ace92636a06cc3ce72ab06808dfc1fbf8758a89a167cd70ad276a0a826e5e139a1fe2307c
7
+ data.tar.gz: c97f6fcd7762134d830743fc92e77e26c66057a9f86671c338d1a5d95e0fc835d923419e8f593d8e1f7d68ca336e053eb684080b2eab60ea026f45c582c818ad
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ ruby-version:
16
+ - 2.5
17
+ - 2.6
18
+ - 2.7
19
+ - "3.0"
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - uses: ruby/setup-ruby@v1
24
+ env:
25
+ BUNDLE_WITHOUT: vscode
26
+ with:
27
+ ruby-version: ${{ matrix.ruby-version }}
28
+ bundler-cache: true
29
+ - name: Run test
30
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.13.1 (2021/09/02)
4
+
5
+ ### Improvements
6
+
7
+ - Fixed the issue when item can't be found by specifying elements [#132](https://github.com/rakuten-ws/rws-ruby-sdk/pull/132)
8
+ - Removed abolished methods from sample codes in README [#131](https://github.com/rakuten-ws/rws-ruby-sdk/pull/131)
9
+ - Migrated CI for this repo from Travis CI to GitHub Actions [#130](https://github.com/rakuten-ws/rws-ruby-sdk/pull/130)
10
+ - Add ruby 3.0 support [#129](https://github.com/rakuten-ws/rws-ruby-sdk/pull/129)
11
+
3
12
  ## v1.13.0 (2020/10/15)
4
13
 
5
14
  ### Enhancements
data/README.ja.md CHANGED
@@ -93,7 +93,7 @@ gem install rakuten_web_service
93
93
  last_items = items.page(3) # 3ページ目の情報を取る
94
94
 
95
95
  # 最後のページまでスキップする
96
- while last_items.has_next_page?
96
+ while last_items.next_page?
97
97
  last_items = last_items.next_page
98
98
  end
99
99
 
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # RakutenWebService
2
-
2
+ [![CI](https://github.com/rakuten-ws/rws-ruby-sdk/workflows/CI/badge.svg)](https://github.com/rakuten-ws/rws-ruby-sdk/actions?query=workflow%3ACI+branch%3Amaster)
3
3
  [![Build Status](https://travis-ci.org/rakuten-ws/rws-ruby-sdk.svg?branch=master)](https://travis-ci.org/rakuten-ws/rws-ruby-sdk)
4
4
  [![Gem Version](https://badge.fury.io/rb/rakuten_web_service.svg)](https://badge.fury.io/rb/rakuten_web_service)
5
5
  [![Test Coverage](https://codeclimate.com/github/rakuten-ws/rws-ruby-sdk/badges/coverage.svg)](https://codeclimate.com/github/rakuten-ws/rws-ruby-sdk/coverage)
@@ -113,7 +113,7 @@ Responses of resources' `search` such as `RakutenWebService::Ichiba::Item.search
113
113
  last_items = items.page(3) # Skips first 2 pages.
114
114
 
115
115
  # Go to the last page
116
- while last_items.has_next_page?
116
+ while last_items.next_page?
117
117
  last_items = last_items.next_page
118
118
  end
119
119
 
@@ -18,7 +18,7 @@ module RakutenWebService
18
18
  endpoint 'https://app.rakuten.co.jp/services/api/IchibaItem/Search/20170706'
19
19
 
20
20
  parser do |response|
21
- response['Items'].map { |item| Item.new(item) }
21
+ (response['Items'] || []).map { |item| Item.new(item) }
22
22
  end
23
23
 
24
24
  attribute :itemName, :catchcopy, :itemCode, :itemPrice,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RakutenWebService
4
- VERSION = '1.13.0'.freeze
4
+ VERSION = '1.13.1'
5
5
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "count": 0,
3
+ "page": 1,
4
+ "first": 0,
5
+ "last": 0,
6
+ "hits": 0,
7
+ "pageCount": 0
8
+ }
@@ -130,6 +130,19 @@ describe RakutenWebService::Ichiba::Item do
130
130
  end
131
131
  end
132
132
 
133
+ describe '.search(no items)' do
134
+ before do
135
+ response = JSON.parse(fixture('ichiba/item_search_with_no_items.json'))
136
+ @expected_request = stub_request(:get, endpoint).with(query: expected_query).to_return(body: response.to_json)
137
+ end
138
+
139
+ subject { RakutenWebService::Ichiba::Item.search(keyword: 'Ruby').first(1) }
140
+ specify '' do
141
+ expect { subject }.to_not raise_error
142
+ end
143
+ it { is_expected.to eq [] }
144
+ end
145
+
133
146
  describe '.all' do
134
147
  before do
135
148
  response = JSON.parse(fixture('ichiba/item_search_with_keyword_Ruby.json'))
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.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Sato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -131,8 +131,8 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".codeclimate.yml"
133
133
  - ".github/FUNDING.yml"
134
+ - ".github/workflows/ci.yml"
134
135
  - ".gitignore"
135
- - ".travis.yml"
136
136
  - ".vscode/launch.json"
137
137
  - ".vscode/tasks.json"
138
138
  - CHANGELOG.md
@@ -211,6 +211,7 @@ files:
211
211
  - spec/fixtures/gora/plan_search_with_area_code.json
212
212
  - spec/fixtures/ichiba/genre_search.json
213
213
  - spec/fixtures/ichiba/item_search_with_keyword_Ruby.json
214
+ - spec/fixtures/ichiba/item_search_with_no_items.json
214
215
  - spec/fixtures/ichiba/parents_genre_search.json
215
216
  - spec/fixtures/ichiba/product_search.json
216
217
  - spec/fixtures/ichiba/ranking_search.json
@@ -276,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
277
  - !ruby/object:Gem::Version
277
278
  version: '0'
278
279
  requirements: []
279
- rubygems_version: 3.1.2
280
+ rubygems_version: 3.1.6
280
281
  signing_key:
281
282
  specification_version: 4
282
283
  summary: Ruby Client for Rakuten Web Service
@@ -295,6 +296,7 @@ test_files:
295
296
  - spec/fixtures/gora/plan_search_with_area_code.json
296
297
  - spec/fixtures/ichiba/genre_search.json
297
298
  - spec/fixtures/ichiba/item_search_with_keyword_Ruby.json
299
+ - spec/fixtures/ichiba/item_search_with_no_items.json
298
300
  - spec/fixtures/ichiba/parents_genre_search.json
299
301
  - spec/fixtures/ichiba/product_search.json
300
302
  - spec/fixtures/ichiba/ranking_search.json
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5
4
- - 2.6
5
- - 2.7
6
- - ruby-head
7
-
8
- group: travis_lts
9
-
10
- cache: bundler
11
-
12
- before_install:
13
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
14
- - chmod +x ./cc-test-reporter
15
- - ./cc-test-reporter before-build
16
- - gem install bundler
17
- - bundle config set without 'vscode'
18
-
19
- script:
20
- - bundle exec rake
21
-
22
- after_script:
23
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
24
-
25
- matrix:
26
- allow_failures:
27
- - rvm: ruby-head
28
-
29
- notifications:
30
- email: false
31
- webhooks:
32
- urls:
33
- - https://webhooks.gitter.im/e/059b85fcc75550b7bc39