halite 1.0.13 → 1.1.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +11 -0
- data/lib/halite/converter/metadata.rb +1 -0
- data/lib/halite/spec_helper.rb +3 -0
- data/lib/halite/spec_helper/runner.rb +4 -0
- data/lib/halite/version.rb +1 -1
- data/spec/converter/metadata_spec.rb +20 -2
- data/spec/fixtures/cookbooks/test1/metadata.rb +1 -0
- data/spec/fixtures/cookbooks/test2/metadata.rb +1 -0
- data/spec/fixtures/cookbooks/test3/metadata.rb +1 -0
- data/spec/spec_helper_spec.rb +1 -1
- 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: 35d989833c7bbf082dd1025c03c64fd7fa678f5c
|
4
|
+
data.tar.gz: a8b72aea467f681b63a5a35de73323811b5be3a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b2904e09a894cd47f2e74a919c88749958edbc6c9cf158b6d5ba5b435aea7d7ce61e923434018872c2ea81348f41b7b35c21fa23ff7bb812fd8d402fda8e463
|
7
|
+
data.tar.gz: 18615c97d14307608a9ebf8f6fde591e3543ee65e9257001eaa17a498f5f042431e5b99b19f681a66763cb4454a0c96ac34de1d4a5e4d3829decb97781ce8e6a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Halite Changelog
|
2
2
|
|
3
|
+
## v1.1.0
|
4
|
+
|
5
|
+
* Support the new `chef_version` metadata field through gem metadata. Defaults
|
6
|
+
to `~> 12` for now.
|
7
|
+
* Make spec helper resources look more like normal Chef resources when in auto
|
8
|
+
mode.
|
9
|
+
* Add Halite's synthetic cookbooks to the cookbook compiler too, for
|
10
|
+
include_recipe and friends.
|
11
|
+
|
3
12
|
## v1.0.13
|
4
13
|
|
5
14
|
* Additional cookbook metadata to work with Foodcritic 5.1.
|
data/README.md
CHANGED
@@ -48,6 +48,17 @@ automatically converted to cookbook dependencies.
|
|
48
48
|
Any files under `chef/` in the gem will be written as is in to the cookbook.
|
49
49
|
For example you can add a recipe to your gem via `chef/recipes/default.rb`.
|
50
50
|
|
51
|
+
## Chef Version
|
52
|
+
|
53
|
+
By default cookbooks will be generated with `chef_version '~> 12'` to require
|
54
|
+
Chef 12.x. This can be overridden using the `halite_chef_version` metadata field:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
Gem::Specification.new do |spec|
|
58
|
+
spec.metadata['halite_dependencies'] = '>= 12.0.0'
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
51
62
|
## Rake Tasks
|
52
63
|
|
53
64
|
The `halite/rake_tasks` module provides quick defaults. Gem name will be
|
data/lib/halite/spec_helper.rb
CHANGED
@@ -75,6 +75,10 @@ module Halite
|
|
75
75
|
gem_data.cookbook_dependencies.each do |dep|
|
76
76
|
add_halite_cookbooks(node, dep.spec) if dep.spec
|
77
77
|
end
|
78
|
+
# Add to the compiler for RunContext#unreachable_cookbook?
|
79
|
+
cookbook_order = run_context.instance_variable_get(:@cookbook_compiler).cookbook_order
|
80
|
+
name_sym = gem_data.cookbook_name.to_sym
|
81
|
+
cookbook_order << name_sym unless cookbook_order.include?(name_sym)
|
78
82
|
# Load attributes if any.
|
79
83
|
gem_data.each_file('chef/attributes') do |_full_path, rel_path|
|
80
84
|
raise Halite::Error.new("Chef does not support nested attribute files: #{rel_path}") if rel_path.include?(File::SEPARATOR)
|
data/lib/halite/version.rb
CHANGED
@@ -23,6 +23,7 @@ describe Halite::Converter::Metadata do
|
|
23
23
|
let(:version) { '1.0.0' }
|
24
24
|
let(:cookbook_version) { version }
|
25
25
|
let(:cookbook_dependencies) { [] }
|
26
|
+
let(:gem_metadata) { {} }
|
26
27
|
let(:spec) do
|
27
28
|
instance_double('Gem::Specification',
|
28
29
|
author: nil,
|
@@ -32,6 +33,7 @@ describe Halite::Converter::Metadata do
|
|
32
33
|
homepage: nil,
|
33
34
|
license: nil,
|
34
35
|
licenses: [],
|
36
|
+
metadata: gem_metadata,
|
35
37
|
)
|
36
38
|
end
|
37
39
|
let(:gem_data) do
|
@@ -52,6 +54,7 @@ describe Halite::Converter::Metadata do
|
|
52
54
|
it { is_expected.to eq <<-EOH }
|
53
55
|
name "mygem"
|
54
56
|
version "1.0.0"
|
57
|
+
chef_version "~> 12" if defined?(chef_version)
|
55
58
|
EOH
|
56
59
|
end # /context with simple data
|
57
60
|
|
@@ -63,6 +66,7 @@ EOH
|
|
63
66
|
# header
|
64
67
|
name "mygem"
|
65
68
|
version "1.0.0"
|
69
|
+
chef_version "~> 12" if defined?(chef_version)
|
66
70
|
EOH
|
67
71
|
end # /context with a license header
|
68
72
|
|
@@ -72,6 +76,7 @@ EOH
|
|
72
76
|
name "mygem"
|
73
77
|
version "1.0.0"
|
74
78
|
depends "other"
|
79
|
+
chef_version "~> 12" if defined?(chef_version)
|
75
80
|
EOH
|
76
81
|
end # /context with one dependency
|
77
82
|
|
@@ -82,6 +87,7 @@ name "mygem"
|
|
82
87
|
version "1.0.0"
|
83
88
|
depends "other", "~> 1.0"
|
84
89
|
depends "another", "~> 2.0.0"
|
90
|
+
chef_version "~> 12" if defined?(chef_version)
|
85
91
|
EOH
|
86
92
|
end # /context with two dependencies
|
87
93
|
|
@@ -94,6 +100,7 @@ EOH
|
|
94
100
|
name "mygem"
|
95
101
|
version "1.0.0"
|
96
102
|
description "My awesome library!"
|
103
|
+
chef_version "~> 12" if defined?(chef_version)
|
97
104
|
EOH
|
98
105
|
end # /context with a description
|
99
106
|
|
@@ -103,12 +110,23 @@ EOH
|
|
103
110
|
allow(IO).to receive(:read).with('/source/README.md').and_return("My awesome readme!\nCopyright me.\n")
|
104
111
|
end
|
105
112
|
|
106
|
-
it { is_expected.to eq <<-
|
113
|
+
it { is_expected.to eq <<-EOH }
|
107
114
|
name "mygem"
|
108
115
|
version "1.0.0"
|
109
|
-
long_description "My awesome readme
|
116
|
+
long_description "My awesome readme!\\nCopyright me.\\n"
|
117
|
+
chef_version "~> 12" if defined?(chef_version)
|
110
118
|
EOH
|
111
119
|
end # /context with a readme
|
120
|
+
|
121
|
+
context 'with a chef_version' do
|
122
|
+
let(:gem_metadata) { {'halite_chef_version' => '>= 0'} }
|
123
|
+
|
124
|
+
it { is_expected.to eq <<-EOH }
|
125
|
+
name "mygem"
|
126
|
+
version "1.0.0"
|
127
|
+
chef_version ">= 0" if defined?(chef_version)
|
128
|
+
EOH
|
129
|
+
end # /context with a chef_version
|
112
130
|
end # /describe #generate
|
113
131
|
|
114
132
|
describe '#write' do
|
data/spec/spec_helper_spec.rb
CHANGED
@@ -59,7 +59,7 @@ describe Halite::SpecHelper do
|
|
59
59
|
it { is_expected.to be < Chef::Resource }
|
60
60
|
its(:resource_name) { is_expected.to eq :halite_test } if defined?(Chef::Resource.resource_name)
|
61
61
|
it { expect(subject.new(nil, nil).resource_name).to eq(:halite_test) }
|
62
|
-
it { expect(subject.new(nil, nil).action).to eq(:run) }
|
62
|
+
it { expect(Array(subject.new(nil, nil).action)).to eq([:run]) }
|
63
63
|
it { expect(subject.new(nil, nil).allowed_actions).to eq([:nothing, :run]) }
|
64
64
|
end # /context with defaults
|
65
65
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Kantrowitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|