sevennet-api 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16c70b05ee92b98d076c68fbd6e40f2962c1c845
4
- data.tar.gz: 83135371d3f1f2d74ad46df70c046c59e20de27c
3
+ metadata.gz: 10f241f6574f0e502aff2851cccf734c546c4f77
4
+ data.tar.gz: d04bcd838201ec014e98cdde5a6ace332b1eb6c4
5
5
  SHA512:
6
- metadata.gz: 753493706edb51440706b07c6b9d11ccc02f686b672f732ca96d27a17ad89eef14f7d10606beb5b0883d782c07c2f7dc6e81a7adc6280fa7925b04d636b05b5a
7
- data.tar.gz: dba8b9dc35f25c7d2fef4f364eb499758c3ee4cf83b43edacbbb79ae29fa59de8600bddf5106ddbd83843cec059f21e0474f42d342bafa65e045a330bb03fc87
6
+ metadata.gz: 2c467c4996d5ce422c1f7466136a7f9e29725974ee1b1e094618b71306118c6bc48a25e3d4880988ed2c039e3219600c5753ee1e0bc8b9cd35f9c4dae1f2b2e4
7
+ data.tar.gz: 3e98f86f6a4bd2a2d029f1bb6b4249e22e2b38f0645377d6f0bce1eb4591152e2089ec30a5827dcd451dea9bd237c422550b29c803b699a9c9b80b5de3d64aa9
@@ -42,7 +42,7 @@ module Sevennet
42
42
  # Search spc shops with search terms.
43
43
  def self.search_spc_shop(terms, opts = {})
44
44
  opts[:operation] = 'SearchSpcShop'
45
- opts[:KeywordIn] = CGI.escape(terms.to_s)
45
+ opts[:KeywordIn] = terms.to_s
46
46
 
47
47
  self.send_request(opts)
48
48
  end
@@ -62,7 +62,7 @@ module Sevennet
62
62
  end
63
63
 
64
64
  opts[:operation] = 'SearchProduct'
65
- opts[:KeywordIn] = CGI.escape(terms.to_s)
65
+ opts[:KeywordIn] = terms.to_s
66
66
 
67
67
  self.send_request(opts)
68
68
  end
@@ -100,7 +100,7 @@ module Sevennet
100
100
  raise ArgumentError, "Content is required." if content.to_s.empty?
101
101
 
102
102
  opts[:operation] = 'SearchContentMatchProduct'
103
- opts[:Content] = CGI.escape(content)
103
+ opts[:Content] = content
104
104
 
105
105
  self.send_request(opts)
106
106
  end
@@ -111,7 +111,7 @@ module Sevennet
111
111
  raise ArgumentError, "TopCategoryCode and Content is required." if content.to_s.empty? || category_code.to_s.empty?
112
112
 
113
113
  opts[:operation] = 'SearchContentMatchRanking'
114
- opts[:Content] = CGI.escape(content)
114
+ opts[:Content] = content
115
115
  opts[:TopCategoryCode] = category_code
116
116
 
117
117
 
@@ -196,6 +196,7 @@ module Sevennet
196
196
  request_url = "#{SERVICE_URL}/#{operation}"
197
197
 
198
198
  qs = []
199
+ qr = []
199
200
 
200
201
  opts = opts.collect do |a,b|
201
202
  [a.to_s, b.to_s]
@@ -208,11 +209,12 @@ module Sevennet
208
209
  opts.each do |e|
209
210
  next if e[1].empty? || e[1].nil?
210
211
  qs << "#{e[0]}=#{e[1]}"
212
+ qr << "#{e[0]}=#{CGI.escape(e[1])}"
211
213
  end
212
214
 
213
215
  request_to_sign ="GET|#{request_url}|#{qs.join('|')}"
214
216
  signature = "&Signature=#{sign_request(request_to_sign, secret_key)}"
215
- "#{request_url}?#{qs.join('&')}#{signature}"
217
+ "#{request_url}?#{qr.join('&')}#{signature}"
216
218
  end
217
219
 
218
220
  def self.sign_request(url, key)
@@ -1,5 +1,5 @@
1
1
  module Sevennet
2
2
  class Api
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Sevennet::Api::VERSION
9
9
  spec.authors = ["shoprev"]
10
10
  spec.email = ["admin@shoprev.net"]
11
- spec.description = %q{Ruby 7netshopping API using Nokogiri.}
12
- spec.summary = %q{Ruby 7netshopping API using Nokogiri.}
11
+ spec.description = %q{Ruby 7net shopping API using Nokogiri.}
12
+ spec.summary = %q{Ruby 7net shopping API using Nokogiri.}
13
13
  spec.homepage = "https://github.com/shoprev/sevennet-api"
14
14
  spec.license = "MIT"
15
15
 
@@ -22,5 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
24
  spec.add_development_dependency "vcr"
25
+ spec.add_development_dependency "webmock", "1.11.0"
25
26
  spec.add_runtime_dependency "nokogiri"
26
27
  end
@@ -1,12 +1,12 @@
1
1
  # coding: utf-8
2
- #require 'webmock/rspec'
3
- #WebMock.disable_net_connect!
2
+ require 'webmock/rspec'
3
+ WebMock.disable_net_connect!
4
4
  require 'vcr'
5
5
 
6
6
  VCR.configure do |c|
7
7
  c.cassette_library_dir = File.expand_path(File.dirname(__FILE__) + '/fixtures')
8
8
  c.hook_into :webmock
9
- # c.allow_http_connections_when_no_cassette = true
9
+ c.allow_http_connections_when_no_cassette = true
10
10
  c.default_cassette_options = {
11
11
  :match_requests_on => [:method,
12
12
  VCR.request_matchers.uri_without_param(:Timestamp,:Signature)]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevennet-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - shoprev
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 1.11.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 1.11.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: nokogiri
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +94,7 @@ dependencies:
80
94
  - - '>='
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
- description: Ruby 7netshopping API using Nokogiri.
97
+ description: Ruby 7net shopping API using Nokogiri.
84
98
  email:
85
99
  - admin@shoprev.net
86
100
  executables: []
@@ -120,7 +134,7 @@ rubyforge_project:
120
134
  rubygems_version: 2.0.3
121
135
  signing_key:
122
136
  specification_version: 4
123
- summary: Ruby 7netshopping API using Nokogiri.
137
+ summary: Ruby 7net shopping API using Nokogiri.
124
138
  test_files:
125
139
  - spec/sevennet/api_spec.rb
126
140
  - spec/spec_helper.rb