Skip to content

Commit

Permalink
Merge pull request #52 from bmarini/chef_13
Browse files Browse the repository at this point in the history
Support Chef 13
  • Loading branch information
gregkare committed Nov 24, 2017
2 parents cafc035 + 63efbd4 commit b0235f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,10 +1,10 @@
language: ruby
cache: bundler
rvm:
- 2.3.3
- 2.3.5
env:
- CHEF_VERSION=12.19.36
- CHEF_VERSION=12.7.2
- CHEF_VERSION=13.6.4
- CHEF_VERSION=12.21.1
- CHEF_VERSION=11.18.12
notifications:
email: false
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -68,7 +68,8 @@ when everything is in sync or 1 if it's not.

## Compatibility

This gem is tested with Ruby 2.1 and 2.2 and has been tested with Chef 12 and Chef 11.
This gem is tested with Ruby 2.3 and has been tested with Chef 13, 12
and 11.

## Contributors

Expand Down
8 changes: 7 additions & 1 deletion lib/health_inspector/checklists/cookbooks.rb
Expand Up @@ -42,7 +42,13 @@ def validate_changes_on_the_server_not_in_the_repo
messages = []

Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment|
cookbook.manifest[segment].each do |manifest_record|
manifest_records = if Gem::Version.new(Chef::VERSION) < Gem::Version.new('13.0.0')
# `files_for` was introduced in Chef 13
cookbook.manifest[segment]
else
cookbook.files_for(segment)
end
manifest_records.each do |manifest_record|
path = cookbook_path.join("#{manifest_record['path']}")
next if path.basename.to_s == '.git'

Expand Down

0 comments on commit b0235f2

Please sign in to comment.