handcrafted-a2ws 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -3
- data/VERSION.yml +1 -1
- data/a2ws.gemspec +3 -2
- data/lib/a2ws/image_search.rb +1 -1
- data/lib/a2ws/item.rb +5 -1
- data/lib/a2ws/item_search.rb +1 -1
- data/spec/a2ws_spec.rb +7 -3
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
Wrapper for Amazon Associates Web Services
|
4
4
|
|
5
5
|
== How to configure access key to A2WS
|
6
|
-
A2WS::Base.configure do |config|
|
7
|
-
|
8
|
-
end
|
6
|
+
A2WS::Base.configure do |config|
|
7
|
+
config.api_key = 'ACCESS KEY ID'
|
8
|
+
end
|
9
9
|
|
10
10
|
== Copyright
|
11
11
|
|
data/VERSION.yml
CHANGED
data/a2ws.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{a2ws}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Andy Shen", "Josh Owens"]
|
@@ -29,10 +29,11 @@ Gem::Specification.new do |s|
|
|
29
29
|
"spec/a2ws_spec.rb",
|
30
30
|
"spec/spec_helper.rb"
|
31
31
|
]
|
32
|
+
s.has_rdoc = true
|
32
33
|
s.homepage = %q{http://github.com/handcrafted/a2ws}
|
33
34
|
s.rdoc_options = ["--charset=UTF-8"]
|
34
35
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = %q{1.3.
|
36
|
+
s.rubygems_version = %q{1.3.2}
|
36
37
|
s.summary = %q{Wrapper for Amazon Associates Web Service (A2WS).}
|
37
38
|
s.test_files = [
|
38
39
|
"spec/a2ws_spec.rb",
|
data/lib/a2ws/image_search.rb
CHANGED
@@ -13,7 +13,7 @@ module A2WS
|
|
13
13
|
result = self.class.get('/onca/xml', :query => {:ItemId => @item_id, :Operation => "ItemLookup"})
|
14
14
|
result["ItemLookupResponse"]["Items"]["Item"].delete("ImageSets")
|
15
15
|
result["ItemLookupResponse"]["Items"]["Item"].delete("ASIN")
|
16
|
-
downcase_keys(result["ItemLookupResponse"]["Items"]["Item"]).collect { |size, data| Image.new(size, data) }
|
16
|
+
downcase_keys(result["ItemLookupResponse"]["Items"]["Item"]).collect { |size, data| AW2S::Image.new(size, data) }
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
data/lib/a2ws/item.rb
CHANGED
data/lib/a2ws/item_search.rb
CHANGED
@@ -15,7 +15,7 @@ module A2WS
|
|
15
15
|
@items = result["ItemSearchResponse"]["Items"]
|
16
16
|
if @items['Request']['IsValid'] == 'True'
|
17
17
|
@items['Item'].collect do |i|
|
18
|
-
Item.new downcase_keys(i)
|
18
|
+
AW2S::Item.new downcase_keys(i)
|
19
19
|
end
|
20
20
|
else
|
21
21
|
raise @items['Request']['Errors']['Error']['Message']
|
data/spec/a2ws_spec.rb
CHANGED
@@ -6,17 +6,21 @@ include A2WS
|
|
6
6
|
config = YAML::load(open(ENV['HOME'] + '/.a2ws'))
|
7
7
|
access_key = config["access_key"]
|
8
8
|
|
9
|
+
A2WS::Base.configure do |config|
|
10
|
+
config.api_key = access_key
|
11
|
+
end
|
12
|
+
|
9
13
|
describe "A2WS Operations" do
|
10
14
|
|
11
15
|
describe "ItemSearch" do
|
12
16
|
|
13
17
|
it "should require SearchIndex" do
|
14
|
-
search = ItemSearch.new
|
15
|
-
lambda {search.find}.should raise_error
|
18
|
+
search = ItemSearch.new
|
19
|
+
lambda { search.find }.should raise_error
|
16
20
|
end
|
17
21
|
|
18
22
|
it "should find some items" do
|
19
|
-
search = ItemSearch.new(
|
23
|
+
search = ItemSearch.new(:Books)
|
20
24
|
search.find(nil, :Title => 'Harry Potter').size.should_not == 0
|
21
25
|
end
|
22
26
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: handcrafted-a2ws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Shen
|
@@ -58,7 +58,7 @@ files:
|
|
58
58
|
- lib/a2ws/item_search.rb
|
59
59
|
- spec/a2ws_spec.rb
|
60
60
|
- spec/spec_helper.rb
|
61
|
-
has_rdoc:
|
61
|
+
has_rdoc: true
|
62
62
|
homepage: http://github.com/handcrafted/a2ws
|
63
63
|
post_install_message:
|
64
64
|
rdoc_options:
|