sucker 1.3.0.pre.3 → 1.3.0

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/spec/sucker_spec.rbc CHANGED
@@ -1,5 +1,5 @@
1
1
  !RBIX
2
- 0
2
+ 10937318184790222022
3
3
  x
4
4
  M
5
5
  1
@@ -229,8 +229,8 @@ I
229
229
  I
230
230
  26
231
231
  x
232
- 50
233
- /Users/hakanensari/code/sucker/spec/sucker_spec.rb
232
+ 42
233
+ /Users/snl/code/sucker/spec/sucker_spec.rb
234
234
  p
235
235
  0
236
236
  x
@@ -245,8 +245,8 @@ I
245
245
  I
246
246
  b
247
247
  x
248
- 50
249
- /Users/hakanensari/code/sucker/spec/sucker_spec.rb
248
+ 42
249
+ /Users/snl/code/sucker/spec/sucker_spec.rb
250
250
  p
251
251
  0
252
252
  x
@@ -261,8 +261,8 @@ I
261
261
  I
262
262
  b
263
263
  x
264
- 50
265
- /Users/hakanensari/code/sucker/spec/sucker_spec.rb
264
+ 42
265
+ /Users/snl/code/sucker/spec/sucker_spec.rb
266
266
  p
267
267
  0
268
268
  x
@@ -281,7 +281,7 @@ I
281
281
  I
282
282
  16
283
283
  x
284
- 50
285
- /Users/hakanensari/code/sucker/spec/sucker_spec.rb
284
+ 42
285
+ /Users/snl/code/sucker/spec/sucker_spec.rb
286
286
  p
287
287
  0
@@ -1,5 +1,5 @@
1
1
  !RBIX
2
- 0
2
+ 10937318184790222022
3
3
  x
4
4
  M
5
5
  1
@@ -129,8 +129,8 @@ I
129
129
  I
130
130
  1e
131
131
  x
132
- 65
133
- /Users/hakanensari/code/sucker/spec/support/amazon_credentials.rb
132
+ 57
133
+ /Users/snl/code/sucker/spec/support/amazon_credentials.rb
134
134
  p
135
135
  0
136
136
  x
@@ -148,7 +148,7 @@ I
148
148
  I
149
149
  10
150
150
  x
151
- 65
152
- /Users/hakanensari/code/sucker/spec/support/amazon_credentials.rb
151
+ 57
152
+ /Users/snl/code/sucker/spec/support/amazon_credentials.rb
153
153
  p
154
154
  0
@@ -1,5 +1,5 @@
1
1
  !RBIX
2
- 0
2
+ 10937318184790222022
3
3
  x
4
4
  M
5
5
  1
@@ -215,8 +215,8 @@ I
215
215
  I
216
216
  a
217
217
  x
218
- 52
219
- /Users/hakanensari/code/sucker/spec/support/asins.rb
218
+ 44
219
+ /Users/snl/code/sucker/spec/support/asins.rb
220
220
  p
221
221
  1
222
222
  x
@@ -268,8 +268,8 @@ I
268
268
  I
269
269
  9
270
270
  x
271
- 52
272
- /Users/hakanensari/code/sucker/spec/support/asins.rb
271
+ 44
272
+ /Users/snl/code/sucker/spec/support/asins.rb
273
273
  p
274
274
  1
275
275
  x
@@ -307,8 +307,8 @@ I
307
307
  I
308
308
  51
309
309
  x
310
- 52
311
- /Users/hakanensari/code/sucker/spec/support/asins.rb
310
+ 44
311
+ /Users/snl/code/sucker/spec/support/asins.rb
312
312
  p
313
313
  1
314
314
  x
@@ -329,7 +329,7 @@ I
329
329
  I
330
330
  10
331
331
  x
332
- 52
333
- /Users/hakanensari/code/sucker/spec/support/asins.rb
332
+ 44
333
+ /Users/snl/code/sucker/spec/support/asins.rb
334
334
  p
335
335
  0
data/spec/support/vcr.rbc CHANGED
@@ -1,5 +1,5 @@
1
1
  !RBIX
2
- 0
2
+ 10937318184790222022
3
3
  x
4
4
  M
5
5
  1
@@ -241,8 +241,8 @@ I
241
241
  I
242
242
  4a
243
243
  x
244
- 50
245
- /Users/hakanensari/code/sucker/spec/support/vcr.rb
244
+ 42
245
+ /Users/snl/code/sucker/spec/support/vcr.rb
246
246
  p
247
247
  1
248
248
  x
@@ -323,8 +323,8 @@ c
323
323
  I
324
324
  11
325
325
  x
326
- 50
327
- /Users/hakanensari/code/sucker/spec/support/vcr.rb
326
+ 42
327
+ /Users/snl/code/sucker/spec/support/vcr.rb
328
328
  p
329
329
  1
330
330
  x
@@ -350,7 +350,7 @@ b
350
350
  I
351
351
  1d
352
352
  x
353
- 50
354
- /Users/hakanensari/code/sucker/spec/support/vcr.rb
353
+ 42
354
+ /Users/snl/code/sucker/spec/support/vcr.rb
355
355
  p
