berkshelf-vagrant 1.1.0 → 1.1.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.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.1.0
2
+ - Plugin defaults to disabled. Set 'config.berkshelf.enabled = true' in Vagrant config
3
+
1
4
  # 1.0.0
2
5
  - Separated Berkshelf Vagrant plugin into it's own gem (this one)
3
6
  - Support Vagrant 1.1.x
@@ -2,8 +2,6 @@ module Berkshelf
2
2
  module Vagrant
3
3
  # @author Jamie Winsor <reset@riotgames.com>
4
4
  class Config < ::Vagrant.plugin("2", :config)
5
- include Berkshelf::Vagrant::EnvHelpers
6
-
7
5
  # @return [String]
8
6
  # path to the Berksfile to use with Vagrant
9
7
  attr_reader :berksfile_path
@@ -75,7 +73,7 @@ module Berkshelf
75
73
  errors << "A value for berkshelf.empty and berkshelf.only cannot both be defined."
76
74
  end
77
75
 
78
- if chef_client?(machine.env)
76
+ if machine.env.config_global.vm.provisioners.any? { |prov| prov.name == :chef_client }
79
77
  if machine.config.berkshelf.node_name.nil?
80
78
  errors << "A configuration must be set for chef.node_name when using the chef_client provisioner. Run 'berks configure' or edit your configuration."
81
79
  end
@@ -14,7 +14,11 @@ module Berkshelf
14
14
  attr_accessor :config
15
15
 
16
16
  def initialize
17
- @ui = ::Vagrant::UI::Colored.new('Berkshelf')
17
+ if Gem::Version.new(::Vagrant::VERSION) >= Gem::Version.new("1.2")
18
+ @ui = ::Vagrant::UI::Colored.new.scope('Berkshelf')
19
+ else
20
+ @ui = ::Vagrant::UI::Colored.new('Berkshelf')
21
+ end
18
22
  @config = Berkshelf::Config.instance
19
23
  end
20
24
  end
@@ -21,9 +21,7 @@ module Berkshelf
21
21
  #
22
22
  # @return [Array]
23
23
  def provisioners(name, env)
24
- config_global = env.respond_to?(:config_global) ? env.config_global : env[:global_config]
25
-
26
- config_global.vm.provisioners.select { |prov| prov.name == name }
24
+ env[:machine].config.vm.provisioners.select { |prov| prov.name == name }
27
25
  end
28
26
 
29
27
  # Determine if the given vagrant environment contains a chef_solo provisioner
@@ -1,5 +1,5 @@
1
1
  module Berkshelf
2
2
  module Vagrant
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
@@ -42,7 +42,7 @@ describe Berkshelf::Vagrant::Config do
42
42
  context "when the plugin is enabled" do
43
43
  before(:each) do
44
44
  subject.stub(enabled: true)
45
- subject.should_receive(:chef_client?).with(env).and_return(true)
45
+ env.stub_chain(:config_global, :vm, :provisioners, :any?)
46
46
  end
47
47
 
48
48
  let(:result) { subject.validate(machine) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.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-04-11 00:00:00.000000000 Z
12
+ date: 2013-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: berkshelf
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  version: '0'
241
241
  segments:
242
242
  - 0
243
- hash: -2045934776218572655
243
+ hash: -547127228269075134
244
244
  requirements: []
245
245
  rubyforge_project:
246
246
  rubygems_version: 1.8.23