Proc.new is deprecated; use `&block` instead
alec-c4 opened this issue ยท 7 comments
alec-c4 commented
Ruby 2.7 issues warnings for Proc.new without a block:
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb:113: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/alec/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
tbsvttr commented
Same problem here with Ruby 2.7.1p83 on Linux and macOS. It may seem like an minor issue, but it is hugely annoying in day to day operations. Please fix this and otherwise big thanks for this very useful Gem!
stripedpumpkin commented
You could consider switching to https://github.com/amazing-print/amazing_print which is a maintained fork. The substitution is trivial.
JokerCatz commented
it very easy to fix
# awesome_print-1.8.0/lib/awesome_print/formatters/base_formatter.rb # 113
def indented(&block)
inspector.increase_indentation(&block)
end
# awesome_print-1.8.0/lib/awesome_print/inspector.rb # 63
def increase_indentation(&block)
indentator.indent(&block)
end
but look like this repo is stop update ...
BryanH commented
Fixed with latest PR