From 193e3777c2ca9280e9ecf8a1053e4522f46a8a63 Mon Sep 17 00:00:00 2001 From: Chris Salvato Date: Tue, 12 Jan 2021 19:03:16 -0700 Subject: [PATCH] Fixes block and proc definition to work with Ruby 3.0.0 (#392) --- CHANGELOG.md | 1 + lib/awesome_print/formatters/base_formatter.rb | 4 ++-- lib/awesome_print/inspector.rb | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c199017c..7d43cb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## master (unreleased) + - Fixes block and proc definition to work with Ruby 3.0.0 [@csalvato] - [#392] - Removed check for Ruby 2.4 and earlier [@bryanh] - Rails 5.0 builds are failing, because the sqlite3 version being installed is wrong version [#366] - Fixes spec suite to properly work via travis, gets a clean build [@imajes, others] diff --git a/lib/awesome_print/formatters/base_formatter.rb b/lib/awesome_print/formatters/base_formatter.rb index c7f71c65..a11facc1 100644 --- a/lib/awesome_print/formatters/base_formatter.rb +++ b/lib/awesome_print/formatters/base_formatter.rb @@ -109,8 +109,8 @@ def indentation inspector.current_indentation end - def indented - inspector.increase_indentation(&Proc.new) + def indented(&block) + inspector.increase_indentation(&block) end def indent diff --git a/lib/awesome_print/inspector.rb b/lib/awesome_print/inspector.rb index 3c3fe110..437feb5f 100644 --- a/lib/awesome_print/inspector.rb +++ b/lib/awesome_print/inspector.rb @@ -62,8 +62,8 @@ def current_indentation indentator.indentation end - def increase_indentation - indentator.indent(&Proc.new) + def increase_indentation(&block) + indentator.indent(&block) end # Dispatcher that detects data nesting and invokes object-aware formatter.