vagrant 0.2.0.pre → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source :gemcutter
2
2
 
3
3
  # Gems required for the lib to even run
4
- gem "virtualbox", ">= 0.5.2"
4
+ gem "virtualbox", ">= 0.5.3"
5
5
  gem "net-ssh", ">= 2.0.19"
6
6
  gem "net-scp", ">= 1.0.2"
7
7
  gem "git-style-binaries", ">= 0.1.10"
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gemspec.homepage = "http://github.com/mitchellh/vagrant"
11
11
  gemspec.authors = ["Mitchell Hashimoto", "John Bender"]
12
12
 
13
- gemspec.add_dependency('virtualbox', '>= 0.5.2')
13
+ gemspec.add_dependency('virtualbox', '>= 0.5.3')
14
14
  gemspec.add_dependency('net-ssh', '>= 2.0.19')
15
15
  gemspec.add_dependency('net-scp', '>= 1.0.2')
16
16
  gemspec.add_dependency('json', '>= 1.2.0')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0.pre
1
+ 0.2.0
@@ -9,7 +9,7 @@ end
9
9
  require 'git-style-binary/command'
10
10
 
11
11
  GitStyleBinary.primary do
12
- version "0.1.4"
12
+ version "0.2.0"
13
13
 
14
14
  run { educate }
15
15
  end
@@ -26,6 +26,9 @@ module Vagrant
26
26
  end
27
27
 
28
28
  raise ActionException.new("Unknown URI type for box download.") unless @downloader
29
+
30
+ # Prepare the downloader
31
+ @downloader.prepare(@runner.uri)
29
32
  end
30
33
 
31
34
  def execute!
@@ -5,6 +5,9 @@ module Vagrant
5
5
  class Base
6
6
  include Vagrant::Util
7
7
 
8
+ # Called prior to execution so any error checks can be done
9
+ def prepare(source_url); end
10
+
8
11
  # Downloads the source file to the destination file. It is up to
9
12
  # implementors of this class to handle the logic.
10
13
  def download!(source_url, destination_file); end
@@ -3,6 +3,16 @@ module Vagrant
3
3
  # "Downloads" a file to a temporary file. Basically, this downloader
4
4
  # simply does a file copy.
5
5
  class File < Base
6
+ def prepare(source_url)
7
+ if !::File.file?(source_url)
8
+ raise Actions::ActionException.new(<<-msg)
9
+ The given box does not exist on the file system:
10
+
11
+ #{source_url}
12
+ msg
13
+ end
14
+ end
15
+
6
16
  def download!(source_url, destination_file)
7
17
  FileUtils.cp(source_url, destination_file.path)
8
18
  end
@@ -16,6 +16,10 @@ class DownloadBoxActionTest < Test::Unit::TestCase
16
16
  @uri = mock("uri")
17
17
  @uri.stubs(:is_a?).returns(false)
18
18
  URI.stubs(:parse).returns(@uri)
19
+
20
+ @downloader = mock("downloader")
21
+ Vagrant::Downloaders::File.any_instance.stubs(:prepare)
22
+ Vagrant::Downloaders::HTTP.any_instance.stubs(:prepare)
19
23
  end
20
24
 
21
25
  should "raise an exception if no URI type is matched" do
@@ -25,6 +29,13 @@ class DownloadBoxActionTest < Test::Unit::TestCase
25
29
  }
26
30
  end
27
31
 
32
+ should "call #prepare on the downloader" do
33
+ @downloader.expects(:prepare).with(@runner.uri).once
34
+ Vagrant::Downloaders::File.expects(:new).returns(@downloader)
35
+ @uri.stubs(:is_a?).with(URI::Generic).returns(true)
36
+ @action.prepare
37
+ end
38
+
28
39
  should "set the downloader to file if URI is generic" do
29
40
  @uri.stubs(:is_a?).with(URI::Generic).returns(true)
30
41
  @action.prepare
@@ -11,6 +11,13 @@ class BaseDownloaderTest < Test::Unit::TestCase
11
11
  end
12
12
 
13
13
  should "implement prepare which does nothing" do
14
+ assert_nothing_raised do
15
+ assert @base.respond_to?(:prepare)
16
+ @base.prepare("source")
17
+ end
18
+ end
19
+
20
+ should "implement download! which does nothing" do
14
21
  assert_nothing_raised do
