vagrant-chef-zero 0.5.1 → 0.5.2

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.
@@ -1,3 +1,9 @@
1
+ ## 0.5.2
2
+
3
+ Update `net-ssh` dependency to work with the newest version of Vagrant 1.4. Thanks to @paulczar
4
+
5
+ * Search for the Chef-Zero gem inside of Vagrant first, then fall back to searching other gem paths. Mostly a fix to make testing easier.
6
+
1
7
  ## 0.5.1
2
8
 
3
9
  Minor bugfixes (hopefully) to fix installation behavior and berkshelf issues.
@@ -1,8 +1,8 @@
1
1
  Vagrant.require_plugin "vagrant-chef-zero"
2
- Vagrant.require_plugin "vagrant-berkshelf"
2
+ #Vagrant.require_plugin "vagrant-berkshelf"
3
3
 
4
4
  Vagrant.configure("2") do |config|
5
- config.berkshelf.enabled = true
5
+ # config.berkshelf.enabled = true
6
6
  config.chef_zero.chef_repo_path = "spec/vagrant-chef-zero/fixtures/"
7
7
  #config.chef_zero.nodes = "spec/vagrant-chef-zero/fixtures/nodes"
8
8
  #config.chef_zero.environments = "spec/vagrant-chef-zero/fixtures/environments"
@@ -11,17 +11,10 @@ Vagrant.configure("2") do |config|
11
11
  #config.chef_zero.roles = "foobar"
12
12
 
13
13
  # Single Box Config
14
- config.vm.box = ENV['YIPIT_VAGRANT_BOX']
14
+ config.vm.box = "precise64"
15
15
  config.vm.provision :chef_client do |chef|
16
16
  chef.run_list = [
17
17
  ]
18
18
  end
19
19
 
20
- # config.vm.define :box1 do |box1|
21
- # box1.vm.box = ENV['YIPIT_VAGRANT_BOX']
22
- # end
23
-
24
- # config.vm.define :box2 do |box2|
25
- # box2.vm.box = ENV['YIPIT_VAGRANT_BOX']
26
- # end
27
20
  end
@@ -9,13 +9,50 @@ module VagrantPlugins
9
9
  host = get_host(env)
10
10
 
11
11
  unless chef_zero_server_running?(host, port)
12
- vagrant_gems = ENV['GEM_PATH'].split(':').select { |gp| gp.include?('vagrant.d')}.first
13
- chef_zero_binary = ::File.join(vagrant_gems, "bin", "chef-zero")
12
+ chef_zero_binary = get_chef_zero_binary(env)
14
13
  fork_process(chef_zero_binary, host, port, env)
15
14
  wait_for_server_to_start(host, port, env)
16
15
  end
17
16
  end
18
17
 
18
+ def get_chef_zero_binary(env)
19
+ # We want to prefer the vagrant.d path, but for development
20
+ # we want to find any valid path that has chef-zero
21
+ paths = Gem.path
22
+ vagrant_path = paths.select { |gp| gp.include?('vagrant.d')}.first
23
+ if has_chef_zero_binary?(vagrant_path)
24
+ return find_chef_zero_binary(vagrant_path)
25
+ end
26
+ paths.each do |path|
27
+ if has_chef_zero_binary?(path)
28
+ return find_chef_zero_binary(path)
29
+ end
30
+ end
31
+ env[:chef_zero].ui.warn("Could not find Chef Zero binary in any path in #{Gem.path}")
32
+ raise
33
+ end
34
+
35
+ def has_chef_zero_binary?(path)
36
+ potential_binary = find_chef_zero_binary(path)
37
+ if potential_binary
38
+ return ::File.exists?(potential_binary)
39
+ else
40
+ return false
41
+ end
42
+ end
43
+
44
+ def find_chef_zero_binary(path)
45
+ # Assuming a path from Gem.path
46
+ #potential_binary = ::File.join(path, "bin", "chef-zero")
47
+ gems_path = ::File.join(path, "gems")
48
+ chef_zero_gem = Dir["#{gems_path}/*"].select { |gp| gp.include?('chef-zero')}.first
49
+ if chef_zero_gem
50
+ return ::File.join(chef_zero_gem, "bin", "chef-zero")
51
+ else
52
+ return nil
53
+ end
54
+ end
55
+
19
56
  def fork_process(command, host, port, env)
20
57
  IO.popen("#{command} --host #{host} --port #{port} 2>&1 > /dev/null")
21
58
  env[:chef_zero].ui.info("Starting Chef Zero at http://#{host}:#{port}")
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module ChefZero
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
 
27
27
  # Explicit locks to ensure we activate the proper gem versions for Vagrant
28
28
  s.add_dependency 'i18n', '~> 0.6.0'
29
- s.add_dependency 'net-ssh', '~> 2.6.6'
29
+ s.add_dependency "net-ssh", ">= 2.6.6", "< 2.8.0"
30
30
  s.add_dependency 'net-scp', '~> 1.1.0'
31
31
 
32
32
  s.add_development_dependency "mocha"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-03 00:00:00.000000000 Z
12
+ date: 2013-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -124,17 +124,23 @@ dependencies:
124
124
  requirement: !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements:
127
- - - ~>
127
+ - - ! '>='
128
128
  - !ruby/object:Gem::Version
129
129
  version: 2.6.6
130
+ - - <
131
+ - !ruby/object:Gem::Version
132
+ version: 2.8.0
130
133
  type: :runtime
131
134
  prerelease: false
132
135
  version_requirements: !ruby/object:Gem::Requirement
133
136
  none: false
134
137
  requirements:
135
- - - ~>
138
+ - - ! '>='
136
139
  - !ruby/object:Gem::Version
137
140
  version: 2.6.6
141
+ - - <
142
+ - !ruby/object:Gem::Version
143
+ version: 2.8.0
138
144
  - !ruby/object:Gem::Dependency
139
145
  name: net-scp
140
146
  requirement: !ruby/object:Gem::Requirement
@@ -237,8 +243,7 @@ files:
237
243
  - lib/vagrant-chef-zero.rb
238
244
  - LICENSE.txt
239
245
  - Makefile
240
- - pkg/vagrant-chef-zero-0.4.2.gem
241
- - pkg/vagrant-chef-zero-0.5.0.gem
246
+ - pkg/vagrant-chef-zero-0.5.2.gem
242
247
  - Rakefile
243
248
  - README.md
244
249
  - spec/lib/config_spec.rb
@@ -267,8 +272,6 @@ files:
267
272
  - Vagrantfile
268
273
  - .gitignore
269
274
  - .travis.yml
270
- - coverage/.last_run.json
271
- - coverage/.resultset.json
272
275
  homepage: http://github.com/andrewgross/vagrant-chef-zero
273
276
  licenses:
274
277
  - MIT
@@ -284,7 +287,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
287
  version: '0'
285
288
  segments:
286
289
  - 0
287
- hash: 3035003433799121851
290
+ hash: 1041665802502836510
288
291
  required_rubygems_version: !ruby/object:Gem::Requirement
289
292
  none: false
290
293
  requirements: