halite 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35d989833c7bbf082dd1025c03c64fd7fa678f5c
4
- data.tar.gz: a8b72aea467f681b63a5a35de73323811b5be3a6
3
+ metadata.gz: a42a9b842d21763abf144daa10997a8f37c8ffda
4
+ data.tar.gz: a1751ed26b28b813aa1b05c03ad1d82aac86ee09
5
5
  SHA512:
6
- metadata.gz: 2b2904e09a894cd47f2e74a919c88749958edbc6c9cf158b6d5ba5b435aea7d7ce61e923434018872c2ea81348f41b7b35c21fa23ff7bb812fd8d402fda8e463
7
- data.tar.gz: 18615c97d14307608a9ebf8f6fde591e3543ee65e9257001eaa17a498f5f042431e5b99b19f681a66763cb4454a0c96ac34de1d4a5e4d3829decb97781ce8e6a
6
+ metadata.gz: f7eabc21a9a311c068d7b6c58cc9c203f47a10e1fcc2c97bb0ff49b41aea2a19fb6e91418710cc8ab6c447524940d23251d0140c7b30437a35619046afed2385
7
+ data.tar.gz: ebaeb2cfe08d6c2997d39828ca1f0efb3dcfd4f8b8c085f76a25a3386a041694955962bb5430b9e917a9c08da3ff489c3c499ef6dff6b4cf3d2499bc2244223c
data/.travis.yml CHANGED
@@ -15,6 +15,9 @@ gemfile:
15
15
  - gemfiles/chef-12.2.gemfile
16
16
  - gemfiles/chef-12.3.gemfile
17
17
  - gemfiles/chef-12.4.0.gemfile
18
+ - gemfiles/chef-12.4.gemfile
19
+ - gemfiles/chef-12.5.gemfile
20
+ - gemfiles/chef-12.6.gemfile
18
21
  - gemfiles/chef-12.gemfile
19
22
  - gemfiles/master.gemfile
20
23
  env:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Halite Changelog
2
2
 
3
+ ## v1.2.0
4
+
5
+ * Allow passing a `Halite::Gem` object to `Halite.convert`.
6
+ * Allow disabling the stove push as part of `rake release` by setting
7
+ `$cookbook_push=false` as an environment variable.
8
+ * Process `.foodcritic` when running `rake chef:foodcritic`.
9
+
3
10
  ## v1.1.0
4
11
 
5
12
  * Support the new `chef_version` metadata field through gem metadata. Defaults
data/Gemfile CHANGED
@@ -27,6 +27,7 @@ end
27
27
 
28
28
  dev_gem 'poise'
29
29
  dev_gem 'poise-boiler'
30
+ dev_gem 'poise-profiler'
30
31
 
31
32
  # Test fixture gems
32
33
  Dir[File.expand_path('../spec/fixtures/gems/*', __FILE__)].each do |path|
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.4.0'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.5.0'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.6.0'
data/lib/halite.rb CHANGED
@@ -37,6 +37,11 @@ module Halite
37
37
  # @example Converting a gem from a loaded gemspec
38
38
  # Halite.convert(Bundler.load_gemspec('mygem.gemspec'), 'dest')
39
39
  def self.convert(gem_name, base_path)
40
- Converter.write(Gem.new(gem_name), base_path)
40
+ gem_data = if gem_name.is_a?(Gem)
41
+ gem_name
42
+ else
43
+ Gem.new(gem_name)
44
+ end
45
+ Converter.write(gem_data, base_path)
41
46
  end
42
47
  end
@@ -17,6 +17,7 @@
17
17
 
18
18
  # Much inspiration from Bundler's GemHelper. Thanks!
19
19
  require 'bundler'
20
+ require 'thor'
20
21
  require 'thor/shell'
21
22
 
22
23
  require 'halite/error'
@@ -80,7 +80,14 @@ module Halite
80
80
 
81
81
  desc 'Run Foodcritic linter'
82
82
  task 'chef:foodcritic' do
83
- foodcritic_cmd = "foodcritic --chef-version #{Chef::VERSION} --epic-fail any --tags ~FC054 '%{path}'"
83
+ foodcritic_cmd = "foodcritic --chef-version #{Chef::VERSION} --epic-fail any --tags ~FC054"
84
+ foodcritic_config = File.join(base, '.foodcritic')
85
+ if File.exist?(foodcritic_config)
86
+ IO.readlines(foodcritic_config).each do |line|
87
+ foodcritic_cmd << " --tags #{line.strip}"
88
+ end
89
+ end
90
+ foodcritic_cmd << " '%{path}'"
84
91
  if options[:no_gem]
85
92
  sh(foodcritic_cmd % {path: base})
86
93
  else
@@ -122,6 +129,8 @@ module Halite
122
129
  end
123
130
 
124
131
  def release_cookbook(path)
132
+ # To match the behavior of Bundler's release task w.r.t $gem_push.
133
+ return if %w{n no nil false off 0}.include?(ENV['cookbook_push'].to_s.downcase)
125
134
  Dir.chdir(path) do
126
135
  sh('stove --no-git')
127
136
  shell.say("Pushed #{gemspec.name} #{gemspec.version} to supermarket.chef.io.", :green) unless options[:no_gem]
@@ -17,5 +17,5 @@
17
17
 
18
18
  module Halite
19
19
  # Halite version.
20
- VERSION = '1.1.0'
20
+ VERSION = '1.2.0'
21
21
  end
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.1.0
4
+ version: 1.2.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-12-18 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -135,6 +135,9 @@ files:
135
135
  - gemfiles/chef-12.2.gemfile
136
136
  - gemfiles/chef-12.3.gemfile
137
137
  - gemfiles/chef-12.4.0.gemfile
138
+ - gemfiles/chef-12.4.gemfile
139
+ - gemfiles/chef-12.5.gemfile
140
+ - gemfiles/chef-12.6.gemfile
138
141
  - gemfiles/chef-12.gemfile
139
142
  - gemfiles/master.gemfile
140
143
  - halite.gemspec