Skip to content

Commit 476a62f

Browse files
committed
* 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
1 parent 4037029 commit 476a62f

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Sat Apr 6 02:54:08 2013 Aaron Patterson <[email protected]>
2+
3+
* ext/psych/lib/psych/exception.rb: there should be only one exception
4+
base class. Fixes tenderlove/psych #125
5+
* ext/psych/lib/psych.rb: require the correct exception class
6+
* ext/psych/lib/psych/syntax_error.rb: ditto
7+
* ext/psych/lib/psych/visitors/to_ruby.rb: ditto
8+
19
Sat Apr 6 02:30:28 2013 Nobuyoshi Nakada <[email protected]>
210

311
* parse.y (new_defined): remove all extra parentheses, and return

ext/psych/lib/psych.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ module Psych
221221
# The version of libyaml Psych is using
222222
LIBYAML_VERSION = Psych.libyaml_version.join '.'
223223

224-
class Exception < RuntimeError
225-
end
226-
227-
class BadAlias < Exception
228-
end
229-
230224
###
231225
# Load +yaml+ in to a Ruby data structure. If multiple documents are
232226
# provided, the object contained in the first document will be returned.

ext/psych/lib/psych/exception.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Psych
2+
class Exception < RuntimeError
3+
end
4+
5+
class BadAlias < Exception
6+
end
7+
end

ext/psych/lib/psych/syntax_error.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
module Psych
2-
class Error < RuntimeError
3-
end
1+
require 'psych/exception'
42

5-
class SyntaxError < Error
3+
module Psych
4+
class SyntaxError < Psych::Exception
65
attr_reader :file, :line, :column, :offset, :problem, :context
76

87
def initialize file, line, col, offset, problem, context

ext/psych/lib/psych/visitors/to_ruby.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'psych/scalar_scanner'
2+
require 'psych/exception'
23

34
unless defined?(Regexp::NOENCODING)
45
Regexp::NOENCODING = 32

0 commit comments

Comments
 (0)