ruby-changes:41897
From: nobu <ko1@a...>
Date: Mon, 29 Feb 2016 17:35:40 +0900 (JST)
Subject: [ruby-changes:41897] nobu:r53971 (trunk): fileutils.rb: unify method definition style
nobu 2016-02-29 17:36:28 +0900 (Mon, 29 Feb 2016) New Revision: 53971 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53971 Log: fileutils.rb: unify method definition style * lib/fileutils.rb: Unify to coding-style for method definition. Modified files: trunk/lib/fileutils.rb Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 53970) +++ lib/fileutils.rb (revision 53971) @@ -1629,7 +1629,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1629 # # p FileUtils.commands #=> ["chmod", "cp", "cp_r", "install", ...] # - def FileUtils.commands + def self.commands OPT_TABLE.keys end @@ -1638,7 +1638,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1638 # # p FileUtils.options #=> ["noop", "force", "verbose", "preserve", "mode"] # - def FileUtils.options + def self.options OPT_TABLE.values.flatten.uniq.map {|sym| sym.to_s } end @@ -1649,7 +1649,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1649 # p FileUtils.have_option?(:rm, :force) #=> true # p FileUtils.have_option?(:rm, :preserve) #=> false # - def FileUtils.have_option?(mid, opt) + def self.have_option?(mid, opt) li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}" li.include?(opt) end @@ -1659,7 +1659,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1659 # # p FileUtils.options_of(:rm) #=> ["noop", "verbose", "force"] # - def FileUtils.options_of(mid) + def self.options_of(mid) OPT_TABLE[mid.to_s].map {|sym| sym.to_s } end @@ -1668,7 +1668,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1668 # # p FileUtils.collect_method(:preserve) #=> ["cp", "cp_r", "copy", "install"] # - def FileUtils.collect_method(opt) + def self.collect_method(opt) OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) } end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/