amazon-ecs 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 2.2.4 2012-01-01
2
+ ----------------
3
+ * Parse with UTF-8 encoding, happy new year :)
4
+
1
5
  2.2.3 2011-12-05
2
6
  ----------------
3
7
  * Add Amazon Spain API
data/lib/amazon/ecs.rb CHANGED
@@ -32,7 +32,7 @@ module Amazon
32
32
  class RequestError < StandardError; end
33
33
 
34
34
  class Ecs
35
- VERSION = '2.2.3'
35
+ VERSION = '2.2.4'
36
36
 
37
37
  SERVICE_URLS = {
38
38
  :us => 'http://ecs.amazonaws.com/onca/xml',
@@ -141,7 +141,7 @@ module Amazon
141
141
 
142
142
  # XML input is in string format
143
143
  def initialize(xml)
144
- @doc = Nokogiri::XML(xml)
144
+ @doc = Nokogiri::XML(xml, nil, 'UTF-8')
145
145
  @doc.remove_namespaces!
146
146
  # @doc.xpath("//*").each { |elem| elem.name = elem.name.downcase }
147
147
  # @doc.xpath("//@*").each { |att| att.name = att.name.downcase }
@@ -62,10 +62,13 @@ class Amazon::EcsTest < Test::Unit::TestCase
62
62
  "Error string different from expected"
63
63
  end
64
64
 
65
- def test_item_search_uk
65
+ def test_utf8_encoding
66
66
  resp = Amazon::Ecs.item_search('ruby', :country => :uk)
67
67
  assert resp.is_valid_request?,
68
68
  "Not a valid request"
69
+ item = resp.first_item
70
+ assert_no_match /\A&#x.*/, item.get_unescaped("//FormattedPrice"),
71
+ "£ sign converted to ASCII from UTF-8"
69
72
  end
70
73
 
71
74
  def test_item_search_by_author
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-ecs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-05 00:00:00.000000000Z
12
+ date: 2012-01-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &2153452280 !ruby/object:Gem::Requirement
16
+ requirement: &2156236900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.4'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153452280
24
+ version_requirements: *2156236900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby-hmac
27
- requirement: &2153450240 !ruby/object:Gem::Requirement
27
+ requirement: &2156236280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153450240
35
+ version_requirements: *2156236280
36
36
  description: Generic Amazon Product Advertising Ruby API.
37
37
  email: herryanto@gmail.com
38
38
  executables: []