rakuten_web_service 1.4.0 → 1.4.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
  SHA1:
3
- metadata.gz: 36494ec875153de05cd30a11c266d9c2c7d12b09
4
- data.tar.gz: dafab6e790770ec344dca796d261a4896c741b54
3
+ metadata.gz: 1eb72352ce1d5a3438ff53f83c36beed80fe1c2e
4
+ data.tar.gz: 6b367c56add033e81ddebafa35ed0c3d6212c2b8
5
5
  SHA512:
6
- metadata.gz: ffddb30af4da3756f6ef0baa4e2ad49c0967d06264eaf39e29c3a1bbb4a109cb7868e63335be9203006f631c4e24ba97144e899532fb2d15a223a7ede2022f2a
7
- data.tar.gz: 9464a7badbc80252dfadb8c42104e0deefa028858eb9d09f91ee6545b05bd43cbb27b4ab1071a8e4e0ee08b4d7e28bcb5c1818da190aee180f7281661b240ddd
6
+ metadata.gz: 59a3290303696eccf35353c7e957e1391bdae96686cfd2b6dde48dae0fd67663587c3b41368fc42b32bf1cc02ea240a442e0bf4cc5565783472938a9f8857303
7
+ data.tar.gz: caccbdebffb9fcad8ba7fc6f8585a60287ab85af7729cd763e72bae8ccccd5d6d69bcc0e688e42e765cd803c6090f78560dd0f604f6471d95c96419d2204a0d3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v1.4.1 (2016/11/22)
2
+
3
+ ## Bug Fix
4
+
5
+ * Fixed: `WrongParameter` raises when giving any `sort` option to `RakutenWebService::Resource.serch`. [#54](https://github.com/rakuten-ws/rws-ruby-sdk/pull/54)
6
+
7
+ ## Thanks
8
+
9
+ I'm pleased to say thanks to @sho-yamane since he reporeted the bug #53. If he didn't do it, I would find the bug much later.
10
+ Thanks, @sho-yamane.
11
+
12
+
1
13
  # v1.4.0 (2016/11/11)
2
14
 
3
15
  ## Enhancements
@@ -1,4 +1,5 @@
1
1
  require 'uri'
2
+ require 'cgi'
2
3
  require 'json'
3
4
  require 'rakuten_web_service/response'
4
5
  require 'rakuten_web_service/error'
@@ -28,7 +29,7 @@ module RakutenWebService
28
29
  def request(path, params)
29
30
  http = Net::HTTP.new(@url.host, @url.port)
30
31
  http.use_ssl = true
31
- path = "#{path}?#{params.map { |k, v| "#{k}=#{URI.encode(v.to_s)}" }.join('&')}"
32
+ path = "#{path}?#{params.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')}"
32
33
  header = {
33
34
  'User-Agent' => "RakutenWebService SDK for Ruby v#{RWS::VERSION}(ruby-#{RUBY_VERSION} [#{RUBY_PLATFORM}])"
34
35
  }
@@ -1,3 +1,3 @@
1
1
  module RakutenWebService
2
- VERSION = "1.4.0".freeze
2
+ VERSION = "1.4.1".freeze
3
3
  end
@@ -51,6 +51,35 @@ describe RakutenWebService::Client do
51
51
  expect(@expected_request).to have_been_made.once
52
52
  end
53
53
  end
54
+
55
+ context "giving 'sort' option" do
56
+ let(:expected_query) do
57
+ {
58
+ applicationId: application_id,
59
+ affiliateId: affiliate_id,
60
+ sort: sort_option
61
+ }
62
+ end
63
+
64
+ before do
65
+ client.get(sort: sort_option)
66
+ end
67
+
68
+ context "Specifying asceding order" do
69
+ let(:sort_option) { '+itemPrice' }
70
+
71
+ specify "encodes '+' in sort option" do
72
+ expect(@expected_request).to have_been_made.once
73
+ end
74
+ end
75
+ context "Specifying descending order" do
76
+ let(:sort_option) { '-itemPrice' }
77
+
78
+ specify "encodes '+' in sort option" do
79
+ expect(@expected_request).to have_been_made.once
80
+ end
81
+ end
82
+ end
54
83
  end
55
84
 
56
85
  describe 'about exceptions' do
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.0
4
+ version: 1.4.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: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.5.1
209
+ rubygems_version: 2.5.2
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Ruby Client for Rakuten Web Service