vagrant-prison 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  class Prison
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -6,6 +6,7 @@ require 'tempfile'
6
6
  require 'erb'
7
7
 
8
8
  Vagrant::Prison::Vagrantfile = <<-EOF
9
+ require 'vagrant/prison'
9
10
  dumped_config = <%= @config.inspect %>
10
11
 
11
12
  Vagrant::Config.run do |config|
@@ -100,6 +101,15 @@ class Vagrant::Prison
100
101
  end
101
102
  end
102
103
 
104
+ #
105
+ # Configures the environment. Useful if you wish to open a prison without
106
+ # re-creating it.
107
+ #
108
+ def configure_environment(env_opts={})
109
+ @env_opts ||= env_opts.merge(:cwd => dir)
110
+ @env ||= Vagrant::Environment.new(@env_opts)
111
+ end
112
+
103
113
  #
104
114
  # Construct the sandbox. This:
105
115
  #
@@ -120,10 +130,9 @@ class Vagrant::Prison
120
130
  @initial_config
121
131
  end
122
132
 
123
- File.binwrite(File.join(dir, "Vagrantfile"), to_write)
133
+ configure_environment(env_opts)
124
134
 
125
- @env_opts = env_opts.merge(:cwd => dir)
126
- @env = Vagrant::Environment.new(@env_opts)
135
+ File.binwrite(File.join(dir, "Vagrantfile"), to_write)
127
136
 
128
137
  if @cleanup_on_exit
129
138
  # clean up after garbage collection or if the system exits
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-prison
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: