pricesphere 0.2.2 → 0.2.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 +4 -4
- data/lib/pricesphere/product.rb +2 -2
- data/lib/pricesphere/version.rb +1 -1
- data/lib/pricesphere/watch.rb +5 -5
- data/pricesphere.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7442119897302404f2477fdfed1357d0718e7f92
|
|
4
|
+
data.tar.gz: 523737767ba08c8ea74715ebefce8840c849a96d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f7b467756cbf753d905fd7b9000ed021a296ad9cbb01757dc81f8299d76ac72a8575816c4693c4182a9d93001ae82608311b5634c771f30451a760aff11b791
|
|
7
|
+
data.tar.gz: 23ac6a1a9d49ecd6bdb28ca3261e8ca69dba753d01d15d203a9fdec1f13582687aaa0425522c0bff5e3d6acba751ab988f840319574cdcc6386a82fcaa097a57
|
data/lib/pricesphere/product.rb
CHANGED
|
@@ -2,7 +2,7 @@ module Pricesphere
|
|
|
2
2
|
class Product < Base
|
|
3
3
|
def search(term = '')
|
|
4
4
|
return {} if term == ''
|
|
5
|
-
with_attributes( search
|
|
5
|
+
with_attributes( { :search => term } )
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def with_attributes(attributes = {})
|
|
@@ -12,7 +12,7 @@ module Pricesphere
|
|
|
12
12
|
Enumerator.new do |yielder|
|
|
13
13
|
loop do
|
|
14
14
|
raise StopIteration if last_page
|
|
15
|
-
result = get(attributes.merge(page
|
|
15
|
+
result = get(attributes.merge({:page => page}))
|
|
16
16
|
|
|
17
17
|
if page == result['meta']['pages'].to_i
|
|
18
18
|
last_page = true
|
data/lib/pricesphere/version.rb
CHANGED
data/lib/pricesphere/watch.rb
CHANGED
|
@@ -11,12 +11,12 @@ module Pricesphere
|
|
|
11
11
|
request = Net::HTTP::Post.new("/api/#{@version}/watches")
|
|
12
12
|
request.add_field('Content-Type', 'application/json')
|
|
13
13
|
request.body = {
|
|
14
|
-
watch
|
|
15
|
-
product_id
|
|
16
|
-
webhook_path
|
|
17
|
-
webhook_attributes
|
|
14
|
+
:watch => {
|
|
15
|
+
:product_id => product_id,
|
|
16
|
+
:webhook_path => webhook_path,
|
|
17
|
+
:webhook_attributes => callback_params.to_json
|
|
18
18
|
},
|
|
19
|
-
token
|
|
19
|
+
:token => @api_key
|
|
20
20
|
}.to_json
|
|
21
21
|
|
|
22
22
|
response = http.request(request)
|
data/pricesphere.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.description = %q{Pricesphere is a Gem to interact with PriceSphere.com's API}
|
|
13
13
|
spec.homepage = "https://github.com/Pricesphere/PriceSphere-Ruby"
|
|
14
14
|
spec.license = "MIT"
|
|
15
|
-
|
|
15
|
+
spec.required_ruby_version = '>= 1.9.3'
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pricesphere
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris MacNaughton
|
|
@@ -87,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
87
87
|
requirements:
|
|
88
88
|
- - ">="
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version:
|
|
90
|
+
version: 1.9.3
|
|
91
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - ">="
|