Config::Loader will be the new class responsible for loading configuration and replaces the previous dual-role "Vagrant::Config" played. While this commit is very early-stage, once this new architecture is flushed out, it will make loading, using, and extending configuration much easier and cleaner. Additionally, I believe this will help post Vagrant 1.0 if multi-language configuration is implemented.
17 lines
313 B
Ruby
17 lines
313 B
Ruby
require "tempfile"
|
|
|
|
shared_context "unit" do
|
|
# This helper creates a temporary file and returns a Pathname
|
|
# object pointed to it.
|
|
def temporary_file(contents=nil)
|
|
f = Tempfile.new("vagrant-unit")
|
|
|
|
if contents
|
|
f.write(contents)
|
|
f.flush
|
|
end
|
|
|
|
return Pathname.new(f.path)
|
|
end
|
|
end
|