[ruby/pp] Use a proper feature check to check if Data is defined
https://github.com/ruby/pp/commit/ed602b9f2b
This commit is contained in:
parent
80f1c1e293
commit
3b9cc22536
@ -438,7 +438,7 @@ class Data # :nodoc:
|
|||||||
def pretty_print_cycle(q) # :nodoc:
|
def pretty_print_cycle(q) # :nodoc:
|
||||||
q.text sprintf("#<data %s:...>", PP.mcall(self, Kernel, :class).name)
|
q.text sprintf("#<data %s:...>", PP.mcall(self, Kernel, :class).name)
|
||||||
end
|
end
|
||||||
end if "3.2" <= RUBY_VERSION
|
end if defined?(Data.define)
|
||||||
|
|
||||||
class Range # :nodoc:
|
class Range # :nodoc:
|
||||||
def pretty_print(q) # :nodoc:
|
def pretty_print(q) # :nodoc:
|
||||||
|
@ -143,7 +143,7 @@ class PPCycleTest < Test::Unit::TestCase
|
|||||||
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
|
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
|
||||||
end
|
end
|
||||||
|
|
||||||
if "3.2" <= RUBY_VERSION
|
if defined?(Data.define)
|
||||||
D = Data.define(:aaa, :bbb)
|
D = Data.define(:aaa, :bbb)
|
||||||
def test_data
|
def test_data
|
||||||
a = D.new("aaa", "bbb")
|
a = D.new("aaa", "bbb")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user