install.rb in rake-0.8.7 vs install.rb in rake-0.9.0.beta.0
- old
+ new
@@ -1,10 +1,10 @@
require 'rbconfig'
require 'find'
-require 'ftools'
+require 'fileutils'
-include Config
+include RbConfig
$ruby = CONFIG['ruby_install_name']
##
# Install a binary file. We patch in on the way through to
@@ -25,22 +25,23 @@
end
end
fail "Cannot find a temporary directory" unless tmp_dir
tmp_file = File.join(tmp_dir, "_tmp")
-
+
File.open(from) do |ip|
File.open(tmp_file, "w") do |op|
ruby = File.join($realbindir, $ruby)
op.puts "#!#{ruby} -w"
op.write ip.read
end
end
opfile += ".rb" if CONFIG["target_os"] =~ /mswin/i
- File::install(tmp_file, File.join($bindir, opfile), 0755, true)
- File::unlink(tmp_file)
+ FileUtils.install(tmp_file, File.join($bindir, opfile),
+ {:mode => 0755, :verbose => true})
+ File.unlink(tmp_file)
end
$sitedir = CONFIG["sitelibdir"]
unless $sitedir
version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
@@ -59,29 +60,30 @@
bindir = CONFIG["bindir"]
if (destdir = ENV['DESTDIR'])
$bindir = destdir + $bindir
$sitedir = destdir + $sitedir
-
- File::makedirs($bindir)
- File::makedirs($sitedir)
+
+ FileUtils.mkdir_p($bindir)
+ FileUtils.mkdir_p($sitedir)
end
rake_dest = File.join($sitedir, "rake")
-File::makedirs(rake_dest, true)
-File::chmod(0755, rake_dest)
+FileUtils.mkdir_p(rake_dest, {:verbose => true})
+File.chmod(0755, rake_dest)
# The library files
files = Dir.chdir('lib') { Dir['**/*.rb'] }
for fn in files
fn_dir = File.dirname(fn)
target_dir = File.join($sitedir, fn_dir)
if ! File.exist?(target_dir)
- File.makedirs(target_dir)
+ FileUtils.mkdir_p(target_dir)
end
- File::install(File.join('lib', fn), File.join($sitedir, fn), 0644, true)
+ FileUtils.install(File.join('lib', fn), File.join($sitedir, fn),
+ {:mode => 0644, :verbose => true})
end
# and the executable
installBIN("bin/rake", "rake")