handcrafted-a2ws 0.1.0 → 0.1.2

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.
data/README.rdoc CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Wrapper for Amazon Associates Web Services
4
4
 
5
+ == How to configure access key to A2WS
6
+ A2WS::Base.configure do |config|
7
+ config.api_key = 'ACCESS KEY ID'
8
+ end
9
+
5
10
  == Copyright
6
11
 
7
12
  Copyright (c) 2009 Andy Shen. See LICENSE for details.
data/Rakefile CHANGED
@@ -8,10 +8,9 @@ begin
8
8
  gem.summary = %Q{Wrapper for Amazon Associates Web Service (A2WS).}
9
9
  gem.email = "andy@shenie.info"
10
10
  gem.homepage = "http://github.com/handcrafted/a2ws"
11
- gem.authors = ["Andy Shen"]
11
+ gem.authors = ["Andy Shen", "Josh Owens"]
12
12
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
13
13
  gem.add_dependency('httparty', '>= 0.4.3')
14
- gem.add_dependency('mbleigh-mash', '>= 0.0.6')
15
14
  gem.add_dependency('activesupport', '>= 2.2.2')
16
15
  end
17
16
 
data/VERSION.yml CHANGED
@@ -1,4 +1,3 @@
1
- major: 0
2
- minor: 1
3
- patch: 0
4
-
1
+ :major: 0
2
+ :minor: 1
3
+ :patch: 2
data/a2ws.gemspec CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{a2ws}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Andy Shen"]
8
+ s.authors = ["Andy Shen", "Josh Owens"]
9
9
  s.date = %q{2009-05-31}
10
10
  s.email = %q{andy@shenie.info}
11
11
  s.extra_rdoc_files = [
@@ -29,11 +29,10 @@ Gem::Specification.new do |s|
29
29
  "spec/a2ws_spec.rb",
30
30
  "spec/spec_helper.rb"
31
31
  ]
32
- s.has_rdoc = true
33
32
  s.homepage = %q{http://github.com/handcrafted/a2ws}
34
33
  s.rdoc_options = ["--charset=UTF-8"]
35
34
  s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.3.2}
35
+ s.rubygems_version = %q{1.3.4}
37
36
  s.summary = %q{Wrapper for Amazon Associates Web Service (A2WS).}
38
37
  s.test_files = [
39
38
  "spec/a2ws_spec.rb",
@@ -46,16 +45,13 @@ Gem::Specification.new do |s|
46
45
 
47
46
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
48
47
  s.add_runtime_dependency(%q<httparty>, [">= 0.4.3"])
49
- s.add_runtime_dependency(%q<mbleigh-mash>, [">= 0.0.6"])
50
48
  s.add_runtime_dependency(%q<activesupport>, [">= 2.2.2"])
51
49
  else
52
50
  s.add_dependency(%q<httparty>, [">= 0.4.3"])
53
- s.add_dependency(%q<mbleigh-mash>, [">= 0.0.6"])
54
51
  s.add_dependency(%q<activesupport>, [">= 2.2.2"])
55
52
  end
56
53
  else
57
54
  s.add_dependency(%q<httparty>, [">= 0.4.3"])
58
- s.add_dependency(%q<mbleigh-mash>, [">= 0.0.6"])
59
55
  s.add_dependency(%q<activesupport>, [">= 2.2.2"])
60
56
  end
61
57
  end
data/lib/a2ws.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'httparty'
3
- require 'mash'
4
3
  require 'activesupport'
5
4
  require 'pp'
6
5
 
data/lib/a2ws/base.rb CHANGED
@@ -4,6 +4,14 @@ module A2WS
4
4
  base_uri 'http://ecs.amazonaws.com'
5
5
  default_params :Service => 'AWSECommerceService', :Operation => 'ItemSearch'
6
6
 
7
+ def self.configure
8
+ yield self
9
+ end
10
+
11
+ def self.api_key=(key)
12
+ default_params :AWSAccessKeyId => key
13
+ end
14
+
7
15
  private
8
16
 
9
17
  def downcase_keys(hash)
@@ -3,9 +3,8 @@ module A2WS
3
3
  class ItemSearch < Base
4
4
  attr_accessor :items, :search_index
5
5
 
6
- def initialize(api_key, search_index = :All)
6
+ def initialize(search_index = :All)
7
7
  @search_index = search_index
8
- self.class.default_params :AWSAccessKeyId => api_key
9
8
  end
10
9
 
11
10
  def find(keywords, options = {})
data/spec/a2ws_spec.rb CHANGED
@@ -17,12 +17,7 @@ describe "A2WS Operations" do
17
17
 
18
18
  it "should find some items" do
19
19
  search = ItemSearch.new(access_key, :Books)
20
- search.find(:query => {:Title => 'Harry Potter'}).size.should_not == 0
21
- end
22
-
23
- it "should return Mash result" do
24
- search = ItemSearch.new(access_key, :Books)
25
- search.find(:query => {:Title => 'Harry Potter'}).first.should be_a(Mash)
20
+ search.find(nil, :Title => 'Harry Potter').size.should_not == 0
26
21
  end
27
22
 
28
23
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handcrafted-a2ws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Shen
8
+ - Josh Owens
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
@@ -22,16 +23,6 @@ dependencies:
22
23
  - !ruby/object:Gem::Version
23
24
  version: 0.4.3
24
25
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: mbleigh-mash
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.0.6
34
- version:
35
26
  - !ruby/object:Gem::Dependency
36
27
  name: activesupport
37
28
  type: :runtime
@@ -67,7 +58,7 @@ files:
67
58
  - lib/a2ws/item_search.rb
68
59
  - spec/a2ws_spec.rb
69
60
  - spec/spec_helper.rb
70
- has_rdoc: true
61
+ has_rdoc: false
71
62
  homepage: http://github.com/handcrafted/a2ws
72
63
  post_install_message:
73
64
  rdoc_options: