diff options
author | Thom May <thom@may.lt> | 2016-12-07 09:44:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-07 09:44:16 +0000 |
commit | 811cbff2baaf0c5f8ad78cbaf6e62db969842827 (patch) | |
tree | 5a824fdbcc06e2cf4633c77baacce0da1e779686 /lib/chef/cookbook | |
parent | fcb0ccc2480725f03c2f97c0eb5ebcf37e4b2f32 (diff) | |
parent | 6ec604f150023e93859af90dff08dba6dc624f79 (diff) | |
download | chef-811cbff2baaf0c5f8ad78cbaf6e62db969842827.tar.gz |
Merge pull request #5548 from chef/lcg/chefstyle-updates
Chefstyle updates
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/chefignore.rb | 2 | ||||
-rw-r--r-- | lib/chef/cookbook/cookbook_version_loader.rb | 8 | ||||
-rw-r--r-- | lib/chef/cookbook/metadata.rb | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/chef/cookbook/chefignore.rb b/lib/chef/cookbook/chefignore.rb index 71ef53c9e5..dce58ecdb8 100644 --- a/lib/chef/cookbook/chefignore.rb +++ b/lib/chef/cookbook/chefignore.rb @@ -52,7 +52,7 @@ class Chef ignore_globs << line.strip unless line =~ COMMENTS_AND_WHITESPACE end else - Chef::Log.debug("No chefignore file found at #@ignore_file no files will be ignored") + Chef::Log.debug("No chefignore file found at #{@ignore_file} no files will be ignored") end ignore_globs end diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index af8b2e043e..d253c956b2 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -308,7 +308,7 @@ class Chef begin @metadata.from_file(file) rescue Chef::Exceptions::JSON::ParseError - Chef::Log.error("Error evaluating metadata.rb for #@inferred_cookbook_name in " + file) + Chef::Log.error("Error evaluating metadata.rb for #{@inferred_cookbook_name} in " + file) raise end end @@ -317,7 +317,7 @@ class Chef begin @metadata.from_json(IO.read(file)) rescue Chef::Exceptions::JSON::ParseError - Chef::Log.error("Couldn't parse cookbook metadata JSON for #@inferred_cookbook_name in " + file) + Chef::Log.error("Couldn't parse cookbook metadata JSON for #{@inferred_cookbook_name} in " + file) raise end end @@ -336,7 +336,7 @@ class Chef # metadata contains a name key. @metadata.name(data["cookbook_name"]) unless data["metadata"].key?("name") rescue Chef::Exceptions::JSON::ParseError - Chef::Log.error("Couldn't parse cookbook metadata JSON for #@inferred_cookbook_name in " + file) + Chef::Log.error("Couldn't parse cookbook metadata JSON for #{@inferred_cookbook_name} in " + file) raise end end @@ -347,7 +347,7 @@ class Chef data = Chef::JSONCompat.parse(IO.read(uploaded_cookbook_version_file)) @frozen = data["frozen?"] rescue Chef::Exceptions::JSON::ParseError - Chef::Log.error("Couldn't parse cookbook metadata JSON for #@inferred_cookbook_name in #{uploaded_cookbook_version_file}") + Chef::Log.error("Couldn't parse cookbook metadata JSON for #{@inferred_cookbook_name} in #{uploaded_cookbook_version_file}") raise end end diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index b2f3db9b8e..c3698f3315 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -862,12 +862,12 @@ INVALID return if !options[:choice].is_a?(Array) || options[:choice].empty? if options[:default].is_a?(String) && options[:default] != "" - raise ArgumentError, "Default must be one of your choice values!" if options[:choice].index(options[:default]) == nil + raise ArgumentError, "Default must be one of your choice values!" if options[:choice].index(options[:default]).nil? end if options[:default].is_a?(Array) && !options[:default].empty? options[:default].each do |val| - raise ArgumentError, "Default values must be a subset of your choice values!" if options[:choice].index(val) == nil + raise ArgumentError, "Default values must be a subset of your choice values!" if options[:choice].index(val).nil? end end end |