mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
e2mmap.rb: suppress a warning
* lib/e2mmap.rb (bind): eval with the location. undefine predefined method before overwriting to suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f0e2194b0d
commit
1b95e8ef9c
1 changed files with 6 additions and 2 deletions
|
@ -62,16 +62,20 @@ module Exception2MessageMapper
|
|||
end
|
||||
|
||||
def bind(cl)
|
||||
self.module_eval %[
|
||||
self.module_eval "#{<<-"begin;"}\n#{<<-"end;"}", __FILE__, __LINE__+1
|
||||
begin;
|
||||
def Raise(err = nil, *rest)
|
||||
Exception2MessageMapper.Raise(self.class, err, *rest)
|
||||
end
|
||||
alias Fail Raise
|
||||
|
||||
class << self
|
||||
undef included
|
||||
end
|
||||
def self.included(mod)
|
||||
mod.extend Exception2MessageMapper
|
||||
end
|
||||
]
|
||||
end;
|
||||
end
|
||||
|
||||
# Fail(err, *rest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue