Class Isolate::Sandbox
In: lib/isolate/sandbox.rb
Parent: Object

An isolated environment. This class exposes lifecycle events for extension, see Isolate::Events for more information.

Methods

activate   cleanup?   disable   enabled?   environment   gem   index   legitimize!   multiruby?   new   options   path   system?   verbose?  

Included Modules

Events

Public Class methods

Create a new Isolate::Sandbox instance. See Isolate.now! for the most common use of the API. You probably don‘t want to use this constructor directly. Fires :initializing and :initialized.

Public Instance methods

Activate this set of isolated entries, respecting an optional environment. Points RubyGems to a separate repository, messes with paths, auto-installs gems (if necessary), activates everything, and removes any superfluous gem (again, if necessary). If environment isn‘t specified, ISOLATE_ENV, RAILS_ENV, and RACK_ENV are checked before falling back to "development". Fires :activating and :activated.

Restricts gem calls inside block to a set of environments.

Express a gem dependency. Works pretty much like RubyGems’ gem method, but respects environment and doesn‘t activate ‘til later.

A source index representing only isolated gems.

Returns a list of Gem::Specification instances that 1. exist in the isolated gem path, and 2. are allowed to be there. Used in cleanup. It‘s only an external method ‘cause recursion is easier.

[Validate]