ratom 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.7.2
2
+
3
+ * Fix UTF handling bug. [carols10cents]
4
+
1
5
  == 0.7.1
2
6
 
3
7
  * 1.8.7 Compat fix [doximity]
@@ -301,10 +301,11 @@ module Atom # :nodoc:
301
301
  end
302
302
 
303
303
  else
304
+ self_string = self.to_s
304
305
 
305
- if self.to_s.force_encoding("UTF-8").ascii_only?
306
+ if self_string.dup.force_encoding("UTF-8").valid_encoding?
306
307
  node = XML::Node.new("#{namespace_map.prefix(Atom::NAMESPACE, name)}")
307
- node << self.to_s
308
+ node << self_string
308
309
  node['type'] = 'html'
309
310
  node['xml:lang'] = self.xml_lang if self.xml_lang
310
311
  node
@@ -1,3 +1,3 @@
1
1
  module Atom
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # Copyright (c) 2008 The Kaphan Foundation
2
3
  #
3
4
  # For licensing information see LICENSE.
@@ -1231,8 +1232,18 @@ describe Atom do
1231
1232
  entry.title = "My entry"
1232
1233
  entry.id = "urn:entry:1"
1233
1234
  entry.content = Atom::Content::Html.new("this is not \227 utf8")
1234
- end.to_xml)
1235
- }.should raise_error(Atom::SerializationError)
1235
+ end.to_xml)
1236
+ }.should raise_error(Atom::SerializationError)
1237
+ end
1238
+
1239
+ it "should not raise error when to_xml'ing utf8 but non-ascii content" do
1240
+ xml = Atom::Entry.new do |entry|
1241
+ entry.title = "My entry"
1242
+ entry.id = "urn:entry:1"
1243
+ entry.content = Atom::Content::Html.new("Žižek is utf8")
1244
+ end.to_xml
1245
+
1246
+ xml.should match(/Žižek/)
1236
1247
  end
1237
1248
  end
1238
1249
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-11 00:00:00.000000000 Z
13
+ date: 2012-05-11 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: libxml-ruby
17
- requirement: &70109177429600 !ruby/object:Gem::Requirement
17
+ requirement: &70366068662500 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 2.3.2
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70109177429600
25
+ version_requirements: *70366068662500
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &70109177428920 !ruby/object:Gem::Requirement
28
+ requirement: &70366068661620 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.1.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *70109177428920
36
+ version_requirements: *70366068661620
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &70109177428380 !ruby/object:Gem::Requirement
39
+ requirement: &70366068660500 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 2.10.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70109177428380
47
+ version_requirements: *70366068660500
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
- requirement: &70109177427900 !ruby/object:Gem::Requirement
50
+ requirement: &70366068659580 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 0.9.2
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70109177427900
58
+ version_requirements: *70366068659580
59
59
  description: A fast Atom Syndication and Publication API based on libxml
60
60
  email: seangeo@gmail.com
61
61
  executables: []
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  segments:
131
131
  - 0
132
- hash: -653931537989245690
132
+ hash: 2818491959700516161
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  none: false
135
135
  requirements:
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  segments:
140
140
  - 0
141
- hash: -653931537989245690
141
+ hash: 2818491959700516161
142
142
  requirements: []
143
143
  rubyforge_project:
144
144
  rubygems_version: 1.8.10