356
356
  0
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sucker
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 1.3.0.pre.3
4
+ prerelease:
5
+ version: 1.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paper Cavalier
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-25 00:00:00 +00:00
13
+ date: 2011-03-01 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -122,11 +122,12 @@ extensions: []
122
122
  extra_rdoc_files: []
123
123
 
124
124
  files:
125
+ - lib/sucker/hash.rb
126
+ - lib/sucker/hash.rbc
125
127
  - lib/sucker/parameters.rb
126
128
  - lib/sucker/parameters.rbc
127
129
  - lib/sucker/request.rb
128
130
  - lib/sucker/request.rbc
129
- - lib/sucker/response/hash.rb
130
131
  - lib/sucker/response.rb
131
132
  - lib/sucker/response.rbc
132
133
  - lib/sucker/version.rb
@@ -156,11 +157,12 @@ files:
156
157
  - spec/fixtures/cassette_library/spec/sucker/response.yml
157
158
  - spec/spec_helper.rb
158
159
  - spec/spec_helper.rbc
160
+ - spec/sucker/hash_spec.rb
161
+ - spec/sucker/hash_spec.rbc
159
162
  - spec/sucker/parameters_spec.rb
160
163
  - spec/sucker/parameters_spec.rbc
161
164
  - spec/sucker/request_spec.rb
162
165
  - spec/sucker/request_spec.rbc
163
- - spec/sucker/response/hash_spec.rb
164
166
  - spec/sucker/response_spec.rb
165
167
  - spec/sucker/response_spec.rbc
166
168
  - spec/sucker_spec.rb
@@ -191,9 +193,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
193
  required_rubygems_version: !ruby/object:Gem::Requirement
192
194
  none: false
193
195
  requirements:
194
- - - ">"
196
+ - - ">="
195
197
  - !ruby/object:Gem::Version
196
- version: 1.3.1
198
+ version: "0"
197
199
  requirements: []
198
200
 
199
201
  rubyforge_project: sucker
@@ -223,11 +225,12 @@ test_files:
223
225
  - spec/fixtures/cassette_library/spec/sucker/response.yml
224
226
  - spec/spec_helper.rb
225
227
  - spec/spec_helper.rbc
228
+ - spec/sucker/hash_spec.rb
229
+ - spec/sucker/hash_spec.rbc
226
230
  - spec/sucker/parameters_spec.rb
227
231
  - spec/sucker/parameters_spec.rbc
228
232
  - spec/sucker/request_spec.rb
229
233
  - spec/sucker/request_spec.rbc
230
- - spec/sucker/response/hash_spec.rb
231
234
  - spec/sucker/response_spec.rb
232
235
  - spec/sucker/response_spec.rbc
233
236
  - spec/sucker_spec.rb
@@ -1,46 +0,0 @@
1
- module Sucker
2
- class Response
3
- class Hash < ::Hash
4
- class << self
5
-
6
- # Based on https://gist.github.com/335286
7
- def from_xml(xml)
8
- case xml
9
- when Nokogiri::XML::Document
10
- new[xml.root.name] = from_xml(xml.root)
11
- when Nokogiri::XML::Element
12
- result_hash = new
13
-
14
- xml.attributes.each_pair do |key, attribute|
15
- result_hash[key] = attribute.value
16
- end
17
-
18
- xml.children.each do |child|
19
- result = from_xml(child)
20
-
21
- if child.name == 'text'
22
- if result_hash.empty?
23
- return result
24
- else
25
- result_hash['__content__'] = result
26
- end
27
- elsif result_hash[child.name]
28
- if result_hash[child.name].is_a? Array
29
- result_hash[child.name] << result
30
- else
31
- result_hash[child.name] = [result_hash[child.name]] << result
32
- end
33
- else
34
- result_hash[child.name] = result
35
- end
36
- end
37
-
38
- result_hash
39
- else
40
- xml.content.to_s
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,43 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
4
-
5
- module Sucker
6
- class Response
7
- describe Hash do
8
- let(:xml) do
9
- xml = <<-XML
10
- <?xml version=\"1.0\" ?>
11
- <ItemAttributes>
12
- <Title>Anti-Oedipus</Title>
13
- <Author>Gilles Deleuze</Author>
14
- <Author>Felix Guattari</Author>
15
- <Creator Role="Translator">Robert Hurley</Creator>
16
- </ItemAttributes>
17
- XML
18
- xml.gsub!(/>\s+</, '><')
19
- Nokogiri::XML(xml)
20
- end
21
-
22
- describe '.from_xml' do
23
- it 'returns a hash' do
24
- Hash.from_xml(xml).should be_an_instance_of Hash
25
- end
26
-
27
- it 'handles only childs' do
28
- Hash.from_xml(xml)['Title'].should eql 'Anti-Oedipus'
29
- end
30
-
31
- it 'handles arrays' do
32
- Hash.from_xml(xml)['Author'].should be_a Array
33
- end
34
-
35
- it 'handles attributes' do
36
- node = Hash.from_xml(xml)['Creator']
37
- node['Role'].should eql 'Translator'
38
- node['__content__'].should eql 'Robert Hurley'
39
- end
40
- end
41
- end
42
- end
43
- end