Class: SandBox
- Inherits:
-
Object
- Object
- SandBox
- Defined in:
- lib/pangea/sandbox.rb
Instance Method Summary collapse
- #clean_sandbox ⇒ Object
-
#initialize(name:, base_dir: %(~/.pangea/sandbox), rubies: []) ⇒ SandBox
constructor
A new instance of SandBox.
- #prepare_sandbox ⇒ Object
Constructor Details
#initialize(name:, base_dir: %(~/.pangea/sandbox), rubies: []) ⇒ SandBox
Returns a new instance of SandBox.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pangea/sandbox.rb', line 23 def initialize( name:, base_dir: %(~/.pangea/sandbox), rubies: [] ) @base_dir = base_dir @name = name @rubies = rubies @rubies_dir = File.join(@base_dir, @name, %(rubies)) @ruby_build_cmd = %(ruby-build) end |
Instance Method Details
#clean_sandbox ⇒ Object
44 45 46 |
# File 'lib/pangea/sandbox.rb', line 44 def clean_sandbox system %(rm -rf #{base_dir}) end |
#prepare_sandbox ⇒ Object
37 38 39 40 41 42 |
# File 'lib/pangea/sandbox.rb', line 37 def prepare_sandbox ensure_base_dir_exists ensure_rubies_directories_exist check_ruby_build_installed ensure_rubies_installed end |