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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +5 -0
- data/README.md +0 -2
- data/chef-sugar.gemspec +0 -1
- data/lib/chef/sugar/vagrant.rb +36 -0
- data/lib/chef/sugar/version.rb +1 -1
- data/metadata.rb +1 -1
- data/recipes/default.rb +1 -1
- data/spec/spec_helper.rb +0 -3
- data/spec/unit/chef/sugar/vagrant_spec.rb +10 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4921a6576cb0835a4c354addd664b79c6f94c69
|
4
|
+
data.tar.gz: 8ed52146e75365873ff64693b44d127f19c0f170
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75621f0511404674586253794b0633295e1400c75e654b9ed073eb2fe523a813513a2628db89f013e7434a820d41192cef989de0bbc153b9117952ae5ea5234
|
7
|
+
data.tar.gz: 6fd194785292ecfaddacadec69f3f65b042d08fe46c1e8594b6133f5140151f632add36e48f72e50dc3a5bad66ef39eaa60dc737ff07a05c16149d1b7e826ae8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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)
|
data/chef-sugar.gemspec
CHANGED
@@ -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
|
data/lib/chef/sugar/vagrant.rb
CHANGED
@@ -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
|
data/lib/chef/sugar/version.rb
CHANGED
data/metadata.rb
CHANGED
data/recipes/default.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -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
|
+
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-
|
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
|