зеркало из https://github.com/github/ruby.git
* instruby.rb (makedirs): make same directory only once even if
dryrun. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3380618f1c
Коммит
171df94c27
|
@ -1,9 +1,12 @@
|
|||
Sun Jan 26 06:43:48 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
Sun Jan 26 07:18:42 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* instruby.rb: re-define individual methods verbosely rather than
|
||||
including FileUtils::Verbose, in order to suppress messages from
|
||||
FileUtils#cmp.
|
||||
|
||||
* instruby.rb (makedirs): make same directory only once even if
|
||||
dryrun.
|
||||
|
||||
* lib/fileutils.rb (FileUtils::Verbose, FileUtils::NoWrite):
|
||||
re-define methods with define_method instead of module_eval.
|
||||
|
||||
|
|
15
instruby.rb
15
instruby.rb
|
@ -53,10 +53,21 @@ include FileUtils::NoWrite if $dryrun
|
|||
alias makelink ln_sf
|
||||
class << self
|
||||
body = proc {|*args|super(*args<<:verbose)}
|
||||
for func in [:install, :makedirs, :makelink]
|
||||
for func in [:install, :makelink]
|
||||
define_method(func, body)
|
||||
end
|
||||
end
|
||||
$made_dirs = {}
|
||||
def makedirs(dirs)
|
||||
dirs = fu_list(dirs)
|
||||
dirs.reject! do |dir|
|
||||
$made_dirs.fetch(dir) do
|
||||
$made_dirs[dir] = true
|
||||
File.directory?(dir)
|
||||
end
|
||||
end
|
||||
super(dirs, :verbose) unless dirs.empty?
|
||||
end
|
||||
|
||||
exeext = CONFIG["EXEEXT"]
|
||||
|
||||
|
@ -151,7 +162,7 @@ end
|
|||
|
||||
Dir.glob("lib/**/*{.rb,help-message}") do |f|
|
||||
dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir
|
||||
makedirs dir unless File.directory? dir
|
||||
makedirs dir
|
||||
install f, dir, 0644
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче