awis-sdk-ruby_ 1.1.1p1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'awis/utils/extra'
4
+ require 'awis/utils/variable'
5
+
6
+ module Awis
7
+ module Utils
8
+ autoload :XML, 'awis/utils/xml'
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awis
4
+ module Utils
5
+ module Extra
6
+ def camelize(string)
7
+ string.split('_').map(&:capitalize).join
8
+ end
9
+
10
+ module_function :camelize
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Hash
4
+ def deep_find(key, object = self, found = nil)
5
+ return object[key] if object.respond_to?(:key?) && object.key?(key)
6
+ return found unless object.is_a?(Enumerable)
7
+
8
+ object.find { |*a| found = deep_find(key, a.last) }
9
+ found
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awis
4
+ module Utils
5
+ module Variable
6
+ def custom_instance_variables(options)
7
+ options.each do |key, value|
8
+ value = value.class == String && value.empty? ? nil : value
9
+
10
+ instance_variable_set("@#{key}", value)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awis
4
+ module Utils
5
+ class XML
6
+ attr_reader :data
7
+
8
+ def initialize(data)
9
+ @data = data
10
+ end
11
+
12
+ def each_node(attributes_in_path = false)
13
+ reader = Nokogiri::XML::Reader(@data)
14
+ nodes = ['']
15
+
16
+ reader.each do |node|
17
+ if node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
18
+ if attributes_in_path && !node.attributes.empty?
19
+ attributes = []
20
+
21
+ node.attributes.sort.each do |name, value|
22
+ attributes << "@#{name}=#{value}"
23
+ end
24
+ nodes << "#{node.name}/#{attributes.join('/')}"
25
+ else
26
+ nodes << node.name
27
+ end
28
+ path = nodes.join('/')
29
+
30
+ yield node, path
31
+ end
32
+
33
+ nodes.pop if node.node_type == Nokogiri::XML::Reader::TYPE_END_ELEMENT || node.self_closing? # End tag
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Awis
4
+ VERSION = '1.1.1p1'
5
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: awis-sdk-ruby_
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1p1
5
+ platform: ruby
6
+ authors:
7
+ - Encore Shao
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-02-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sigv4
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: multi_xml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Ruby - Amazon Alexa Web Information Service Library (AWIS)
126
+ email:
127
+ - encore.shao@gmail.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rubocop.yml"
134
+ - ".travis.yml"
135
+ - Gemfile
136
+ - README.md
137
+ - Rakefile
138
+ - awis.gemspec
139
+ - bin/console
140
+ - bin/setup
141
+ - lib/awis.rb
142
+ - lib/awis/api.rb
143
+ - lib/awis/api/base.rb
144
+ - lib/awis/api/category_browse.rb
145
+ - lib/awis/api/category_listings.rb
146
+ - lib/awis/api/sites_linking_in.rb
147
+ - lib/awis/api/traffic_history.rb
148
+ - lib/awis/api/url_info.rb
149
+ - lib/awis/client.rb
150
+ - lib/awis/config.rb
151
+ - lib/awis/connection.rb
152
+ - lib/awis/exceptions.rb
153
+ - lib/awis/hash.rb
154
+ - lib/awis/models.rb
155
+ - lib/awis/models/base.rb
156
+ - lib/awis/models/base_entity.rb
157
+ - lib/awis/models/category_browse.rb
158
+ - lib/awis/models/category_listings.rb
159
+ - lib/awis/models/sites_linking_in.rb
160
+ - lib/awis/models/traffic_history.rb
161
+ - lib/awis/models/url_info.rb
162
+ - lib/awis/utils.rb
163
+ - lib/awis/utils/extra.rb
164
+ - lib/awis/utils/hash.rb
165
+ - lib/awis/utils/variable.rb
166
+ - lib/awis/utils/xml.rb
167
+ - lib/awis/version.rb
168
+ homepage: https://github.com/encoreshao/amazon-awis
169
+ licenses: []
170
+ metadata: {}
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">"
183
+ - !ruby/object:Gem::Version
184
+ version: 1.3.1
185
+ requirements: []
186
+ rubygems_version: 3.0.2
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: Ruby - Amazon Alexa Web Information Service Library (AWIS)
190
+ test_files: []