mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40370296c7
commit
476a62fbbe
5 changed files with 19 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Sat Apr 6 02:54:08 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Sat Apr 6 02:30:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (new_defined): remove all extra parentheses, and return
|
* parse.y (new_defined): remove all extra parentheses, and return
|
||||||
|
|
|
@ -221,12 +221,6 @@ module Psych
|
||||||
# The version of libyaml Psych is using
|
# The version of libyaml Psych is using
|
||||||
LIBYAML_VERSION = Psych.libyaml_version.join '.'
|
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
|
# Load +yaml+ in to a Ruby data structure. If multiple documents are
|
||||||
# provided, the object contained in the first document will be returned.
|
# provided, the object contained in the first document will be returned.
|
||||||
|
|
7
ext/psych/lib/psych/exception.rb
Normal file
7
ext/psych/lib/psych/exception.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module Psych
|
||||||
|
class Exception < RuntimeError
|
||||||
|
end
|
||||||
|
|
||||||
|
class BadAlias < Exception
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,8 +1,7 @@
|
||||||
module Psych
|
require 'psych/exception'
|
||||||
class Error < RuntimeError
|
|
||||||
end
|
|
||||||
|
|
||||||
class SyntaxError < Error
|
module Psych
|
||||||
|
class SyntaxError < Psych::Exception
|
||||||
attr_reader :file, :line, :column, :offset, :problem, :context
|
attr_reader :file, :line, :column, :offset, :problem, :context
|
||||||
|
|
||||||
def initialize file, line, col, offset, problem, context
|
def initialize file, line, col, offset, problem, context
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require 'psych/scalar_scanner'
|
require 'psych/scalar_scanner'
|
||||||
|
require 'psych/exception'
|
||||||
|
|
||||||
unless defined?(Regexp::NOENCODING)
|
unless defined?(Regexp::NOENCODING)
|
||||||
Regexp::NOENCODING = 32
|
Regexp::NOENCODING = 32
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue