warning: tried to create Proc object without a block
localhostdotdev opened this issue · 3 comments
localhostdotdev commented
I'm getting a bunch of warnings on the latest ruby version (2.7.0dev):
.rvm/gems/ruby-head/gems/awesome_print-1.8.0/lib/awesome_print/inspector.rb:63: warning: tried to create Proc object without a block
Mentioned code:
def increase_indentation
indentator.indent(&Proc.new)
end
Cueball commented
This is particularly annoying when using AP within pry (possibly irb as well). Every output is preceded with a wall or warning messages:
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
/usr/local/var/rbenv/versions/2.7.0-preview1/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
(Will see about a PR when I've got a bit of time.)
qortex commented
Same in irb
:
/home/mic/.rbenv/versions/2.7.0/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
/home/mic/.rbenv/versions/2.7.0/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
/home/mic/.rbenv/versions/2.7.0/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
/home/mic/.rbenv/versions/2.7.0/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
BryanH commented
Fixed with latest PR - will be pushed out in next release!