[前][次][番号順一覧][スレッド一覧]

ruby-changes:23202

From: tenderlove <ko1@a...>
Date: Sun, 8 Apr 2012 06:32:21 +0900 (JST)
Subject: [ruby-changes:23202] tenderlove:r35251 (ruby_1_9_3): merge revision(s) 35245,35248:

tenderlove	2012-04-08 06:31:43 +0900 (Sun, 08 Apr 2012)

  New Revision: 35251

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35251

  Log:
    merge revision(s) 35245,35248:
    
        * ext/psych/lib/psych.rb: bumping up psych version to match release.
        * ext/psych/psych.gemspec: ditto
    
        * ext/psych/parser.c: fall back to any encoding if the external
          encoding is wrong.  [ruby-core:44163]
        * test/psych/test_encoding.rb: fix test

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/psych/lib/psych.rb
    branches/ruby_1_9_3/ext/psych/parser.c
    branches/ruby_1_9_3/test/psych/test_encoding.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 35250)
+++ ruby_1_9_3/ChangeLog	(revision 35251)
@@ -1,3 +1,14 @@
+Sat Apr  7 10:28:40 2012  Aaron Patterson <aaron@t...>
+
+	* ext/psych/lib/psych.rb: bumping up psych version to match release.
+	* ext/psych/psych.gemspec: ditto
+
+Sat Apr  7 02:07:00 2012  Aaron Patterson <aaron@t...>
+
+	* ext/psych/parser.c: fall back to any encoding if the external
+	  encoding is wrong.  [ruby-core:44163]
+	* test/psych/test_encoding.rb: fix test
+
 Wed Apr  4 18:29:15 2012  NAKAMURA Usaku  <usa@r...>
 
 	* test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error.
Index: ruby_1_9_3/ext/psych/lib/psych.rb
===================================================================
--- ruby_1_9_3/ext/psych/lib/psych.rb	(revision 35250)
+++ ruby_1_9_3/ext/psych/lib/psych.rb	(revision 35251)
@@ -93,7 +93,7 @@
 
 module Psych
   # The version is Psych you're using
-  VERSION         = '1.3.1'
+  VERSION         = '1.3.2'
 
   # The version of libyaml Psych is using
   LIBYAML_VERSION = Psych.libyaml_version.join '.'
Index: ruby_1_9_3/ext/psych/parser.c
===================================================================
--- ruby_1_9_3/ext/psych/parser.c	(revision 35250)
+++ ruby_1_9_3/ext/psych/parser.c	(revision 35251)
@@ -146,10 +146,11 @@
 	return src;
     }
 
-    rb_raise(rb_eArgError, "YAML file must be UTF-8, UTF-16LE, or UTF-16BE, not %s",
-	    rb_enc_name(rb_enc_from_index(io_external_enc_index)));
+    /* If the external encoding is something we don't know how to handle,
+     * fall back to YAML_ANY_ENCODING. */
+    *parser_encoding = YAML_ANY_ENCODING;
 
-    return Qnil;
+    return src;
 }
 
 #endif
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 35250)
+++ ruby_1_9_3/version.h	(revision 35251)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 176
+#define RUBY_PATCHLEVEL 177
 
 #define RUBY_RELEASE_DATE "2012-04-04"
 #define RUBY_RELEASE_YEAR 2012
Index: ruby_1_9_3/test/psych/test_encoding.rb
===================================================================
--- ruby_1_9_3/test/psych/test_encoding.rb	(revision 35250)
+++ ruby_1_9_3/test/psych/test_encoding.rb	(revision 35251)
@@ -57,7 +57,7 @@
       # If the external encoding isn't utf8, utf16le, or utf16be, we cannot
       # process the file.
       File.open(t.path, 'r', :encoding => 'SHIFT_JIS') do |f|
-        assert_raises ArgumentError do
+        assert_raises Psych::SyntaxError do
           Psych.load(f)
         end
       end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]