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

ruby-changes:28087

From: tenderlove <ko1@a...>
Date: Sat, 6 Apr 2013 02:56:07 +0900 (JST)
Subject: [ruby-changes:28087] tenderlove:r40139 (trunk): * ext/psych/lib/psych/exception.rb: there should be only one exception

tenderlove	2013-04-06 02:55:53 +0900 (Sat, 06 Apr 2013)

  New Revision: 40139

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

  Log:
    * ext/psych/lib/psych/exception.rb: there should be only one exception
      base class. Fixes tenderlove/psych #125
    * ext/psych/lib/psych.rb: require the correct exception class
    * ext/psych/lib/psych/syntax_error.rb: ditto
    * ext/psych/lib/psych/visitors/to_ruby.rb: ditto

  Added files:
    trunk/ext/psych/lib/psych/exception.rb
  Modified files:
    trunk/ChangeLog
    trunk/ext/psych/lib/psych/syntax_error.rb
    trunk/ext/psych/lib/psych/visitors/to_ruby.rb
    trunk/ext/psych/lib/psych.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40138)
+++ ChangeLog	(revision 40139)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Apr  6 02:54:08 2013  Aaron Patterson <aaron@t...>
+
+	* ext/psych/lib/psych/exception.rb: there should be only one exception
+	  base class. Fixes tenderlove/psych #125
+	* ext/psych/lib/psych.rb: require the correct exception class
+	* ext/psych/lib/psych/syntax_error.rb: ditto
+	* ext/psych/lib/psych/visitors/to_ruby.rb: ditto
+
 Sat Apr  6 02:30:28 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (new_defined): remove all extra parentheses, and return
Index: ext/psych/lib/psych/visitors/to_ruby.rb
===================================================================
--- ext/psych/lib/psych/visitors/to_ruby.rb	(revision 40138)
+++ ext/psych/lib/psych/visitors/to_ruby.rb	(revision 40139)
@@ -1,4 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/visitors/to_ruby.rb#L1
 require 'psych/scalar_scanner'
+require 'psych/exception'
 
 unless defined?(Regexp::NOENCODING)
   Regexp::NOENCODING = 32
Index: ext/psych/lib/psych/exception.rb
===================================================================
--- ext/psych/lib/psych/exception.rb	(revision 0)
+++ ext/psych/lib/psych/exception.rb	(revision 40139)
@@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/exception.rb#L1
+module Psych
+  class Exception < RuntimeError
+  end
+
+  class BadAlias < Exception
+  end
+end
Index: ext/psych/lib/psych/syntax_error.rb
===================================================================
--- ext/psych/lib/psych/syntax_error.rb	(revision 40138)
+++ ext/psych/lib/psych/syntax_error.rb	(revision 40139)
@@ -1,8 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/syntax_error.rb#L1
-module Psych
-  class Error < RuntimeError
-  end
+require 'psych/exception'
 
-  class SyntaxError < Error
+module Psych
+  class SyntaxError < Psych::Exception
     attr_reader :file, :line, :column, :offset, :problem, :context
 
     def initialize file, line, col, offset, problem, context
Index: ext/psych/lib/psych.rb
===================================================================
--- ext/psych/lib/psych.rb	(revision 40138)
+++ ext/psych/lib/psych.rb	(revision 40139)
@@ -221,12 +221,6 @@ module Psych https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych.rb#L221
   # The version of libyaml Psych is using
   LIBYAML_VERSION = Psych.libyaml_version.join '.'
 
-  class Exception < RuntimeError
-  end
-
-  class BadAlias < Exception
-  end
-
   ###
   # Load +yaml+ in to a Ruby data structure.  If multiple documents are
   # provided, the object contained in the first document will be returned.

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

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