amazon-product-advertising-api 0.2.1

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.
@@ -0,0 +1,67 @@
1
+ module AmazonProductAdvertisingApi #:nodoc:
2
+ module CoreExtensions
3
+ module Class
4
+
5
+ # Pleasant syntax for Class attribute readers.
6
+ def cattr_reader(sym)
7
+ class_eval(<<-EOS, __FILE__, __LINE__)
8
+ unless defined? @@#{sym} # unless defined? @@hair_colors
9
+ @@#{sym} = nil # @@hair_colors = nil
10
+ end # end
11
+ #
12
+ def self.#{sym} # def self.hair_colors
13
+ @@#{sym} # @@hair_colors
14
+ end # end
15
+ #
16
+ def #{sym} # def hair_colors
17
+ @@#{sym} # @@hair_colors
18
+ end # end
19
+ EOS
20
+ end
21
+
22
+ # Pleasant syntax for Class attribute writers.
23
+ def cattr_writer(sym)
24
+ class_eval(<<-EOS, __FILE__, __LINE__)
25
+ unless defined? @@#{sym} # unless defined? @@hair_colors
26
+ @@#{sym} = nil # @@hair_colors = nil
27
+ end # end
28
+ #
29
+ def self.#{sym}=(obj) # def self.hair_colors=(obj)
30
+ @@#{sym} = obj # @@hair_colors = obj
31
+ end # end
32
+ EOS
33
+ end
34
+
35
+ # Pleasant syntax for Class attribute accessors.
36
+ def cattr_accessor(sym)
37
+ cattr_reader(sym)
38
+ cattr_writer(sym)
39
+ end
40
+
41
+ end
42
+
43
+ # Some extensions to the String class.
44
+ module String
45
+
46
+ # Converts strings from under_score format to CamelCase
47
+ def camelize(first_letter_in_uppercase = true)
48
+ if first_letter_in_uppercase
49
+ self.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
50
+ else
51
+ self.first + camelize(self)[1..-1]
52
+ end
53
+ end
54
+
55
+ # Converts strings from CamelCase format to under_score.
56
+ def underscore
57
+ self.to_s.gsub(/::/, '/').
58
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
59
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
60
+ tr("-", "_").
61
+ downcase
62
+ end
63
+
64
+ end
65
+
66
+ end
67
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amazon-product-advertising-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Jon Gilbraith
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-30 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: ruby-hmac
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: A nice rubyish interface to the Amazon Product Advertising API, formerly known as the Associates Web Service and before that the Amazon E-Commerce Service.
36
+ email: jon@completelynovel.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.rdoc
43
+ files:
44
+ - .gitignore
45
+ - EXAMPLE.txt
46
+ - MIT-LICENSE
47
+ - README.rdoc
48
+ - Rakefile
49
+ - VERSION
50
+ - amazon-product-advertising-api.gemspec
51
+ - lib/amazon_product_advertising_api.rb
52
+ - lib/amazon_product_advertising_api/base.rb
53
+ - lib/amazon_product_advertising_api/operations/base.rb
54
+ - lib/amazon_product_advertising_api/operations/browse_node.rb
55
+ - lib/amazon_product_advertising_api/operations/item.rb
56
+ - lib/amazon_product_advertising_api/response_elements.rb
57
+ - lib/amazon_product_advertising_api/support.rb
58
+ has_rdoc: true
59
+ homepage: http://github.com/completelynovel/amazon-product-advertising-api
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --charset=UTF-8
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.3.2
83
+ signing_key:
84
+ specification_version: 2
85
+ summary: A nice rubyish interface to the Amazon Product Advertising API.
86
+ test_files: []
87
+