diff options
Diffstat (limited to 'instruby.rb')
-rwxr-xr-x | instruby.rb | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/instruby.rb b/instruby.rb index ea9ef2a582..ff7de147cf 100755 --- a/instruby.rb +++ b/instruby.rb @@ -5,13 +5,14 @@ include RbConfig $".unshift File.expand_path("./rbconfig.rb") srcdir = File.dirname(__FILE__) -$:.unshift File.expand_path("lib", srcdir) +unless defined?(CROSS_COMPILING) and CROSS_COMPILING + $:.replace([File.expand_path("lib", srcdir), Dir.pwd]) +end require 'fileutils' require 'shellwords' require 'optparse' require 'optparse/shellwords' require 'tempfile' -require 'rdoc/ri/paths' STDOUT.sync = true File.umask(0) @@ -394,17 +395,13 @@ install?(:local, :comm, :man) do if $mantype == "doc" install mdoc, destfile, :mode => $data_mode else - require "../tool/mdoc2man.rb" - - w = Tempfile.open(mdoc) - - open(mdoc) { |r| - Mdoc2Man.mdoc2man(r, w) - } - - w.close + require File.join(srcdir, "tool/mdoc2man.rb") + Tempfile.open(mdoc) do |w| + open(mdoc) {|r| Mdoc2Man.mdoc2man(r, w)} + end install w.path, destfile, :mode => $data_mode + w.close! end end end @@ -412,7 +409,7 @@ end install?(:local, :comm, :gem) do puts "creating default gem directories" - gpath = Gem.default_dir + gpath = CONFIG["sitelibdir"].sub(%r'/site_ruby/(?=[^/]+)', '/gems/') makedirs Gem::DIRECTORIES.collect {|dir| File.join(gpath, dir)} end |