halite 1.0.9 → 1.0.10
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 +5 -0
- data/lib/halite/rake_helper.rb +26 -16
- data/lib/halite/spec_helper/runner.rb +16 -14
- data/lib/halite/version.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: bfddd38f30a6b70f4d5c636a50311acc6a6c2268
|
4
|
+
data.tar.gz: d6d37b99036f8f509c850f09b18ce6a2d0a0f4a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40e107d045a947e952122a4120f9531cbb2ca0e19dd13935a6aaa7ba0e1f945102ccaf6656d5f9d70cc9b656238cfc32ba9ef6188c0a1f013f0d747d6d7036f0
|
7
|
+
data.tar.gz: c80e0e7c0a7fe6ef816cd6eac1fc8c272432a17d1031dacd7ced3d2a7f1d9af0920eb07527c86906856418c1a8e2e34777d16644e8a330704ee760f4e6b9fe32
|
data/CHANGELOG.md
CHANGED
data/lib/halite/rake_helper.rb
CHANGED
@@ -37,20 +37,25 @@ module Halite
|
|
37
37
|
def install
|
38
38
|
extend Rake::DSL
|
39
39
|
# Core Halite tasks
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
unless options[:no_gem]
|
41
|
+
desc "Convert #{gemspec.name}-#{gemspec.version} to a cookbook in the pkg directory"
|
42
|
+
task 'chef:build' do
|
43
|
+
build_cookbook
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
desc "Push #{gemspec.name}-#{gemspec.version} to Supermarket"
|
47
|
+
task 'chef:release' => ['chef:build'] do
|
48
|
+
release_cookbook(pkg_path)
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
unless options[:no_gem]
|
51
|
+
# Patch the core gem tasks to run ours too
|
52
52
|
task 'build' => ['chef:build']
|
53
53
|
task 'release' => ['chef:release']
|
54
|
+
else
|
55
|
+
desc "Push #{gem_name} to Supermarket"
|
56
|
+
task 'chef:release' do
|
57
|
+
release_cookbook(base)
|
58
|
+
end
|
54
59
|
end
|
55
60
|
|
56
61
|
# Foodcritic doesn't have a config file, so just always try to add it.
|
@@ -75,9 +80,14 @@ module Halite
|
|
75
80
|
|
76
81
|
desc 'Run Foodcritic linter'
|
77
82
|
task 'chef:foodcritic' do
|
78
|
-
|
79
|
-
|
80
|
-
sh(
|
83
|
+
foodcritic_cmd = "foodcritic --chef-version #{Chef::VERSION} --epic-fail any --tags ~FC054 '%{path}'"
|
84
|
+
if options[:no_gem]
|
85
|
+
sh(foodcritic_cmd % {path: base})
|
86
|
+
else
|
87
|
+
Dir.mktmpdir('halite_test') do |path|
|
88
|
+
Halite.convert(gemspec, path)
|
89
|
+
sh(foodcritic_cmd % {path: path})
|
90
|
+
end
|
81
91
|
end
|
82
92
|
end
|
83
93
|
|
@@ -111,10 +121,10 @@ module Halite
|
|
111
121
|
shell.say("#{gemspec.name} #{gemspec.version} converted to pkg/#{gemspec.name}-#{gemspec.version}/.", :green)
|
112
122
|
end
|
113
123
|
|
114
|
-
def release_cookbook
|
115
|
-
Dir.chdir(
|
124
|
+
def release_cookbook(path)
|
125
|
+
Dir.chdir(path) do
|
116
126
|
sh('stove --no-git')
|
117
|
-
shell.say("Pushed #{gemspec.name} #{gemspec.version} to supermarket.chef.io.", :green)
|
127
|
+
shell.say("Pushed #{gemspec.name} #{gemspec.version} to supermarket.chef.io.", :green) unless options[:no_gem]
|
118
128
|
end
|
119
129
|
end
|
120
130
|
|
@@ -56,7 +56,7 @@ module Halite
|
|
56
56
|
def converge(*recipe_names, &block)
|
57
57
|
raise Halite::Error.new('Cannot pass both recipe names and a recipe block to converge') if !recipe_names.empty? && block
|
58
58
|
super(*recipe_names) do
|
59
|
-
|
59
|
+
add_halite_cookbooks(node, @halite_gemspec) if @halite_gemspec
|
60
60
|
if block
|
61
61
|
recipe = Chef::Recipe.new(nil, nil, run_context)
|
62
62
|
recipe.instance_exec(&block)
|
@@ -66,19 +66,21 @@ module Halite
|
|
66
66
|
|
67
67
|
private
|
68
68
|
|
69
|
-
def
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
69
|
+
def add_halite_cookbooks(node, gemspecs)
|
70
|
+
Array(gemspecs).each do |gemspec|
|
71
|
+
gem_data = Halite::Gem.new(gemspec)
|
72
|
+
# Catch any dependency loops.
|
73
|
+
next if run_context.cookbook_collection.include?(gem_data.cookbook_name) && run_context.cookbook_collection[gem_data.cookbook_name].respond_to?(:halite_root)
|
74
|
+
run_context.cookbook_collection[gem_data.cookbook_name] = gem_data.as_cookbook_version
|
75
|
+
gem_data.cookbook_dependencies.each do |dep|
|
76
|
+
add_halite_cookbooks(node, dep.spec) if dep.spec
|
77
|
+
end
|
78
|
+
# Load attributes if any.
|
79
|
+
gem_data.each_file('chef/attributes') do |_full_path, rel_path|
|
80
|
+
raise Halite::Error.new("Chef does not support nested attribute files: #{rel_path}") if rel_path.include?(File::SEPARATOR)
|
81
|
+
name = File.basename(rel_path, '.rb')
|
82
|
+
node.include_attribute("#{gem_data.cookbook_name}::#{name}")
|
83
|
+
end
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
data/lib/halite/version.rb
CHANGED
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.0.10
|
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-09-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|