1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fileutils.rb: LowMethods aliases

* lib/fileutils.rb (LowMethods): make alias methods instead of
  eval for each methods.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-02-29 12:22:17 +00:00
parent efa39c3dbd
commit 52bdb3ce02

View file

@ -1674,8 +1674,9 @@ module FileUtils
LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern)
module LowMethods
module_eval("private\n" + ::FileUtils::LOW_METHODS.map {|name| "def #{name}(*)end"}.join("\n"),
__FILE__, __LINE__)
private
def _do_nothing(*)end
::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
end
METHODS = singleton_methods() - [:private_module_function,