amazon-product-advertising-api-prezjordan 0.2.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.
@@ -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,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amazon-product-advertising-api-prezjordan
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jon Gilbraith
9
+ - Jordan Scales
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2009-07-30 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: ruby-hmac
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: A nice rubyish interface to the Amazon Product Advertising API (MODIFIED
48
+ to handle ResponseGroup), formerly known as the Associates Web Service and before
49
+ that the Amazon E-Commerce Service.
50
+ email: jon@completelynovel.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files:
54
+ - README.rdoc
55
+ files:
56
+ - .gitignore
57
+ - EXAMPLE.txt
58
+ - MIT-LICENSE
59
+ - README.rdoc
60
+ - Rakefile
61
+ - VERSION
62
+ - amazon-product-advertising-api.gemspec
63
+ - lib/amazon_product_advertising_api.rb
64
+ - lib/amazon_product_advertising_api/base.rb
65
+ - lib/amazon_product_advertising_api/operations/base.rb
66
+ - lib/amazon_product_advertising_api/operations/browse_node.rb
67
+ - lib/amazon_product_advertising_api/operations/item.rb
68
+ - lib/amazon_product_advertising_api/response_elements.rb
69
+ - lib/amazon_product_advertising_api/support.rb
70
+ homepage: http://github.com/prezjordan/amazon-product-advertising-api
71
+ licenses: []
72
+ post_install_message:
73
+ rdoc_options:
74
+ - --charset=UTF-8
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 1.8.24
92
+ signing_key:
93
+ specification_version: 2
94
+ summary: A nice rubyish interface to the Amazon Product Advertising API. (MODIFIED
95
+ to handle ResponseGroup)
96
+ test_files: []