chef-zero 5.1.1 → 5.2.0

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: cdca57f2c1f1b6b83c281e4b47b8ddd84fca03eb
4
- data.tar.gz: cfb147366f9d3a05f26855fcb6e33335f484c4e0
3
+ metadata.gz: d3b24181f44a02acb72212f6b506ba88c611aecc
4
+ data.tar.gz: d28e1d99c8803fedf8f1ba9ece631f2ae7829195
5
5
  SHA512:
6
- metadata.gz: 12c4155f7402cdda0364fbb0b09e52249419f50eadd70536089168e05379579e0ab5f40384c4a917ee9b53c10efcad49f1035b36263e05202dcc341e7ae23d40
7
- data.tar.gz: 2ea8061572057a986dc50064a4e81cbcd673e1a7042028f7eda72650a97d6f5d2807f1e85cb3055a4a85af5a0f30123e7c2da3f5d87a54c234bb1d854f5e03b5
6
+ metadata.gz: ccd7ed569ad1958ccaee60cf4acdff8d9ce87b146a6dd5a12f9b9df294122a1e86c183f5501405d92b73d5221d9bcbf0411987b08c8d18e16e4ed67aa9094e48
7
+ data.tar.gz: '00997addd10b1aa6a98d8fca3a3aa084a2926135dc4894014dc0e1a06e403a4030271bd6ca569753b8120124da91056396123ce8f93d63efdf2bae287e7a9ab5'
@@ -29,18 +29,16 @@ module ChefZero
29
29
 
30
30
  def self.metadata_from(directory, name, version, recipe_names)
31
31
  metadata = PretendCookbookMetadata.new(PretendCookbook.new(name, recipe_names))
32
- # If both .rb and .json exist, read .rb
33
- # TODO if recipes has 3 recipes in it, and the Ruby/JSON has only one, should
34
- # the resulting recipe list have 1, or 3-4 recipes in it?
35
- if has_child(directory, "metadata.rb")
32
+ # If both .rb and .json exist, read .json
33
+ if has_child(directory, "metadata.json")
34
+ metadata.from_json(read_file(directory, "metadata.json"))
35
+ elsif has_child(directory, "metadata.rb")
36
36
  begin
37
37
  file = filename(directory, "metadata.rb") || "(#{name}/metadata.rb)"
38
38
  metadata.instance_eval(read_file(directory, "metadata.rb"), file)
39
39
  rescue
40
40
  ChefZero::Log.error("Error loading cookbook #{name}: #{$!}\n #{$!.backtrace.join("\n ")}")
41
41
  end
42
- elsif has_child(directory, "metadata.json")
43
- metadata.from_json(read_file(directory, "metadata.json"))
44
42
  end
45
43
  result = {}
46
44
  metadata.to_hash.each_pair do |key, value|
@@ -16,7 +16,7 @@ module ChefZero
16
16
 
17
17
  def matches_doc?(doc)
18
18
  case @operator
19
- when "-", "NOT"
19
+ when "-", "NOT", "!"
20
20
  !operand.matches_doc?(doc)
21
21
  when "+"
22
22
  # TODO This operator uses relevance to eliminate other, unrelated
@@ -27,7 +27,7 @@ module ChefZero
27
27
 
28
28
  def matches_values?(values)
29
29
  case @operator
30
- when "-", "NOT"
30
+ when "-", "NOT", "!"
31
31
  !operand.matches_values?(values)
32
32
  when "+"
33
33
  # TODO This operator uses relevance to eliminate other, unrelated
@@ -180,7 +180,7 @@ module ChefZero
180
180
  end
181
181
 
182
182
  def unary_operator?(token)
183
- [ "NOT", "+", "-" ].include?(token)
183
+ [ "NOT", "+", "-", "!" ].include?(token)
184
184
  end
185
185
 
186
186
  def binary_operator?(token)
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = "5.1.1"
2
+ VERSION = "5.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-14 00:00:00.000000000 Z
11
+ date: 2017-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  version: '0'
303
303
  requirements: []
304
304
  rubyforge_project:
305
- rubygems_version: 2.6.8
305
+ rubygems_version: 2.6.9
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing