chef-sugar 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/lib/chef/sugar/platform.rb +22 -0
- data/lib/chef/sugar/version.rb +1 -1
- data/metadata.rb +1 -1
- data/spec/unit/chef/sugar/platform_spec.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffd88ed3296573100935f5c32b367c0b358826c3
|
4
|
+
data.tar.gz: 9939836e75d3a827c143aa1de882dc476e63d117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47ab4596120ad672030793e294e2939495b34a853a58972e20b56ae4b55d27dc69aef96dd647f424a992046a37f6e9c2870cd00787efb5a7f8a0536c4f15f056
|
7
|
+
data.tar.gz: 029757c522fd23b773022f59d3230ff7a523cbc9696f292c8abe0f11eff8e34e9c11f66c0b310d8626781ba7bc450f74a26a7b83e0b1db8ed6dab95f3be6955d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@ 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
|
+
v2.2.0 (2014-08-20)
|
6
|
+
-------------------
|
7
|
+
### Improvements
|
8
|
+
- Add `smartos?` matcher
|
9
|
+
- Add `omnios?` matcher
|
10
|
+
|
5
11
|
v2.1.0 (2014-06-26)
|
6
12
|
-------------------
|
7
13
|
### Improvements
|
data/README.md
CHANGED
@@ -275,6 +275,8 @@ node.deep_fetch('apache2', 'config', 'root') => node['apache2']['config']['root'
|
|
275
275
|
- `ubuntu?`
|
276
276
|
- `solaris2?`
|
277
277
|
- `aix?`
|
278
|
+
- `smartos?`
|
279
|
+
- `omnios?`
|
278
280
|
|
279
281
|
There are also a series of dynamically defined matchers that map named operating system release versions and comparison operators in the form "#{platform}\_#{operator}\_#{name}?". For example:
|
280
282
|
|
data/lib/chef/sugar/platform.rb
CHANGED
@@ -26,6 +26,7 @@ class Chef
|
|
26
26
|
'jessie' => '8',
|
27
27
|
},
|
28
28
|
'linuxmint' => {
|
29
|
+
'qiana' => '17',
|
29
30
|
'petra' => '16',
|
30
31
|
'olivia' => '15',
|
31
32
|
'nadia' => '14',
|
@@ -185,6 +186,27 @@ class Chef
|
|
185
186
|
node['platform'] == 'aix'
|
186
187
|
end
|
187
188
|
|
189
|
+
#
|
190
|
+
# Determine if the current node is smartos
|
191
|
+
#
|
192
|
+
# @param [Chef::Node] node
|
193
|
+
#
|
194
|
+
# @return [Boolean]
|
195
|
+
#
|
196
|
+
def smartos?(node)
|
197
|
+
node['platform'] == 'smartos'
|
198
|
+
end
|
199
|
+
|
200
|
+
#
|
201
|
+
# Determine if the current node is omnios
|
202
|
+
#
|
203
|
+
# @param [Chef::Node] node
|
204
|
+
#
|
205
|
+
# @return [Boolean]
|
206
|
+
#
|
207
|
+
def omnios?(node)
|
208
|
+
node['platform'] == 'omnios'
|
209
|
+
end
|
188
210
|
end
|
189
211
|
|
190
212
|
module DSL
|
data/lib/chef/sugar/version.rb
CHANGED
data/metadata.rb
CHANGED
@@ -111,6 +111,30 @@ describe Chef::Sugar::Platform do
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
+
describe '#smartos?' do
|
115
|
+
it 'returns true when the platform is smartos' do
|
116
|
+
node = { 'platform' => 'smartos' }
|
117
|
+
expect(described_class.smartos?(node)).to be_truthy
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'returns false when the platform is not smartos' do
|
121
|
+
node = { 'platform' => 'windows' }
|
122
|
+
expect(described_class.smartos?(node)).to be_falsey
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#omnios?' do
|
127
|
+
it 'returns true when the platform is omnios' do
|
128
|
+
node = { 'platform' => 'omnios' }
|
129
|
+
expect(described_class.omnios?(node)).to be_truthy
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'returns false when the platform is not omnios' do
|
133
|
+
node = { 'platform' => 'windows' }
|
134
|
+
expect(described_class.omnios?(node)).to be_falsey
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
114
138
|
context 'dynamic matchers' do
|
115
139
|
describe '#ubuntu_after_lucid?' do
|
116
140
|
it 'returns true when the version is later than 10.04' do
|
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: 2.
|
4
|
+
version: 2.2.0
|
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-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|