psych 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ Sat Apr 7 02:07:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
2
+
3
+ * ext/psych/parser.c: fall back to any encoding if the external
4
+ encoding is wrong. [ruby-core:44163]
5
+ * test/psych/test_encoding.rb: fix test
6
+
1
7
  Fri Mar 9 06:29:22 2012 Aaron Patterson <aaron@tenderlovemaking.com>
2
8
 
3
9
  * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
@@ -146,10 +146,11 @@ static VALUE transcode_io(VALUE src, int * parser_encoding)
146
146
  return src;
147
147
  }
148
148
 
149
- rb_raise(rb_eArgError, "YAML file must be UTF-8, UTF-16LE, or UTF-16BE, not %s",
150
- rb_enc_name(rb_enc_from_index(io_external_enc_index)));
149
+ /* If the external encoding is something we don't know how to handle,
150
+ * fall back to YAML_ANY_ENCODING. */
151
+ *parser_encoding = YAML_ANY_ENCODING;
151
152
 
152
- return Qnil;
153
+ return src;
153
154
  }
154
155
 
155
156
  #endif
@@ -93,7 +93,7 @@ require 'psych/handlers/document_stream'
93
93
 
94
94
  module Psych
95
95
  # The version is Psych you're using
96
- VERSION = '1.3.1'
96
+ VERSION = '1.3.2'
97
97
 
98
98
  # The version of libyaml Psych is using
99
99
  LIBYAML_VERSION = Psych.libyaml_version.join '.'
@@ -57,7 +57,7 @@ module Psych
57
57
  # If the external encoding isn't utf8, utf16le, or utf16be, we cannot
58
58
  # process the file.
59
59
  File.open(t.path, 'r', :encoding => 'SHIFT_JIS') do |f|
60
- assert_raises ArgumentError do
60
+ assert_raises Psych::SyntaxError do
61
61
  Psych.load(f)
62
62
  end
63
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psych
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
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: 2012-03-27 00:00:00.000000000 Z
12
+ date: 2012-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
16
- requirement: &70103476578220 !ruby/object:Gem::Requirement
16
+ requirement: &70210793685840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.4.1
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70103476578220
24
+ version_requirements: *70210793685840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &70103476577200 !ruby/object:Gem::Requirement
27
+ requirement: &70210793685400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.10'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70103476577200
35
+ version_requirements: *70210793685400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &70103476576580 !ruby/object:Gem::Requirement
38
+ requirement: &70210793709520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.13'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70103476576580
46
+ version_requirements: *70210793709520
47
47
  description: ! 'Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
48
48
 
49
49
  for its YAML parsing and emitting capabilities. In addition to wrapping