isolate 1.8.2 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/README.rdoc +8 -0
  3. data/lib/isolate.rb +14 -5
  4. metadata +23 -3
@@ -1,3 +1,7 @@
1
+ === 1.9.0 / 2010-01-18
2
+
3
+ * Allow isolation to be disabled.
4
+
1
5
  === 1.8.2 / 2010-01-13
2
6
 
3
7
  * Don't include Isolate as a dependency in .gems.
@@ -47,6 +47,14 @@ At the end of the <tt>Isolate.gems</tt> block, you're completely
47
47
  isolated. <tt>GEM_PATH</tt> and <tt>GEM_HOME</tt> are set, and all
48
48
  your specified gems have been activated.
49
49
 
50
+ If you need access to the original un-isolated environment for any
51
+ reason, you can temporarily disable Isolate:
52
+
53
+ Isolate.disable { `heroku config` }
54
+
55
+ I occasionally use this to call out to gems or tools that don't belong
56
+ in my project.
57
+
50
58
  === Conditionals
51
59
 
52
60
  Sometimes different sets of gems are appropriate at different
@@ -8,6 +8,8 @@ require "rubygems/requirement"
8
8
 
9
9
  class Isolate
10
10
 
11
+ VERSION = "1.9.0" # :nodoc:
12
+
11
13
  # An isolated Gem, with requirement, environment restrictions, and
12
14
  # installation options. Internal use only.
13
15
 
@@ -21,11 +23,16 @@ class Isolate
21
23
  end
22
24
  end
23
25
 
24
- VERSION = "1.8.2" # :nodoc:
25
-
26
26
  attr_reader :entries # :nodoc:
27
27
  attr_reader :path # :nodoc:
28
28
 
29
+ # Disable Isolate. If a block is provided, isolation will be
30
+ # disabled for the scope of the block.
31
+
32
+ def self.disable &block
33
+ instance.disable &block
34
+ end
35
+
29
36
  def self.env # :nodoc:
30
37
  ENV["ISOLATE_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
31
38
  end
@@ -127,7 +134,7 @@ class Isolate
127
134
  @cleanup
128
135
  end
129
136
 
130
- def disable # :nodoc:
137
+ def disable &block # :nodoc:
131
138
  return self if not enabled?
132
139
 
133
140
  ENV["GEM_PATH"] = @old_gem_path
@@ -140,6 +147,7 @@ class Isolate
140
147
  @enabled = false
141
148
 
142
149
  self.class.refresh
150
+ begin; return yield ensure enable end if block_given?
143
151
 
144
152
  self
145
153
  end
@@ -224,9 +232,10 @@ class Isolate
224
232
  log format % [i + 1, installable.size, e.name, e.requirement]
225
233
 
226
234
  old = Gem.sources.dup
227
- options = e.options.merge(:install_dir => path,
235
+ options = e.options.merge(:development => false,
228
236
  :generate_rdoc => false,
229
- :generate_ri => false)
237
+ :generate_ri => false,
238
+ :install_dir => path)
230
239
  source = options.delete :source
231
240
  args = options.delete :args
232
241
  Gem.sources = Array(source) if source
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isolate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette
@@ -10,9 +10,29 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-13 00:00:00 -08:00
13
+ date: 2010-01-18 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rubyforge
18
+ type: :development
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 2.0.3
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: gemcutter
28
+ type: :development
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.2.1
35
+ version:
16
36
  - !ruby/object:Gem::Dependency
17
37
  name: minitest
18
38
  type: :development
@@ -31,7 +51,7 @@ dependencies:
31
51
  requirements:
32
52
  - - ">="
33
53
  - !ruby/object:Gem::Version
34
- version: 2.4.0
54
+ version: 2.5.0
35
55
  version:
36
56
  description: |-
37
57
  Isolate is a very simple RubyGems sandbox. It provides a way to