Restricts GEM_PATH
and GEM_HOME
and provides a
DSL for expressing your code’s runtime Gem dependencies. See README.rdoc for rationale, limitations, and
examples.
Duh.
Disable Isolate. If a block is provided, isolation will be disabled for the scope of the block.
# File lib/isolate.rb, line 16 def self.disable &block sandbox.disable(&block) end
What environment should be isolated? Consults environment variables
ISOLATE_ENV
, RAILS_ENV
, and
RACK_ENV
. Defaults to "development"
if
none are set.
# File lib/isolate.rb, line 25 def self.env ENV["ISOLATE_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end
Declare an isolated RubyGems environment, installed in path
.
Any block given will be instance_eval
ed, see Isolate::Sandbox#gem and Isolate::Sandbox#environment
for the sort of stuff you can do.
Valid options:
Should obsolete gems be removed? Default is true
.
Specify an Isolate file to
instance_eval
. Default is Isolate
or
config/isolate.rb
, whichever is found first. Passing
false
disables file loading.
Should missing gems be installed? Default is true
.
Should Isolate assume that multiple Ruby
versions will be used simultaneously? If so, gems will be segregated by
Ruby version. Default is true
.
Where should isolated gems be kept? Default is
"tmp/isolate"
, and a Ruby version specifier suffix
will be added if :multiruby
is true
.
Should system gems be allowed to satisfy dependencies? Default is
true
.
Should Isolate be chatty during installs and
nukes? Default is true
.
# File lib/isolate.rb, line 74 def self.now! options = {}, &block @@sandbox = Isolate::Sandbox.new options, &block @@sandbox.activate end
A singleton instance of Isolate::Sandbox.
# File lib/isolate.rb, line 33 def self.sandbox @@sandbox end
Set the singleton. Intended for Hoe::Isolate and other tools that make their own.
# File lib/isolate.rb, line 40 def self.sandbox= o @@sandbox = o end