Permalink
Browse files

+ Added engined/versioned subdir to .ruby_inline to help with multipl…

…e-ruby usage. (valodzka)

[git-p4: depot-paths = "//src/RubyInline/dev/": change = 6598]
  • Loading branch information...
1 parent 91f4a7c commit 9c166dd808643901e4b59720675e4397e4ed1f2c @zenspider zenspider committed Aug 30, 2011
Showing with 10 additions and 6 deletions.
  1. +8 −5 lib/inline.rb
  2. +2 −1 test/test_inline.rb
View
@@ -134,11 +134,14 @@ def self.rootdir
end
def self.directory
- directory = File.join(rootdir, ".ruby_inline")
- unless defined? @@directory and directory == @@directory
- @@directory = File.join(self.rootdir, ".ruby_inline")
+ unless defined? @@directory then
+ version = "#{Gem.ruby_engine}-#{RbConfig::CONFIG['ruby_version']}"
+
+ @@directory = File.join(self.rootdir, ".ruby_inline", version)
end
- Dir.assert_secure directory
+
+ Dir.assert_secure @@directory
+
@@directory
end
@@ -525,7 +528,7 @@ def build
unless File.directory? Inline.directory then
warn "NOTE: creating #{Inline.directory} for RubyInline" if $DEBUG
- Dir.mkdir Inline.directory, 0700
+ FileUtils.mkdir_p Inline.directory, :mode => 0700
end
src_name = "#{Inline.directory}/#{module_name}.c"
View
@@ -80,7 +80,8 @@ def test_rootdir
end
def test_directory
- inlinedir = File.join(@rootdir, ".ruby_inline")
+ version = "#{Gem.ruby_engine}-#{RbConfig::CONFIG['ruby_version']}"
+ inlinedir = File.join(@rootdir, ".ruby_inline", version)
assert_equal(inlinedir, Inline.directory)
end

0 comments on commit 9c166dd

Please sign in to comment.