mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Get rid of block-less Proc.new
* lib/optparse.rb (OptionParser::Switch#initialize): get rid of `Proc.new` without a block, which may be deprecated in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b7fccecf1c
commit
2d67a3f4b1
1 changed files with 2 additions and 1 deletions
|
@ -534,8 +534,9 @@ class OptionParser
|
|||
|
||||
def initialize(pattern = nil, conv = nil,
|
||||
short = nil, long = nil, arg = nil,
|
||||
desc = ([] if short or long), block = Proc.new)
|
||||
desc = ([] if short or long), block = nil, &_block)
|
||||
raise if Array === pattern
|
||||
block ||= _block
|
||||
@pattern, @conv, @short, @long, @arg, @desc, @block =
|
||||
pattern, conv, short, long, arg, desc, block
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue