isolate 2.0.0.pre.0 → 2.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +6 -0
- data/lib/isolate.rb +8 -1
- data/lib/isolate/sandbox.rb +8 -12
- data/test/test_isolate_sandbox.rb +2 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 2.0.0.pre.1 / 2010-05-02
|
2
|
+
|
3
|
+
* Don't provide a special way to set path, options is enough.
|
4
|
+
* Deprecate and warn for Isolate.instance.
|
5
|
+
* Allow :multiruby option to be overridden in .local files.
|
6
|
+
|
1
7
|
=== 2.0.0.pre.0 / 2010-04-27
|
2
8
|
|
3
9
|
* Remove cache thawing until I fix RubyGems.
|
data/lib/isolate.rb
CHANGED
@@ -8,7 +8,7 @@ module Isolate
|
|
8
8
|
|
9
9
|
# Duh.
|
10
10
|
|
11
|
-
VERSION = "2.0.0.pre.
|
11
|
+
VERSION = "2.0.0.pre.1"
|
12
12
|
|
13
13
|
# Disable Isolate. If a block is provided, isolation will be
|
14
14
|
# disabled for the scope of the block.
|
@@ -28,6 +28,13 @@ module Isolate
|
|
28
28
|
now! options.merge(:path => path), &block
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.instance
|
32
|
+
warn "Isolate.instance is deprecated, use Isolate.sandbox instead.\n" +
|
33
|
+
"Isolate.instance will be removed in v3.0."
|
34
|
+
|
35
|
+
sandbox
|
36
|
+
end
|
37
|
+
|
31
38
|
@@sandbox = nil
|
32
39
|
|
33
40
|
def self.sandbox
|
data/lib/isolate/sandbox.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require "isolate/entry"
|
3
3
|
require "rbconfig"
|
4
|
+
require "rubygems/defaults"
|
4
5
|
require "rubygems/uninstaller"
|
5
6
|
|
6
7
|
module Isolate
|
@@ -19,8 +20,6 @@ module Isolate
|
|
19
20
|
@files = []
|
20
21
|
@options = options
|
21
22
|
|
22
|
-
path options.fetch(:path, "tmp/isolate")
|
23
|
-
|
24
23
|
file, local = nil
|
25
24
|
|
26
25
|
unless FalseClass === options[:file]
|
@@ -225,24 +224,21 @@ module Isolate
|
|
225
224
|
def multiruby?
|
226
225
|
@options.fetch :multiruby, true
|
227
226
|
end
|
227
|
+
|
228
228
|
def options options = nil
|
229
229
|
@options.merge! options if options
|
230
230
|
@options
|
231
231
|
end
|
232
232
|
|
233
|
-
def path
|
234
|
-
|
235
|
-
unless @options.key?(:multiruby) && @options[:multiruby] == false
|
236
|
-
suffix = RbConfig::CONFIG.
|
237
|
-
values_at("ruby_install_name", "ruby_version").join "-"
|
238
|
-
|
239
|
-
path = File.join(path, suffix) unless path =~ /#{suffix}/
|
240
|
-
end
|
233
|
+
def path
|
234
|
+
base = @options.fetch :path, "tmp/isolate"
|
241
235
|
|
242
|
-
|
236
|
+
unless @options.key?(:multiruby) && @options[:multiruby] == false
|
237
|
+
suffix = "#{Gem.ruby_engine}-#{RbConfig::CONFIG['ruby_version']}"
|
238
|
+
base = File.join(base, suffix) unless base =~ /#{suffix}/
|
243
239
|
end
|
244
240
|
|
245
|
-
|
241
|
+
File.expand_path base
|
246
242
|
end
|
247
243
|
|
248
244
|
def system?
|
@@ -236,12 +236,12 @@ class TestIsolateSandbox < Isolate::Test
|
|
236
236
|
|
237
237
|
def test_path
|
238
238
|
s = sandbox :multiruby => false do
|
239
|
-
path "tmp/foo"
|
239
|
+
options :path => "tmp/foo"
|
240
240
|
end
|
241
241
|
|
242
242
|
assert_equal File.expand_path("tmp/foo"), s.path
|
243
243
|
|
244
|
-
v = RbConfig::CONFIG
|
244
|
+
v = [Gem.ruby_engine, RbConfig::CONFIG["ruby_version"]].join "-"
|
245
245
|
s = sandbox :multiruby => true
|
246
246
|
p = File.expand_path("tmp/isolate/#{v}")
|
247
247
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isolate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923832043
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 2.0.0.pre.
|
11
|
+
- 1
|
12
|
+
version: 2.0.0.pre.1
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- John Barnette
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-
|
21
|
+
date: 2010-05-02 00:00:00 -07:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|