diff options
Diffstat (limited to 'lib/chef/cookbook_manifest.rb')
-rw-r--r-- | lib/chef/cookbook_manifest.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 27daf287a1..8a1583bf0e 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -require 'forwardable' -require 'chef/util/path_helper' -require 'chef/log' +require "forwardable" +require "chef/util/path_helper" +require "chef/log" class Chef @@ -127,14 +127,14 @@ class Chef def to_hash result = manifest.dup - result['frozen?'] = frozen_version? - result['chef_type'] = 'cookbook_version' + result["frozen?"] = frozen_version? + result["chef_type"] = "cookbook_version" result.to_hash end def to_json(*a) result = to_hash - result['json_class'] = "Chef::CookbookVersion" + result["json_class"] = "Chef::CookbookVersion" Chef::JSONCompat.to_json(result, *a) end @@ -169,7 +169,7 @@ class Chef COOKBOOK_SEGMENTS.each do |segment| next unless @manifest.has_key?(segment) - filenames = @manifest[segment].map{|manifest_record| manifest_record['name']} + filenames = @manifest[segment].map{|manifest_record| manifest_record["name"]} cookbook_version.replace_segment_filenames(segment, filenames) end @@ -243,17 +243,17 @@ class Chef parts = pathname.each_filename.take(2) # Check if path is actually under root_path - next if parts[0] == '..' + next if parts[0] == ".." if segment == :templates || segment == :files # Check if pathname looks like files/foo or templates/foo (unscoped) if pathname.each_filename.to_a.length == 2 # Use root_default in case the same path exists at root_default and default - return [ pathname.to_s, 'root_default' ] + return [ pathname.to_s, "root_default" ] else return [ pathname.to_s, parts[1] ] end else - return [ pathname.to_s, 'default' ] + return [ pathname.to_s, "default" ] end end Chef::Log.error("Cookbook file #{segment_file} not under cookbook root paths #{root_paths.inspect}.") |