[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
@ -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…
x
Reference in New Issue
Block a user