mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/pp] Only do RubyVM patches if class exists
This class does not exist in any implementation except CRuby. I would recommend moving this code somewhere else, like a separate file loaded only on CRuby or into CRuby itself. For now this change is sufficient to load the library on other implementations. https://github.com/ruby/pp/commit/7d5a220f64
This commit is contained in:
parent
de6ef2ca71
commit
5a6baaba38
1 changed files with 30 additions and 28 deletions
|
@ -539,6 +539,7 @@ class MatchData # :nodoc:
|
|||
end
|
||||
end
|
||||
|
||||
if defined?(RubyVM::AbstractSyntaxTree)
|
||||
class RubyVM::AbstractSyntaxTree::Node
|
||||
def pretty_print_children(q, names = [])
|
||||
children.zip(names) do |c, n|
|
||||
|
@ -572,6 +573,7 @@ class RubyVM::AbstractSyntaxTree::Node
|
|||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Object < BasicObject # :nodoc:
|
||||
include PP::ObjectMixin
|
||||
|
|
Loading…
Reference in a new issue