chef-sugar 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88dea16b14233aa2ccce869c337375af3e633620
4
- data.tar.gz: 7ae5046aada8196b1b46b232c8a06df043e77be7
3
+ metadata.gz: e4921a6576cb0835a4c354addd664b79c6f94c69
4
+ data.tar.gz: 8ed52146e75365873ff64693b44d127f19c0f170
5
5
  SHA512:
6
- metadata.gz: 8a96e2a69f606eea91185bbeb053c11a5cdfc45bb7fcaf00c9719ef4fccfbb6fb679c035cdc58caa4a43bd1356870adf280e3b9ee971d3fea3d35f1792443c44
7
- data.tar.gz: 2b4de17fcbbd1bee8096f4edb8790701e0d7d3977a092a7157273c75929d9f3e37972c725ce5c2893720fa7b94aadbf2f148fc0525d67330f026a1595a540b34
6
+ metadata.gz: f75621f0511404674586253794b0633295e1400c75e654b9ed073eb2fe523a813513a2628db89f013e7434a820d41192cef989de0bbc153b9117952ae5ea5234
7
+ data.tar.gz: 6fd194785292ecfaddacadec69f3f65b042d08fe46c1e8594b6133f5140151f632add36e48f72e50dc3a5bad66ef39eaa60dc737ff07a05c16149d1b7e826ae8
@@ -3,4 +3,6 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1
5
5
 
6
+ bundler_args: --jobs 7
7
+
6
8
  script: bundle exec rspec --color --format progress
@@ -2,6 +2,11 @@ Chef Sugar Changelog
2
2
  =========================
3
3
  This file is used to list changes made in each version of the chef-sugar cookbook and gem.
4
4
 
5
+ v1.2.6 (2014-03-16)
6
+ -------------------
7
+ - Fix a bug in `vagrant?` returning false on newer Vagrant versions
8
+ - Remove Coveralls
9
+
5
10
  v1.2.4 (2014-03-13)
6
11
  -------------------
7
12
  - See (1.2.2), but I botched the release
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  Chef::Sugar
2
2
  ================
3
3
  [![Build Status](https://secure.travis-ci.org/sethvargo/chef-sugar.png?branch=master)](http://travis-ci.org/sethvargo/chef-sugar)
4
- [![Coverage
5
- Status](https://coveralls.io/repos/sethvargo/chef-sugar/badge.png?branch=master)](https://coveralls.io/r/sethvargo/chef-sugar?branch=master)
6
4
  [![Gem Version](https://badge.fury.io/rb/chef-sugar.png)](http://badge.fury.io/rb/chef-sugar)
7
5
  [![Dependency Status](https://gemnasium.com/sethvargo/chef-sugar.png)](https://gemnasium.com/sethvargo/chef-sugar)
8
6
  [![Code Climate](https://codeclimate.com/github/sethvargo/chef-sugar.png)](https://codeclimate.com/github/sethvargo/chef-sugar)
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'stove', '~> 2.0.0.beta'
30
30
 
31
31
  spec.add_development_dependency 'chefspec', '~> 3.0'
32
- spec.add_development_dependency 'coveralls', '~> 0.7'
33
32
  spec.add_development_dependency 'test-kitchen', '~> 1.1'
34
33
  spec.add_development_dependency 'kitchen-vagrant', '~> 0.14'
35
34
  end
@@ -29,8 +29,44 @@ class Chef
29
29
  # otherwise
30
30
  #
31
31
  def vagrant?(node)
32
+ vagrant_key?(node) || vagrant_domain?(node) || vagrant_user?(node)
33
+ end
34
+
35
+ private
36
+
37
+ #
38
+ # Check if the +vagrant+ key exists on the +node+ object. This key is no
39
+ # longer populated by vagrant, but it is kept around for legacy purposes.
40
+ #
41
+ # @param (see vagrant?)
42
+ # @return (see vagrant?)
43
+ #
44
+ def vagrant_key?(node)
32
45
  node.key?('vagrant')
33
46
  end
47
+
48
+ #
49
+ # Check if "vagrantup.com" is included in the node's domain. Technically,
50
+ # this would make Chef Sugar falsely detect +vagrant?+ on any of
51
+ # Hashicorp's servers. But if that edge case becomes a serious problem,
52
+ # @mitchellh has my phone number.
53
+ #
54
+ # @param (see vagrant?)
55
+ # @return (see vagrant?)
56
+ #
57
+ def vagrant_domain?(node)
58
+ node['domain'] && node['domain'].include?('vagrantup.com')
59
+ end
60
+
61
+ #
62
+ # Check if the system contains a +vagrant+ user.
63
+ #
64
+ # @param (see vagrant?)
65
+ # @return (see vagrant?)
66
+ #
67
+ def vagrant_user?(node)
68
+ node['etc'] && node['etc']['passwd'] && node['etc']['passwd']['vagrant']
69
+ end
34
70
  end
35
71
 
36
72
  module DSL
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '1.2.4'
19
+ VERSION = '1.2.6'
20
20
  end
21
21
  end
@@ -14,4 +14,4 @@ For the most up-to-date information and documentation, please visit the [Chef
14
14
  Sugar project page on GitHub](https://github.com/sethvargo/chef-sugar).
15
15
  EOH
16
16
 
17
- version '1.2.3'
17
+ version '1.2.6'
@@ -18,7 +18,7 @@
18
18
  #
19
19
 
20
20
  chef_gem('chef-sugar') do
21
- version '1.2.2'
21
+ version '1.2.4'
22
22
  action :nothing
23
23
  end.run_action(:install)
24
24
 
@@ -1,6 +1,3 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
1
  require 'rspec'
5
2
  require 'chefspec'
6
3
  require 'chef/sugar'
@@ -9,6 +9,16 @@ describe Chef::Sugar::Vagrant do
9
9
  expect(described_class.vagrant?(node)).to be_true
10
10
  end
11
11
 
12
+ it 'returns true when the domain is vagrantup.com' do
13
+ node = { 'domain' => 'bacon.vagrantup.com' }
14
+ expect(described_class.vagrant?(node)).to be_true
15
+ end
16
+
17
+ it 'returns true when the vagrant user exists on the system' do
18
+ node = { 'etc' => { 'passwd' => { 'vagrant' => {} } } }
19
+ expect(described_class.vagrant?(node)).to be_true
20
+ end
21
+
12
22
  it 'returns false when the machine is not on vagrant' do
13
23
  node = {}
14
24
  expect(described_class.vagrant?(node)).to be_false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-14 00:00:00.000000000 Z
11
+ date: 2014-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- - !ruby/object:Gem::Dependency
70
- name: coveralls
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.7'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.7'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: test-kitchen
85
71
  requirement: !ruby/object:Gem::Requirement