vagrant-prison 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/vagrant/prison/version.rb +1 -1
- data/lib/vagrant/prison.rb +12 -3
- metadata +1 -1
data/lib/vagrant/prison.rb
CHANGED
@@ -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
|
-
|
133
|
+
configure_environment(env_opts)
|
124
134
|
|
125
|
-
|
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
|