summaryrefslogtreecommitdiff
path: root/tool/compile_prelude.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-15 09:07:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-15 09:07:45 +0000
commit7d6eb8e68bb215a04ad7b5b28d31af6b3c177849 (patch)
treeca2424f9f36b4433d0b6bb9365c31f3195b2b1be /tool/compile_prelude.rb
parent790f631301b8318df8b57ec8967fb2a56215cf76 (diff)
* tool/compile_prelude.rb: fix TMP_RUBY_PREFIX for relative load path
environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/compile_prelude.rb')
-rw-r--r--tool/compile_prelude.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb
index 7199434..e792b77 100644
--- a/tool/compile_prelude.rb
+++ b/tool/compile_prelude.rb
@@ -33,8 +33,7 @@ lines_list = preludes.map {|filename|
unless mkconf
require 'rbconfig'
mkconf = RbConfig::MAKEFILE_CONFIG.merge('prefix'=>'#{TMP_RUBY_PREFIX}')
- exlen = $:.reverse.find{|e|e!="."}.length - RbConfig::CONFIG["prefix"].length
- setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.reverse.find{|e|e!=\".\"}[0..#{-exlen-1}]\n"
+ setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.reverse.find{|e|e!=\".\"}.sub(%r{(.*)/lib/.*}m, \"\\\\1\")\n"
teardown_ruby_prefix = 'Object.class_eval { remove_const "TMP_RUBY_PREFIX" }'
end
if RbConfig::MAKEFILE_CONFIG.has_key? key