summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_manifest.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-01-14 14:08:03 +0000
committerThom May <thom@chef.io>2016-01-14 14:08:03 +0000
commit51cfbdc4d16739caac4d946fadbe678444aafe34 (patch)
tree56dfd8f1cd9fd933de27268b32402e955a43ac2b /lib/chef/cookbook_manifest.rb
parent05064423057d4cf46f4713b81b08829cf6d20af6 (diff)
downloadchef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
Diffstat (limited to 'lib/chef/cookbook_manifest.rb')
-rw-r--r--lib/chef/cookbook_manifest.rb20
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}.")