mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block
instead of deprecated Method#to_proc. (ruby-bugs-ja:PR#477) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c0eb57417c
commit
7712407048
4 changed files with 10 additions and 5 deletions
|
|
@ -403,7 +403,7 @@ summary feature.
|
|||
pat = t if t.respond_to?(:match)
|
||||
end
|
||||
unless block
|
||||
block = pat.method(:convert).to_proc if pat.respond_to?(:convert)
|
||||
block = pat.method(:convert).to_block if pat.respond_to?(:convert)
|
||||
end
|
||||
@atype[t] = [pat, block]
|
||||
end
|
||||
|
|
@ -938,7 +938,7 @@ Default options, which never appear in option summary.
|
|||
# directly specified pattern(any object possible to match)
|
||||
if !(String === o) and o.respond_to?(:match)
|
||||
pattern = notwice(o, pattern, 'pattern')
|
||||
conv = (pattern.method(:convert).to_proc if pattern.respond_to?(:convert))
|
||||
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||
next
|
||||
end
|
||||
|
||||
|
|
@ -951,7 +951,7 @@ Default options, which never appear in option summary.
|
|||
when CompletingHash
|
||||
when nil
|
||||
pattern = CompletingHash.new
|
||||
conv = (pattern.method(:convert).to_proc if pattern.respond_to?(:convert))
|
||||
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||
else
|
||||
raise ArgumentError, "argument pattern given twice"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue