From 3b9cc22536f2a72ece034881aaf568767e8e1e86 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 30 Nov 2023 17:03:59 +0100 Subject: [PATCH] [ruby/pp] Use a proper feature check to check if Data is defined https://github.com/ruby/pp/commit/ed602b9f2b --- lib/pp.rb | 2 +- test/test_pp.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pp.rb b/lib/pp.rb index 1708dee05e..7c4ba0e672 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -438,7 +438,7 @@ class Data # :nodoc: def pretty_print_cycle(q) # :nodoc: q.text sprintf("#", PP.mcall(self, Kernel, :class).name) end -end if "3.2" <= RUBY_VERSION +end if defined?(Data.define) class Range # :nodoc: def pretty_print(q) # :nodoc: diff --git a/test/test_pp.rb b/test/test_pp.rb index f6c2f65df2..d7cca82a00 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -143,7 +143,7 @@ class PPCycleTest < Test::Unit::TestCase assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup)) end - if "3.2" <= RUBY_VERSION + if defined?(Data.define) D = Data.define(:aaa, :bbb) def test_data a = D.new("aaa", "bbb")