diff options
author | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
commit | 51cfbdc4d16739caac4d946fadbe678444aafe34 (patch) | |
tree | 56dfd8f1cd9fd933de27268b32402e955a43ac2b /lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb | |
parent | 05064423057d4cf46f4713b81b08829cf6d20af6 (diff) | |
download | chef-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/chef_fs/data_handler/data_bag_item_data_handler.rb')
-rw-r--r-- | lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb index e2d0f43de2..d56f662c5c 100644 --- a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb @@ -1,5 +1,5 @@ -require 'chef/chef_fs/data_handler/data_handler_base' -require 'chef/data_bag_item' +require "chef/chef_fs/data_handler/data_handler_base" +require "chef/data_bag_item" class Chef module ChefFS @@ -7,19 +7,19 @@ class Chef class DataBagItemDataHandler < DataHandlerBase def normalize(data_bag_item, entry) # If it's wrapped with raw_data, unwrap it. - if data_bag_item['json_class'] == 'Chef::DataBagItem' && data_bag_item['raw_data'] - data_bag_item = data_bag_item['raw_data'] + if data_bag_item["json_class"] == "Chef::DataBagItem" && data_bag_item["raw_data"] + data_bag_item = data_bag_item["raw_data"] end # chef_type and data_bag come back in PUT and POST results, but we don't # use those in knife-essentials. normalize_hash(data_bag_item, { - 'id' => remove_dot_json(entry.name) + "id" => remove_dot_json(entry.name) },) end def normalize_for_post(data_bag_item, entry) - if data_bag_item['json_class'] == 'Chef::DataBagItem' && data_bag_item['raw_data'] - data_bag_item = data_bag_item['raw_data'] + if data_bag_item["json_class"] == "Chef::DataBagItem" && data_bag_item["raw_data"] + data_bag_item = data_bag_item["raw_data"] end { "name" => "data_bag_item_#{entry.parent.name}_#{remove_dot_json(entry.name)}", @@ -35,7 +35,7 @@ class Chef end def preserve_key?(key) - return key == 'id' + return key == "id" end def chef_class @@ -44,7 +44,7 @@ class Chef def verify_integrity(object, entry, &on_error) base_name = remove_dot_json(entry.name) - if object['raw_data']['id'] != base_name + if object["raw_data"]["id"] != base_name on_error.call("ID in #{entry.path_for_printing} must be '#{base_name}' (is '#{object['raw_data']['id']}')") end end |