Remove `config.package.extension` option. Use `config.package.name` instead.

This commit is contained in:
Mitchell Hashimoto 2010-07-24 09:23:55 -07:00
parent 9b6747713e
commit 1cbc60de1c
5 changed files with 11 additions and 9 deletions

View File

@ -44,6 +44,5 @@ Vagrant::Config.run do |config|
# config.vm.sync_script = "/tmp/sync"
# config.vm.sync_crontab_entry_file = "/tmp/crontab-entry"
config.package.name = 'vagrant'
config.package.extension = '.box'
config.package.name = 'package.box'
end

View File

@ -7,7 +7,7 @@ module Vagrant
def initialize(app, env)
@app = app
@env = env
@env["package.output"] ||= "package"
@env["package.output"] ||= env["config"].package.name
@env["package.include"] ||= []
env.error!(:box_file_exists, :output_file => tar_path) if File.exist?(tar_path)
@ -91,7 +91,7 @@ module Vagrant
# Path to the final box output file
def tar_path
File.join(FileUtils.pwd, "#{@env["package.output"]}#{@env.env.config.package.extension}")
File.join(FileUtils.pwd, @env["package.output"])
end
end
end

View File

@ -192,7 +192,6 @@ module Vagrant
class PackageConfig < Base
attr_accessor :name
attr_accessor :extension
end
class VagrantConfig < Base

View File

@ -42,8 +42,7 @@ class Test::Unit::TestCase
config.vm.system = :linux
config.vm.share_folder("v-root", "/vagrant", ".")
config.package.name = 'vagrant'
config.package.extension = '.box'
config.package.name = 'package'
# Unison
config.unison.folder_suffix = ".sync"

View File

@ -31,9 +31,9 @@ class PackageVMActionTest < Test::Unit::TestCase
assert_equal :box_file_exists, @env.error.first
end
should "set the output path to 'package' by default" do
should "set the output path to configured by default" do
@klass.new(@app, @env)
assert_equal "package", @env["package.output"]
assert_equal @env["config"].package.name, @env["package.output"]
end
should "not set the output path if it is already set" do
@ -258,5 +258,10 @@ class PackageVMActionTest < Test::Unit::TestCase
end
end
context "tar path" do
should "return proper path" do
assert_equal File.join(FileUtils.pwd, @env["package.output"]), @instance.tar_path
end
end
end
end