15
22
  assert @base.respond_to?(:download!)
16
23
  @base.download!("source", "destination")
@@ -6,6 +6,15 @@ class FileDownloaderTest < Test::Unit::TestCase
6
6
  @uri = "foo.box"
7
7
  end
8
8
 
9
+ context "preparing" do
10
+ should "raise an exception if the file does not exist" do
11
+ File.expects(:file?).with(@uri).returns(false)
12
+ assert_raises(Vagrant::Actions::ActionException) {
13
+ @downloader.prepare(@uri)
14
+ }
15
+ end
16
+ end
17
+
9
18
  context "downloading" do
10
19
  should "cp the file" do
11
20
  path = '/path'
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vagrant}
8
- s.version = "0.2.0.pre"
8
+ s.version = "0.2.0"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mitchell Hashimoto", "John Bender"]
12
- s.date = %q{2010-03-15}
12
+ s.date = %q{2010-03-16}
13
13
  s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.}
14
14
  s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]
15
15
  s.executables = ["vagrant", "vagrant-box", "vagrant-down", "vagrant-halt", "vagrant-init", "vagrant-package", "vagrant-reload", "vagrant-resume", "vagrant-ssh", "vagrant-status", "vagrant-suspend", "vagrant-up"]
@@ -183,14 +183,14 @@ Gem::Specification.new do |s|
183
183
  s.specification_version = 3
184
184
 
185
185
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
186
- s.add_runtime_dependency(%q<virtualbox>, [">= 0.5.2"])
186
+ s.add_runtime_dependency(%q<virtualbox>, [">= 0.5.3"])
187
187
  s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.19"])
188
188
  s.add_runtime_dependency(%q<net-scp>, [">= 1.0.2"])
189
189
  s.add_runtime_dependency(%q<json>, [">= 1.2.0"])
190
190
  s.add_runtime_dependency(%q<git-style-binaries>, [">= 0.1.10"])
191
191
  s.add_runtime_dependency(%q<archive-tar-minitar>, ["= 0.5.2"])
192
192
  else
193
- s.add_dependency(%q<virtualbox>, [">= 0.5.2"])
193
+ s.add_dependency(%q<virtualbox>, [">= 0.5.3"])
194
194
  s.add_dependency(%q<net-ssh>, [">= 2.0.19"])
195
195
  s.add_dependency(%q<net-scp>, [">= 1.0.2"])
196
196
  s.add_dependency(%q<json>, [">= 1.2.0"])
@@ -198,7 +198,7 @@ Gem::Specification.new do |s|
198
198
  s.add_dependency(%q<archive-tar-minitar>, ["= 0.5.2"])
199
199
  end
200
200
  else
201
- s.add_dependency(%q<virtualbox>, [">= 0.5.2"])
201
+ s.add_dependency(%q<virtualbox>, [">= 0.5.3"])
202
202
  s.add_dependency(%q<net-ssh>, [">= 2.0.19"])
203
203
  s.add_dependency(%q<net-scp>, [">= 1.0.2"])
204
204
  s.add_dependency(%q<json>, [">= 1.2.0"])
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
8
  - 0
9
- - pre
10
- version: 0.2.0.pre
9
+ version: 0.2.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Mitchell Hashimoto
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-03-15 00:00:00 -07:00
18
+ date: 2010-03-16 00:00:00 -07:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -29,8 +28,8 @@ dependencies:
29
28
  segments:
30
29
  - 0
31
30
  - 5
32
- - 2
33
- version: 0.5.2
31
+ - 3
32
+ version: 0.5.3
34
33
  type: :runtime
35
34
  version_requirements: *id001
36
35
  - !ruby/object:Gem::Dependency
@@ -253,13 +252,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
252
  version: "0"
254
253
  required_rubygems_version: !ruby/object:Gem::Requirement
255
254
  requirements:
256
- - - ">"
255
+ - - ">="
257
256
  - !ruby/object:Gem::Version
258
257
  segments:
259
- - 1
260
- - 3
261
- - 1
262
- version: 1.3.1
258
+ - 0
259
+ version: "0"
263
260
  requirements: []
264
261
 
265
262
  rubyforge_project: