diff options
244 files changed, 1106 insertions, 1106 deletions
diff --git a/bin/chef-service-manager b/bin/chef-service-manager index 5808a0be46..43d9c8a933 100755 --- a/bin/chef-service-manager +++ b/bin/chef-service-manager @@ -30,7 +30,7 @@ if Chef::Platform.windows? :service_description => "Runs Chef Client on regular, configurable intervals.", :service_file_path => File.expand_path('../chef-windows-service', $PROGRAM_NAME), :delayed_start => true, - :dependencies => ['Winmgmt'] + :dependencies => ['Winmgmt'], } Chef::Application::WindowsServiceManager.new(chef_client_service).run else diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb index 45f451479a..ce6c440571 100644 --- a/chef-config/lib/chef-config/path_helper.rb +++ b/chef-config/lib/chef-config/path_helper.rb @@ -234,7 +234,7 @@ module ChefConfig if node['platform'] == 'mac_os_x' and Gem::Version.new(node['platform_version']) >= Gem::Version.new('10.11') # todo: parse rootless.conf for this? sip_paths= [ - '/System', '/bin', '/sbin', '/usr', + '/System', '/bin', '/sbin', '/usr' ] sip_paths.each do |sip_path| ChefConfig.logger.info("This is a SIP path, checking if it in exceptions list.") diff --git a/ext/win32-eventlog/Rakefile b/ext/win32-eventlog/Rakefile index 63fae1e73b..0aaf5df62f 100644 --- a/ext/win32-eventlog/Rakefile +++ b/ext/win32-eventlog/Rakefile @@ -46,7 +46,7 @@ task :register => EVT_SHARED_OBJECT do :source => "Application", :key_name => "Chef", :event_message_file => dll_file, - :category_message_file => dll_file + :category_message_file => dll_file, ) rescue Errno::EIO => e puts "Skipping event log registration due to missing privileges: #{e}" diff --git a/kitchen-tests/cookbooks/webapp/recipes/default.rb b/kitchen-tests/cookbooks/webapp/recipes/default.rb index 839b0ad8d8..e0cbbdd4a8 100644 --- a/kitchen-tests/cookbooks/webapp/recipes/default.rb +++ b/kitchen-tests/cookbooks/webapp/recipes/default.rb @@ -30,7 +30,7 @@ mysql_database node['webapp']['database'] do connection ({ :host => 'localhost', :username => 'root', - :password => creds['mysql']['server_root_password'] + :password => creds['mysql']['server_root_password'], }) action :create end @@ -39,7 +39,7 @@ mysql_database_user node['webapp']['db_username'] do connection ({ :host => 'localhost', :username => 'root', - :password => creds['mysql']['server_root_password'] + :password => creds['mysql']['server_root_password'], }) password creds['webapp']['db_password'] database_name node['webapp']['database'] diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb index b7b9f7dc43..940ec19d90 100644 --- a/lib/chef/api_client.rb +++ b/lib/chef/api_client.rb @@ -53,7 +53,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_\.]+$/ + :regex => /^[\-[:alnum:]_\.]+$/, ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :admin, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :public_key, arg, - :kind_of => String + :kind_of => String, ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :validator, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -102,7 +102,7 @@ class Chef set_or_return( :private_key, arg, - :kind_of => [String, FalseClass] + :kind_of => [String, FalseClass], ) end @@ -117,7 +117,7 @@ class Chef "validator" => @validator, "admin" => @admin, 'json_class' => self.class.name, - "chef_type" => "client" + "chef_type" => "client", } result["private_key"] = @private_key if @private_key result diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index 99667acc0a..f7278a8a48 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -151,8 +151,8 @@ class Chef { :api_version => "0", :client_name => Chef::Config[:validation_client_name], - :signing_key_filename => Chef::Config[:validation_key] - } + :signing_key_filename => Chef::Config[:validation_key], + }, ) end diff --git a/lib/chef/api_client_v1.rb b/lib/chef/api_client_v1.rb index 80f0d2517c..7329343f43 100644 --- a/lib/chef/api_client_v1.rb +++ b/lib/chef/api_client_v1.rb @@ -76,7 +76,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_\.]+$/ + :regex => /^[\-[:alnum:]_\.]+$/, ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :admin, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -100,7 +100,7 @@ class Chef set_or_return( :public_key, arg, - :kind_of => String + :kind_of => String, ) end @@ -113,7 +113,7 @@ class Chef set_or_return( :validator, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -126,7 +126,7 @@ class Chef set_or_return( :private_key, arg, - :kind_of => [String, TrueClass, FalseClass] + :kind_of => [String, TrueClass, FalseClass], ) end @@ -138,7 +138,7 @@ class Chef set_or_return( :create_key, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -151,7 +151,7 @@ class Chef "name" => @name, "validator" => @validator, "admin" => @admin, - "chef_type" => "client" + "chef_type" => "client", } result["private_key"] = @private_key unless @private_key.nil? result["public_key"] = @public_key unless @public_key.nil? @@ -282,7 +282,7 @@ class Chef :validator => validator, # this field is ignored in API V1, but left for backwards-compat, # can remove after OSC 11 support is finished? - :admin => admin + :admin => admin, } begin # try API V1 diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 3ab68260d7..680f99df56 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -207,7 +207,7 @@ class Chef @chef_client_json, override_runlist: override_runlist, specific_recipes: specific_recipes, - runlist: config[:runlist] + runlist: config[:runlist], ) @chef_client_json = nil diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 9becf4b33f..fd7cc7dd18 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -198,7 +198,7 @@ class Chef result = shell_out( "chef-client #{config_params}", :timeout => Chef::Config[:windows_service][:watchdog_timeout], - :logger => Chef::Log + :logger => Chef::Log, ) Chef::Log.debug "#{result.stdout}" Chef::Log.debug "#{result.stderr}" diff --git a/lib/chef/application/windows_service_manager.rb b/lib/chef/application/windows_service_manager.rb index d969896025..4bb624989e 100644 --- a/lib/chef/application/windows_service_manager.rb +++ b/lib/chef/application/windows_service_manager.rb @@ -124,11 +124,11 @@ class Chef :binary_path_name => cmd, :service_start_name => @service_start_name, :password => @password, - :dependencies => @dependencies + :dependencies => @dependencies, ) ::Win32::Service.configure( :service_name => @service_name, - :delayed_start => @delayed_start + :delayed_start => @delayed_start, ) unless @delayed_start.nil? puts "Service '#{@service_name}' has successfully been installed." end diff --git a/lib/chef/audit/audit_event_proxy.rb b/lib/chef/audit/audit_event_proxy.rb index b9ca39e5dc..ddcb170955 100644 --- a/lib/chef/audit/audit_event_proxy.rb +++ b/lib/chef/audit/audit_event_proxy.rb @@ -84,7 +84,7 @@ class Chef :resource_type => resource_type, :resource_name => resource_name, :context => describe_groups, - :line_number => example.metadata[:line_number] + :line_number => example.metadata[:line_number], } end diff --git a/lib/chef/audit/control_group_data.rb b/lib/chef/audit/control_group_data.rb index 204d7f8070..62623b0b64 100644 --- a/lib/chef/audit/control_group_data.rb +++ b/lib/chef/audit/control_group_data.rb @@ -41,7 +41,7 @@ class Chef :run_id => run_id, :start_time => start_time, :end_time => end_time, - :control_groups => control_groups.collect { |c| c.to_hash } + :control_groups => control_groups.collect { |c| c.to_hash }, } end end @@ -86,7 +86,7 @@ class Chef :status => status, :number_succeeded => number_succeeded, :number_failed => number_failed, - :controls => controls.collect { |c| c.to_hash } + :controls => controls.collect { |c| c.to_hash }, } # If there is a duplicate key, metadata will overwrite it add_display_only_data(h).merge(metadata) @@ -129,7 +129,7 @@ class Chef :status => status, :details => details, :resource_type => resource_type, - :resource_name => resource_name + :resource_name => resource_name, } h[:context] = context || [] h diff --git a/lib/chef/chef_fs/config.rb b/lib/chef/chef_fs/config.rb index 260882ae70..29c9d3b879 100644 --- a/lib/chef/chef_fs/config.rb +++ b/lib/chef/chef_fs/config.rb @@ -41,7 +41,7 @@ class Chef "roles" => "role", "users" => "user", "policies" => "policy", - "policy_groups" => "policy_group" + "policy_groups" => "policy_group", } INFLECTIONS.each { |k,v| k.freeze; v.freeze } INFLECTIONS.freeze diff --git a/lib/chef/chef_fs/data_handler/acl_data_handler.rb b/lib/chef/chef_fs/data_handler/acl_data_handler.rb index 8def8a543d..6096b6e43c 100644 --- a/lib/chef/chef_fs/data_handler/acl_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/acl_data_handler.rb @@ -11,8 +11,8 @@ class Chef 'read' => {}, 'update' => {}, 'delete' => {}, - 'grant' => {} - }) + 'grant' => {}, + },) result.keys.each do |key| result[key] = normalize_hash(result[key], { 'actors' => [], 'groups' => [] }) result[key]['actors'] = result[key]['actors'].sort diff --git a/lib/chef/chef_fs/data_handler/client_data_handler.rb b/lib/chef/chef_fs/data_handler/client_data_handler.rb index 5bcbd4e373..421a463c2f 100644 --- a/lib/chef/chef_fs/data_handler/client_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/client_data_handler.rb @@ -11,7 +11,7 @@ class Chef 'clientname' => remove_dot_json(entry.name), 'admin' => false, 'validator' => false, - 'chef_type' => 'client' + 'chef_type' => 'client', } # Handle the fact that admin/validator have changed type from string -> boolean client['admin'] = (client['admin'] == 'true') if client['admin'].is_a?(String) diff --git a/lib/chef/chef_fs/data_handler/container_data_handler.rb b/lib/chef/chef_fs/data_handler/container_data_handler.rb index 980453cbab..f03005f947 100644 --- a/lib/chef/chef_fs/data_handler/container_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/container_data_handler.rb @@ -7,8 +7,8 @@ class Chef def normalize(container, entry) normalize_hash(container, { 'containername' => remove_dot_json(entry.name), - 'containerpath' => remove_dot_json(entry.name) - }) + 'containerpath' => remove_dot_json(entry.name), + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb index 56b7e0b765..0f2cad7983 100644 --- a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb @@ -15,12 +15,12 @@ class Chef 'json_class' => 'Chef::CookbookVersion', 'chef_type' => 'cookbook_version', 'frozen?' => false, - 'metadata' => {} - }) + 'metadata' => {}, + },) result['metadata'] = normalize_hash(result['metadata'], { 'version' => version, - 'name' => name - }) + 'name' => name, + },) end def preserve_key?(key) 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 1306922081..e2d0f43de2 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 @@ -14,7 +14,7 @@ class Chef # use those in knife-essentials. normalize_hash(data_bag_item, { 'id' => remove_dot_json(entry.name) - }) + },) end def normalize_for_post(data_bag_item, entry) @@ -26,7 +26,7 @@ class Chef "json_class" => "Chef::DataBagItem", "chef_type" => "data_bag_item", "data_bag" => entry.parent.name, - "raw_data" => normalize(data_bag_item, entry) + "raw_data" => normalize(data_bag_item, entry), } end diff --git a/lib/chef/chef_fs/data_handler/environment_data_handler.rb b/lib/chef/chef_fs/data_handler/environment_data_handler.rb index 5105f2ac49..5152a01e39 100644 --- a/lib/chef/chef_fs/data_handler/environment_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/environment_data_handler.rb @@ -13,8 +13,8 @@ class Chef 'default_attributes' => {}, 'override_attributes' => {}, 'json_class' => 'Chef::Environment', - 'chef_type' => 'environment' - }) + 'chef_type' => 'environment', + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/data_handler/group_data_handler.rb b/lib/chef/chef_fs/data_handler/group_data_handler.rb index 1a36c66eb8..40cb57b78a 100644 --- a/lib/chef/chef_fs/data_handler/group_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/group_data_handler.rb @@ -28,7 +28,7 @@ class Chef result['actors'] = { 'users' => result['users'], 'clients' => result['clients'], - 'groups' => result['groups'] + 'groups' => result['groups'], } result.delete('users') result.delete('clients') diff --git a/lib/chef/chef_fs/data_handler/node_data_handler.rb b/lib/chef/chef_fs/data_handler/node_data_handler.rb index 04faa527f0..c4910b55b9 100644 --- a/lib/chef/chef_fs/data_handler/node_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/node_data_handler.rb @@ -15,8 +15,8 @@ class Chef 'normal' => {}, 'default' => {}, 'automatic' => {}, - 'run_list' => [] - }) + 'run_list' => [], + },) result['run_list'] = normalize_run_list(result['run_list']) result end diff --git a/lib/chef/chef_fs/data_handler/organization_data_handler.rb b/lib/chef/chef_fs/data_handler/organization_data_handler.rb index da911c08f0..7b1bcc4c6c 100644 --- a/lib/chef/chef_fs/data_handler/organization_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/organization_data_handler.rb @@ -11,7 +11,7 @@ class Chef 'org_type' => 'Business', 'clientname' => "#{entry.org}-validator", 'billing_plan' => 'platform-free', - }) + },) result end diff --git a/lib/chef/chef_fs/data_handler/policy_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_data_handler.rb index 9f4d7479fc..32a7a791f7 100644 --- a/lib/chef/chef_fs/data_handler/policy_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_data_handler.rb @@ -21,7 +21,7 @@ class Chef 'name' => name, 'revision_id' => revision_id, 'run_list' => [], - 'cookbook_locks' => {} + 'cookbook_locks' => {}, } normalize_hash(policy, defaults) end diff --git a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb index 6ada606e49..10de6abb42 100644 --- a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb @@ -8,7 +8,7 @@ class Chef def normalize(policy_group, entry) defaults = { "name" => remove_dot_json(entry.name), - "policies" => {} + "policies" => {}, } result = normalize_hash(policy_group, defaults) result.delete("uri") # not useful data diff --git a/lib/chef/chef_fs/data_handler/role_data_handler.rb b/lib/chef/chef_fs/data_handler/role_data_handler.rb index 21c3013e9f..d7530f0b9b 100644 --- a/lib/chef/chef_fs/data_handler/role_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/role_data_handler.rb @@ -14,8 +14,8 @@ class Chef 'default_attributes' => {}, 'override_attributes' => {}, 'run_list' => [], - 'env_run_lists' => {} - }) + 'env_run_lists' => {}, + },) result['run_list'] = normalize_run_list(result['run_list']) result['env_run_lists'].each_pair do |env, run_list| result['env_run_lists'][env] = normalize_run_list(run_list) diff --git a/lib/chef/chef_fs/data_handler/user_data_handler.rb b/lib/chef/chef_fs/data_handler/user_data_handler.rb index f6859faccd..01c673b460 100644 --- a/lib/chef/chef_fs/data_handler/user_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/user_data_handler.rb @@ -14,8 +14,8 @@ class Chef 'chef_type' => 'webui_user', 'salt' => nil, 'password' => nil, - 'openid' => nil - }) + 'openid' => nil, + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb b/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb index 1ac03166c2..d2e0e64afe 100644 --- a/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb @@ -147,7 +147,7 @@ class Chef # /environments EnvironmentsDir.new("environments", self, nil, Chef::ChefFS::DataHandler::EnvironmentDataHandler.new), # /roles - RestListDir.new("roles", self, nil, Chef::ChefFS::DataHandler::RoleDataHandler.new) + RestListDir.new("roles", self, nil, Chef::ChefFS::DataHandler::RoleDataHandler.new), ] if repo_mode == 'hosted_everything' result += [ @@ -179,7 +179,7 @@ class Chef # /nodes NodesDir.new("nodes", self, nil, Chef::ChefFS::DataHandler::NodeDataHandler.new), # /users - RestListDir.new("users", self, nil, Chef::ChefFS::DataHandler::UserDataHandler.new) + RestListDir.new("users", self, nil, Chef::ChefFS::DataHandler::UserDataHandler.new), ] end result.sort_by { |child| child.name } diff --git a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb index 51de0bfd86..b888b6de22 100644 --- a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb @@ -58,7 +58,7 @@ class Chef :files => { :recursive => true }, :resources => { :ruby_only => true, :recursive => true }, :providers => { :ruby_only => true, :recursive => true }, - :root_files => { } + :root_files => { }, } # See Erchef code diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 9d9909bac2..4c06d513c1 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -391,7 +391,7 @@ class Chef def register_reporters [ Chef::ResourceReporter.new(rest), - Chef::Audit::AuditReporter.new(rest) + Chef::Audit::AuditReporter.new(rest), ].each do |r| events.register(r) end diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index dbccdbc0a8..0341c394a8 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -51,7 +51,7 @@ class Chef :library_filenames => {}, :resource_filenames => {}, :provider_filenames => {}, - :root_filenames => {} + :root_filenames => {}, } @metadata_filenames = [] diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index 0892d85749..67d762f34b 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -176,7 +176,7 @@ class Chef set_or_return( :maintainer, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -191,7 +191,7 @@ class Chef set_or_return( :maintainer_email, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -206,7 +206,7 @@ class Chef set_or_return( :license, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -221,7 +221,7 @@ class Chef set_or_return( :description, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -236,7 +236,7 @@ class Chef set_or_return( :long_description, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -267,7 +267,7 @@ class Chef set_or_return( :name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -490,8 +490,8 @@ class Chef :default => { :kind_of => [ String, Array, Hash, Symbol, Numeric, TrueClass, FalseClass ] }, :source_url => { :kind_of => String }, :issues_url => { :kind_of => String }, - :privacy => { :kind_of => [ TrueClass, FalseClass ] } - } + :privacy => { :kind_of => [ TrueClass, FalseClass ] }, + }, ) options[:required] = remap_required_attribute(options[:required]) unless options[:required].nil? validate_choice_array(options) @@ -507,8 +507,8 @@ class Chef options, { :title => { :kind_of => String }, - :description => { :kind_of => String } - } + :description => { :kind_of => String }, + }, ) @groupings[name] = options @groupings[name] @@ -571,7 +571,7 @@ class Chef ISSUES_URL => self.issues_url, PRIVACY => self.privacy, CHEF_VERSIONS => gem_requirements_to_array(*self.chef_versions), - OHAI_VERSIONS => gem_requirements_to_array(*self.ohai_versions) + OHAI_VERSIONS => gem_requirements_to_array(*self.ohai_versions), } end @@ -647,7 +647,7 @@ class Chef set_or_return( :source_url, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -662,7 +662,7 @@ class Chef set_or_return( :issues_url, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -679,7 +679,7 @@ class Chef set_or_return( :privacy, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 10654a4945..27daf287a1 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -193,8 +193,8 @@ class Chef :templates => Array.new, :resources => Array.new, :providers => Array.new, - :root_files => Array.new - }) + :root_files => Array.new, + },) @checksums = {} if !root_paths || root_paths.size == 0 @@ -215,8 +215,8 @@ class Chef :name => file_name, :path => path, :checksum => csum, - :specificity => specificity - }) + :specificity => specificity, + },) manifest[segment] << rs end diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb index 9d0dc53da5..102851b804 100644 --- a/lib/chef/data_bag.rb +++ b/lib/chef/data_bag.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :name, arg, - :regex => VALID_NAME + :regex => VALID_NAME, ) end diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb index b0713c298f..fd9548eaec 100644 --- a/lib/chef/data_bag_item.rb +++ b/lib/chef/data_bag_item.rb @@ -86,7 +86,7 @@ class Chef set_or_return( :data_bag, arg, - :regex => /^[\-[:alnum:]_]+$/ + :regex => /^[\-[:alnum:]_]+$/, ) end @@ -120,7 +120,7 @@ class Chef "json_class" => self.class.name, "chef_type" => "data_bag_item", "data_bag" => data_bag, - "raw_data" => raw_data + "raw_data" => raw_data, } Chef::JSONCompat.to_json(result, *a) end diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb index d1bf09b313..569c8a3bc5 100644 --- a/lib/chef/dsl/audit.rb +++ b/lib/chef/dsl/audit.rb @@ -40,7 +40,7 @@ class Chef cookbook_name: cookbook_name, cookbook_version: self.run_context.cookbook_collection[cookbook_name].version, recipe_name: self.recipe_name, - line_number: block.source_location[1] + line_number: block.source_location[1], } run_context.audits[name] = Struct.new(:args, :block, :metadata).new(args, block, metadata) diff --git a/lib/chef/dsl/declare_resource.rb b/lib/chef/dsl/declare_resource.rb index 52b0cb715d..93e7e69884 100644 --- a/lib/chef/dsl/declare_resource.rb +++ b/lib/chef/dsl/declare_resource.rb @@ -100,7 +100,7 @@ class Chef run_context: run_context, cookbook_name: cookbook_name, recipe_name: recipe_name, - enclosing_provider: self.is_a?(Chef::Provider) ? self : nil + enclosing_provider: self.is_a?(Chef::Provider) ? self : nil, ).build(&resource_attrs_block) end end diff --git a/lib/chef/encrypted_data_bag_item/encryptor.rb b/lib/chef/encrypted_data_bag_item/encryptor.rb index 034413c1bd..14c82dcea9 100644 --- a/lib/chef/encrypted_data_bag_item/encryptor.rb +++ b/lib/chef/encrypted_data_bag_item/encryptor.rb @@ -83,7 +83,7 @@ class Chef::EncryptedDataBagItem "encrypted_data" => encrypted_data, "iv" => Base64.encode64(iv), "version" => 1, - "cipher" => algorithm + "cipher" => algorithm, } end @@ -141,7 +141,7 @@ class Chef::EncryptedDataBagItem "hmac" => hmac, "iv" => Base64.encode64(iv), "version" => 2, - "cipher" => algorithm + "cipher" => algorithm, } end @@ -176,7 +176,7 @@ class Chef::EncryptedDataBagItem "iv" => Base64.encode64(iv), "auth_tag" => Base64.encode64(auth_tag), "version" => 3, - "cipher" => algorithm + "cipher" => algorithm, } end diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb index 5612978a08..aedccbb08d 100644 --- a/lib/chef/environment.rb +++ b/lib/chef/environment.rb @@ -67,7 +67,7 @@ class Chef set_or_return( :description, arg, - :kind_of => String + :kind_of => String, ) end @@ -75,7 +75,7 @@ class Chef set_or_return( :default_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :override_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -103,8 +103,8 @@ class Chef :kind_of => Hash, :callbacks => { "should be a valid set of cookbook version requirements" => lambda { |cv| Chef::Environment.validate_cookbook_versions(cv) } - } - } + }, + }, ) end @@ -115,7 +115,7 @@ class Chef :version => { :callbacks => { "should be a valid version requirement" => lambda { |v| Chef::Environment.validate_cookbook_version(v) } } } - }) + },) @cookbook_versions[cookbook] = version end @@ -127,7 +127,7 @@ class Chef "json_class" => self.class.name, "chef_type" => "environment", "default_attributes" => @default_attributes, - "override_attributes" => @override_attributes + "override_attributes" => @override_attributes, } result end diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb index 7a3a28b61f..9c01b11e76 100644 --- a/lib/chef/event_loggers/windows_eventlog.rb +++ b/lib/chef/event_loggers/windows_eventlog.rb @@ -50,7 +50,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_START_EVENT_ID, - :data => [version] + :data => [version], ) end @@ -60,7 +60,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_STARTED_EVENT_ID, - :data => [run_status.run_id] + :data => [run_status.run_id], ) end @@ -69,7 +69,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_COMPLETED_EVENT_ID, - :data => [@run_status.run_id, @run_status.elapsed_time.to_s] + :data => [@run_status.run_id, @run_status.elapsed_time.to_s], ) end @@ -92,7 +92,7 @@ class Chef :event_id => RUN_FAILED_EVENT_ID, :data => data + [e.class.name, e.message, - e.backtrace.join("\n")] + e.backtrace.join("\n")], ) end diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 8736ff7ffc..74b8d80de2 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -344,7 +344,7 @@ class Chef result = { "message" => message, "non_existent_cookbooks" => non_existent_cookbooks, - "cookbooks_with_no_versions" => cookbooks_with_no_matching_versions + "cookbooks_with_no_versions" => cookbooks_with_no_matching_versions, } Chef::JSONCompat.to_json(result, *a) end @@ -379,7 +379,7 @@ class Chef "message" => message, "unsatisfiable_run_list_item" => run_list_item, "non_existent_cookbooks" => non_existent_cookbooks, - "most_constrained_cookbooks" => most_constrained_cookbooks + "most_constrained_cookbooks" => most_constrained_cookbooks, } Chef::JSONCompat.to_json(result, *a) end diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index c2f77bdff6..2d633af4ed 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -43,12 +43,12 @@ class Chef validate( { :path => path, - :contents => contents + :contents => contents, }, { :path => { :kind_of => String }, :contents => { :kind_of => String }, - } + }, ) file_path_array = File.split(path) @@ -69,12 +69,12 @@ class Chef validate( { :file => file, - :path => path + :path => path, }, { :file => { :kind_of => String }, :path => { :kind_of => String }, - } + }, ) file_path_array = File.split(path) @@ -82,7 +82,7 @@ class Chef if File.exists?(file) && File.writable?(file) FileUtils.mv( file, - File.join(create_cache_path(File.join(file_path_array), true), file_name) + File.join(create_cache_path(File.join(file_path_array), true), file_name), ) else raise RuntimeError, "Cannot move #{file} to #{path}!" @@ -109,7 +109,7 @@ class Chef }, { :path => { :kind_of => String } - } + }, ) cache_path = create_cache_path(path, false) raise Chef::Exceptions::FileNotFound, "Cannot find #{cache_path} for #{path}!" unless File.exists?(cache_path) @@ -134,8 +134,8 @@ class Chef :path => path }, { - :path => { :kind_of => String }, - } + :path => { :kind_of => String } + }, ) cache_path = create_cache_path(path, false) if File.exists?(cache_path) @@ -181,8 +181,8 @@ class Chef :path => path }, { - :path => { :kind_of => String }, - } + :path => { :kind_of => String } + }, ) full_path = create_cache_path(path, false) if File.exists?(full_path) diff --git a/lib/chef/formatters/error_descriptor.rb b/lib/chef/formatters/error_descriptor.rb index c2e656f167..f0e7520f31 100644 --- a/lib/chef/formatters/error_descriptor.rb +++ b/lib/chef/formatters/error_descriptor.rb @@ -49,7 +49,7 @@ class Chef def for_json() { 'title' => @title, - 'sections' => @sections + 'sections' => @sections, } end diff --git a/lib/chef/key.rb b/lib/chef/key.rb index 47bfe1fcee..714dfc3f60 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -250,7 +250,7 @@ class Chef openssl_key_object = OpenSSL::PKey::RSA.new(public_key) data_string = OpenSSL::ASN1::Sequence([ OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.n), - OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.e) + OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.e), ]) OpenSSL::Digest::SHA1.hexdigest(data_string.to_der).scan(/../).join(':') end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index d958ddf336..a429c7246b 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -259,7 +259,7 @@ class Chef ) @chef_vault_handler = Chef::Knife::Bootstrap::ChefVaultHandler.new( knife_config: config, - ui: ui + ui: ui, ) end @@ -340,7 +340,7 @@ class Chef config, config[:run_list], Chef::Config, - secret + secret, ) end diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index 043ca84a58..c125c4b939 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -129,7 +129,7 @@ class Chef http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, { :tarball => File.open(cookbook_filename), - :cookbook => category_string + :cookbook => category_string, }) res = Chef::JSONCompat.from_json(http_resp.body) diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb index c5b7c3485a..84ae80b634 100644 --- a/lib/chef/log/winevt.rb +++ b/lib/chef/log/winevt.rb @@ -54,7 +54,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => INFO_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -63,7 +63,7 @@ class Chef :event_type => ::Win32::EventLog::WARN_TYPE, :source => SOURCE, :event_id => WARN_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -72,7 +72,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => DEBUG_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -81,7 +81,7 @@ class Chef :event_type => ::Win32::EventLog::ERROR_TYPE, :source => SOURCE, :event_id => ERROR_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -90,7 +90,7 @@ class Chef :event_type => ::Win32::EventLog::ERROR_TYPE, :source => SOURCE, :event_id => FATAL_EVENT_ID, - :data => [msg] + :data => [msg], ) end diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb index e4f29c07c4..7ec2a5cb40 100644 --- a/lib/chef/mixin/powershell_out.rb +++ b/lib/chef/mixin/powershell_out.rb @@ -66,7 +66,7 @@ class Chef with_os_architecture(nil, architecture: arch) do shell_out( build_powershell_command(script), - options + options, ) end end @@ -88,7 +88,7 @@ class Chef "-ExecutionPolicy Unrestricted", # Powershell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected - "-InputFormat None" + "-InputFormat None", ] "powershell.exe #{flags.join(' ')} -Command \"#{script}\"" diff --git a/lib/chef/mixin/powershell_type_coercions.rb b/lib/chef/mixin/powershell_type_coercions.rb index 75b3276c84..3297d6abbb 100644 --- a/lib/chef/mixin/powershell_type_coercions.rb +++ b/lib/chef/mixin/powershell_type_coercions.rb @@ -28,7 +28,7 @@ class Chef FalseClass => { :type => lambda { |x| '$false' }}, TrueClass => { :type => lambda { |x| '$true' }}, Hash => {:type => Proc.new { |x| translate_hash(x)}}, - Array => {:type => Proc.new { |x| translate_array(x)}} + Array => {:type => Proc.new { |x| translate_array(x)}}, } end diff --git a/lib/chef/mixin/securable.rb b/lib/chef/mixin/securable.rb index 396243693e..e0d3752733 100644 --- a/lib/chef/mixin/securable.rb +++ b/lib/chef/mixin/securable.rb @@ -24,7 +24,7 @@ class Chef set_or_return( :owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end @@ -34,7 +34,7 @@ class Chef set_or_return( :group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -54,8 +54,8 @@ class Chef else Integer(m)<=07777 && Integer(m)>=0 end - }, - } + } + }, ) end @@ -116,7 +116,7 @@ class Chef unless permissions.nil? input = { :permissions => permissions, - :principals => principals + :principals => principals, } input.merge!(args_hash) unless args_hash.nil? @@ -124,7 +124,7 @@ class Chef :principals => { :required => true, :kind_of => [String, Array] }, :applies_to_children => { :equal_to => [ true, false, :containers_only, :objects_only ]}, :applies_to_self => { :kind_of => [ TrueClass, FalseClass ] }, - :one_level_deep => { :kind_of => [ TrueClass, FalseClass ] } + :one_level_deep => { :kind_of => [ TrueClass, FalseClass ] }, } validate(input, validations) @@ -158,7 +158,7 @@ class Chef set_or_return( name, rights, - {} + {}, ) end end @@ -174,7 +174,7 @@ class Chef set_or_return( :inherits, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end end diff --git a/lib/chef/node.rb b/lib/chef/node.rb index cb486f8d09..e2f3ec4fc0 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -115,7 +115,7 @@ class Chef {:name => { :kind_of => String, :cannot_be => :blank, :regex => /^[\-[:alnum:]_:.]+$/} - }) + },) @name = arg else @name @@ -507,7 +507,7 @@ class Chef "default" => attributes.combined_default, "override" => attributes.combined_override, #Render correctly for run_list items so malformed json does not result - "run_list" => @primary_runlist.run_list.map { |item| item.to_s } + "run_list" => @primary_runlist.run_list.map { |item| item.to_s }, } # Chef Server rejects node JSON with extra keys; prior to 12.3, # "policy_name" and "policy_group" are unknown; after 12.3 they are diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index 7ffac40bf4..862a7a2fd9 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -48,21 +48,21 @@ class Chef :@role_override, :@env_override, :@force_override, - :@automatic + :@automatic, ].freeze DEFAULT_COMPONENTS = [ :@default, :@env_default, :@role_default, - :@force_default + :@force_default, ] OVERRIDE_COMPONENTS = [ :@override, :@role_override, :@env_override, - :@force_override + :@force_override, ] [:all?, diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index 1dcc950c6e..6a45f49140 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -54,7 +54,7 @@ class Chef :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ] # For all of the methods that may mutate an Array, we override them to @@ -117,7 +117,7 @@ class Chef :reject!, :replace, :select!, - :shift + :shift, ] # For all of the mutating methods on Mash, override them so that they diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb index 0e2800641a..c092c8cacc 100644 --- a/lib/chef/node/immutable_collections.rb +++ b/lib/chef/node/immutable_collections.rb @@ -63,7 +63,7 @@ class Chef :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ] def initialize(array_data) @@ -143,7 +143,7 @@ class Chef :reject!, :replace, :select!, - :shift + :shift, ] def initialize(mash_data) diff --git a/lib/chef/org.rb b/lib/chef/org.rb index 81eca6a991..ff0d2de390 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -61,7 +61,7 @@ class Chef def to_hash result = { "name" => @name, - "full_name" => @full_name + "full_name" => @full_name, } result["private_key"] = @private_key if @private_key result["guid"] = @guid if @guid diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index 1de6d61029..a4811ccc33 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -119,12 +119,12 @@ class Chef :required => false, }, :resource => { - :kind_of => Symbol, + :kind_of => Symbol }, :provider => { - :kind_of => [ String, Symbol, Class ], - } - } + :kind_of => [ String, Symbol, Class ] + }, + }, ) if args.has_key?(:platform) if args.has_key?(:version) diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index 432fe3987f..3095ff63e0 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -72,7 +72,7 @@ class Chef def local_configuration_manager @local_configuration_manager ||= Chef::Util::DSC::LocalConfigurationManager.new( node, - nil + nil, ) end @@ -152,7 +152,7 @@ class Chef cmdlet = Chef::Util::Powershell::Cmdlet.new( node, "Invoke-DscResource #{switches}", - output_format + output_format, ) cmdlet.run!({}, {:timeout => new_resource.timeout}) end @@ -170,7 +170,7 @@ class Chef def create_reboot_resource @reboot_resource = Chef::Resource::Reboot.new( "Reboot for #{@new_resource.name}", - run_context + run_context, ).tap do |r| r.reason("Reboot for #{@new_resource.resource}.") end diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb index 8205910d5a..ea47ff22b3 100644 --- a/lib/chef/provider/dsc_script.rb +++ b/lib/chef/provider/dsc_script.rb @@ -92,7 +92,7 @@ class Chef shellout_flags = { :cwd => @dsc_resource.cwd, :environment => @dsc_resource.environment, - :timeout => @dsc_resource.timeout + :timeout => @dsc_resource.timeout, } begin @@ -119,7 +119,7 @@ class Chef shellout_flags = { :cwd => @dsc_resource.cwd, :environment => @dsc_resource.environment, - :timeout => @dsc_resource.timeout + :timeout => @dsc_resource.timeout, } generator = Chef::Util::DSC::ConfigurationGenerator.new(@run_context.node, config_directory) diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index 4d9f07d2b2..85bc2d98be 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -246,7 +246,7 @@ class Chef else [ Chef::Exceptions::FileTypeMismatch, "File #{path} exists, but is a #{file_type_string(@new_resource.path)}, set force_unlink to true to remove", - "Assuming #{file_type_string(@new_resource.path)} at #{@new_resource.path} would have been removed by a previous resource" + "Assuming #{file_type_string(@new_resource.path)} at #{@new_resource.path} would have been removed by a previous resource", ] end end @@ -267,7 +267,7 @@ class Chef [ Chef::Exceptions::FileTypeMismatch, "File #{path} exists, but is a symlink to #{real_path} which is a #{file_type_string(real_path)}. " + "Disable manage_symlink_source and set force_unlink to remove it.", - "Assuming symlink #{path} or source file #{real_path} would have been fixed by a previous resource" + "Assuming symlink #{path} or source file #{real_path} would have been fixed by a previous resource", ] end rescue Errno::ELOOP diff --git a/lib/chef/provider/http_request.rb b/lib/chef/provider/http_request.rb index 61aff434ed..dac62bc2f6 100644 --- a/lib/chef/provider/http_request.rb +++ b/lib/chef/provider/http_request.rb @@ -42,7 +42,7 @@ class Chef # and false for a "304 Not Modified" response modified = @http.head( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} HEAD to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} HEAD request response: #{modified}") @@ -59,7 +59,7 @@ class Chef message = check_message(@new_resource.message) body = @http.get( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} GET to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} GET request response: #{body}") @@ -73,7 +73,7 @@ class Chef body = @http.put( "#{@new_resource.url}", message, - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} PUT to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} PUT request response: #{body}") @@ -87,7 +87,7 @@ class Chef body = @http.post( "#{@new_resource.url}", message, - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} POST to #{@new_resource.url} message: #{message.inspect} successful") Chef::Log.debug("#{@new_resource} POST request response: #{body}") @@ -99,7 +99,7 @@ class Chef converge_by("#{@new_resource} DELETE to #{@new_resource.url}") do body = @http.delete( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) @new_resource.updated_by_last_action(true) Chef::Log.info("#{@new_resource} DELETE to #{@new_resource.url} successful") diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb index 7869917307..9ec2533ac0 100644 --- a/lib/chef/provider/ifconfig.rb +++ b/lib/chef/provider/ifconfig.rb @@ -109,7 +109,7 @@ class Chef command = add_command converge_by ("run #{command} to add #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} added") end @@ -127,7 +127,7 @@ class Chef command = enable_command converge_by ("run #{command} to enable #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} enabled") end @@ -141,7 +141,7 @@ class Chef command = delete_command converge_by ("run #{command} to delete #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} deleted") end @@ -158,7 +158,7 @@ class Chef command = disable_command converge_by ("run #{command} to disable #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} disabled") end diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 085397efea..4b3e512480 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -148,15 +148,15 @@ class Chef ::File.join( "profiles", @new_resource.cookbook_name, - ::File.dirname(cookbook_file) + ::File.dirname(cookbook_file), ) ) remote_file = Chef::Resource::CookbookFile.new( ::File.join( get_cache_dir, - "#{cookbook_file}.remote" + "#{cookbook_file}.remote", ), - run_context + run_context, ) remote_file.cookbook_name = @new_resource.cookbook_name remote_file.source(cookbook_file) @@ -177,7 +177,7 @@ class Chef # Make a UUID of the profile contents and return as string UUIDTools::UUID.sha1_create( UUIDTools::UUID_DNS_NAMESPACE, - profile.to_s + profile.to_s, ).to_s end diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 7a9173e077..45e2a2fc84 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -142,7 +142,7 @@ class Chef "[System.Environment]::GetEnvironmentVariable('ChocolateyInstall', 'MACHINE')" ).stdout.chomp, 'bin', - 'choco.exe' + 'choco.exe', ) end diff --git a/lib/chef/provider/package/windows/exe.rb b/lib/chef/provider/package/windows/exe.rb index 8f6cd1efa5..f21106f2ff 100644 --- a/lib/chef/provider/package/windows/exe.rb +++ b/lib/chef/provider/package/windows/exe.rb @@ -61,7 +61,7 @@ class Chef "\"#{new_resource.source}\"", unattended_flags, expand_options(new_resource.options), - "& exit %%%%ERRORLEVEL%%%%" + "& exit %%%%ERRORLEVEL%%%%", ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns ) end @@ -86,7 +86,7 @@ class Chef ::File.basename(uninstall_string), expand_options(new_resource.options), " ", - unattended_flags + unattended_flags, ].join %Q{start "" /wait #{uninstall_string} & exit %%%%ERRORLEVEL%%%%} end diff --git a/lib/chef/provider/package/windows/registry_uninstall_entry.rb b/lib/chef/provider/package/windows/registry_uninstall_entry.rb index a63e09c6bd..2c3f6ba093 100644 --- a/lib/chef/provider/package/windows/registry_uninstall_entry.rb +++ b/lib/chef/provider/package/windows/registry_uninstall_entry.rb @@ -31,7 +31,7 @@ class Chef [ [::Win32::Registry::HKEY_LOCAL_MACHINE, (::Win32::Registry::Constants::KEY_READ | 0x0100)], [::Win32::Registry::HKEY_LOCAL_MACHINE, (::Win32::Registry::Constants::KEY_READ | 0x0200)], - [::Win32::Registry::HKEY_CURRENT_USER] + [::Win32::Registry::HKEY_CURRENT_USER], ].each do |hkey| desired = hkey.length > 1 ? hkey[1] : ::Win32::Registry::Constants::KEY_READ begin diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index e04efb6b42..a5b0a5dc24 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -131,7 +131,7 @@ EOH "-ExecutionPolicy #{execution_policy}", # Powershell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected - "-InputFormat None" + "-InputFormat None", ] end diff --git a/lib/chef/provider/reboot.rb b/lib/chef/provider/reboot.rb index 22e77dcc13..ab3177ba65 100644 --- a/lib/chef/provider/reboot.rb +++ b/lib/chef/provider/reboot.rb @@ -40,7 +40,7 @@ class Chef :delay_mins => @new_resource.delay_mins, :reason => @new_resource.reason, :timestamp => Time.now, - :requested_by => @new_resource.name + :requested_by => @new_resource.name, ) end diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index f5c370246c..fcebeeb6c6 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -305,7 +305,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service Chef::Log.debug "#{@new_resource.name} setting start_type to #{type}" Win32::Service.configure( :service_name => @new_resource.service_name, - :start_type => allowed_types[type] + :start_type => allowed_types[type], ) @new_resource.updated_by_last_action(true) end diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index 5b506daf81..78769ae758 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -416,7 +416,7 @@ user password using shadow hash.") salt, iterations, 128, - OpenSSL::Digest::SHA512.new + OpenSSL::Digest::SHA512.new, ) end @@ -570,7 +570,7 @@ user password using shadow hash.") :comment => "realname", :password => "passwd", :auth_authority => "authentication_authority", - :shadow_hash => "ShadowHashData" + :shadow_hash => "ShadowHashData", }.freeze # Directory where the user plist files are stored for versions 10.7 and above @@ -701,7 +701,7 @@ user password using shadow hash.") salt, current_resource.iterations, 128, - OpenSSL::Digest::SHA512.new + OpenSSL::Digest::SHA512.new, ).unpack('H*').first == current_resource.password end diff --git a/lib/chef/provider/user/pw.rb b/lib/chef/provider/user/pw.rb index 810ffb9a8d..e53d647f37 100644 --- a/lib/chef/provider/user/pw.rb +++ b/lib/chef/provider/user/pw.rb @@ -75,7 +75,7 @@ class Chef 'home' => "-d", 'gid' => "-g", 'uid' => "-u", - 'shell' => "-s" + 'shell' => "-s", } field_list.sort{ |a,b| a[0] <=> b[0] }.each do |field, option| field_symbol = field.to_sym diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 76519bb498..b0b2d7e956 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -105,7 +105,7 @@ class Chef 'home' => 'home_dir', 'uid' => 'user_id', 'shell' => 'script_path', - 'password' => 'password' + 'password' => 'password', } field_list.sort{ |a,b| a[0] <=> b[0] }.each do |field, option| diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index 42d91a056a..9da79d38e3 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -173,7 +173,7 @@ class Chef arg.each do |action| validate( { action: action }, - { action: { kind_of: Symbol, equal_to: allowed_actions } } + { action: { kind_of: Symbol, equal_to: allowed_actions } }, ) end @action = arg @@ -674,7 +674,7 @@ class Chef end { 'json_class' => self.class.name, - 'instance_vars' => instance_vars + 'instance_vars' => instance_vars, } end diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb index 70c2dd89a3..7a4e3f6988 100644 --- a/lib/chef/resource/cron.rb +++ b/lib/chef/resource/cron.rb @@ -60,7 +60,7 @@ class Chef set_or_return( :minute, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :hour, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :day, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -111,7 +111,7 @@ class Chef set_or_return( :month, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -135,7 +135,7 @@ class Chef set_or_return( :weekday, converted_arg, - :kind_of => [String, Symbol] + :kind_of => [String, Symbol], ) end @@ -143,7 +143,7 @@ class Chef set_or_return( :time, arg, - :equal_to => Chef::Provider::Cron::SPECIAL_TIME_VALUES + :equal_to => Chef::Provider::Cron::SPECIAL_TIME_VALUES, ) end @@ -151,7 +151,7 @@ class Chef set_or_return( :mailto, arg, - :kind_of => String + :kind_of => String, ) end @@ -159,7 +159,7 @@ class Chef set_or_return( :path, arg, - :kind_of => String + :kind_of => String, ) end @@ -167,7 +167,7 @@ class Chef set_or_return( :home, arg, - :kind_of => String + :kind_of => String, ) end @@ -175,7 +175,7 @@ class Chef set_or_return( :shell, arg, - :kind_of => String + :kind_of => String, ) end @@ -183,7 +183,7 @@ class Chef set_or_return( :command, arg, - :kind_of => String + :kind_of => String, ) end @@ -191,7 +191,7 @@ class Chef set_or_return( :user, arg, - :kind_of => String + :kind_of => String, ) end @@ -199,7 +199,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/deploy.rb b/lib/chef/resource/deploy.rb index 5df46fff60..01300cf512 100644 --- a/lib/chef/resource/deploy.rb +++ b/lib/chef/resource/deploy.rb @@ -103,7 +103,7 @@ class Chef set_or_return( :depth, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -112,7 +112,7 @@ class Chef set_or_return( :deploy_to, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :repo, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :repository :repo @@ -129,7 +129,7 @@ class Chef set_or_return( :remote, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -137,7 +137,7 @@ class Chef set_or_return( :role, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -146,7 +146,7 @@ class Chef set_or_return( :restart_command, arg, - :kind_of => [ String, Proc ] + :kind_of => [ String, Proc ], ) end alias :restart :restart_command @@ -155,7 +155,7 @@ class Chef set_or_return( :migrate, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -163,7 +163,7 @@ class Chef set_or_return( :migration_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -171,7 +171,7 @@ class Chef set_or_return( :rollback_on_error, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -179,7 +179,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -187,7 +187,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -195,7 +195,7 @@ class Chef set_or_return( :enable_submodules, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -203,7 +203,7 @@ class Chef set_or_return( :shallow_clone, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -211,7 +211,7 @@ class Chef set_or_return( :repository_cache, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -219,7 +219,7 @@ class Chef set_or_return( :copy_exclude, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -227,7 +227,7 @@ class Chef set_or_return( :revision, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :branch :revision @@ -236,7 +236,7 @@ class Chef set_or_return( :git_ssh_wrapper, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :ssh_wrapper :git_ssh_wrapper @@ -245,7 +245,7 @@ class Chef set_or_return( :svn_username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -253,7 +253,7 @@ class Chef set_or_return( :svn_password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -261,7 +261,7 @@ class Chef set_or_return( :svn_arguments, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -281,7 +281,7 @@ class Chef set_or_return( :scm_provider, klass, - :kind_of => [ Class ] + :kind_of => [ Class ], ) end @@ -295,7 +295,7 @@ class Chef set_or_return( :svn_force_export, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -308,7 +308,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -328,7 +328,7 @@ class Chef set_or_return( :purge_before_symlink, arg, - :kind_of => Array + :kind_of => Array, ) end @@ -344,7 +344,7 @@ class Chef set_or_return( :create_dirs_before_symlink, arg, - :kind_of => Array + :kind_of => Array, ) end @@ -358,7 +358,7 @@ class Chef set_or_return( :symlinks, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -373,7 +373,7 @@ class Chef set_or_return( :symlink_before_migrate, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -405,7 +405,7 @@ class Chef set_or_return( :additional_remotes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -413,7 +413,7 @@ class Chef set_or_return( :enable_checkout, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -421,7 +421,7 @@ class Chef set_or_return( :checkout_branch, arg, - :kind_of => String + :kind_of => String, ) end @@ -434,7 +434,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index 9cac2ce243..b16caaf4b8 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :recursive, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -53,7 +53,7 @@ class Chef set_or_return( :path, arg, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb index 6ffa0ca248..fabe438555 100644 --- a/lib/chef/resource/dsc_resource.rb +++ b/lib/chef/resource/dsc_resource.rb @@ -103,7 +103,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end private diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index c3602fa60e..944c54ea22 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -43,7 +43,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :configuration_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -76,7 +76,7 @@ class Chef set_or_return( :configuration_data, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :configuration_data_script, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -108,7 +108,7 @@ class Chef set_or_return( :flags, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -116,7 +116,7 @@ class Chef set_or_return( :cwd, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -124,7 +124,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -132,7 +132,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end end diff --git a/lib/chef/resource/env.rb b/lib/chef/resource/env.rb index 025bfc72b7..32c12dba09 100644 --- a/lib/chef/resource/env.rb +++ b/lib/chef/resource/env.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :key_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :value, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :delim, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource/erl_call.rb b/lib/chef/resource/erl_call.rb index 1976c54c45..b991fac017 100644 --- a/lib/chef/resource/erl_call.rb +++ b/lib/chef/resource/erl_call.rb @@ -44,7 +44,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -52,7 +52,7 @@ class Chef set_or_return( :cookie, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -60,7 +60,7 @@ class Chef set_or_return( :distributed, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -68,7 +68,7 @@ class Chef set_or_return( :name_type, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -76,7 +76,7 @@ class Chef set_or_return( :node_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index 4f92a7ad35..19138469f8 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -56,7 +56,7 @@ class Chef set_or_return( :umask, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -64,7 +64,7 @@ class Chef set_or_return( :command, arg, - :kind_of => [ String, Array ] + :kind_of => [ String, Array ], ) end @@ -72,7 +72,7 @@ class Chef set_or_return( :creates, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -80,7 +80,7 @@ class Chef set_or_return( :cwd, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -115,7 +115,7 @@ class Chef set_or_return( :path, arg, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -123,7 +123,7 @@ class Chef set_or_return( :returns, arg, - :kind_of => [ Integer, Array ] + :kind_of => [ Integer, Array ], ) end @@ -131,7 +131,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer, Float ] + :kind_of => [ Integer, Float ], ) end @@ -139,7 +139,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -164,7 +164,7 @@ class Chef :environment, :group, :user, - :umask + :umask, ) end diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb index 393a0689fe..62c7bc2600 100644 --- a/lib/chef/resource/git.rb +++ b/lib/chef/resource/git.rb @@ -31,7 +31,7 @@ class Chef set_or_return( :additional_remotes, arg, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb index 2e80f32fea..2f829a4b44 100644 --- a/lib/chef/resource/group.rb +++ b/lib/chef/resource/group.rb @@ -42,7 +42,7 @@ class Chef set_or_return( :group_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -50,7 +50,7 @@ class Chef set_or_return( :gid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -59,7 +59,7 @@ class Chef set_or_return( :members, converted_members, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :excluded_members, converted_members, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -79,7 +79,7 @@ class Chef set_or_return( :append, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :system, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -95,7 +95,7 @@ class Chef set_or_return( :non_unique, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end end diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb index f9f056325a..73ab64b62e 100644 --- a/lib/chef/resource/http_request.rb +++ b/lib/chef/resource/http_request.rb @@ -40,7 +40,7 @@ class Chef set_or_return( :url, args, - :kind_of => String + :kind_of => String, ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :message, args, - :kind_of => Object + :kind_of => Object, ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :headers, args, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb index 527eb0e515..0587c760b4 100644 --- a/lib/chef/resource/ifconfig.rb +++ b/lib/chef/resource/ifconfig.rb @@ -50,7 +50,7 @@ class Chef set_or_return( :target, arg, - :kind_of => String + :kind_of => String, ) end @@ -58,7 +58,7 @@ class Chef set_or_return( :device, arg, - :kind_of => String + :kind_of => String, ) end @@ -66,7 +66,7 @@ class Chef set_or_return( :hwaddr, arg, - :kind_of => String + :kind_of => String, ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :inet_addr, arg, - :kind_of => String + :kind_of => String, ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :bcast, arg, - :kind_of => String + :kind_of => String, ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :mask, arg, - :kind_of => String + :kind_of => String, ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :mtu, arg, - :kind_of => String + :kind_of => String, ) end @@ -106,7 +106,7 @@ class Chef set_or_return( :metric, arg, - :kind_of => String + :kind_of => String, ) end @@ -114,7 +114,7 @@ class Chef set_or_return( :onboot, arg, - :kind_of => String + :kind_of => String, ) end @@ -122,7 +122,7 @@ class Chef set_or_return( :network, arg, - :kind_of => String + :kind_of => String, ) end @@ -130,7 +130,7 @@ class Chef set_or_return( :bootproto, arg, - :kind_of => String + :kind_of => String, ) end @@ -138,7 +138,7 @@ class Chef set_or_return( :onparent, arg, - :kind_of => String + :kind_of => String, ) end end diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb index f932383cc1..de8619203a 100644 --- a/lib/chef/resource/link.rb +++ b/lib/chef/resource/link.rb @@ -44,7 +44,7 @@ class Chef set_or_return( :to, arg, - :kind_of => String + :kind_of => String, ) end @@ -52,7 +52,7 @@ class Chef set_or_return( :target_file, arg, - :kind_of => String + :kind_of => String, ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :link_type, real_arg, - :equal_to => [ :symbolic, :hard ] + :equal_to => [ :symbolic, :hard ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index 9adffb26bb..206bbf4867 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -58,7 +58,7 @@ class Chef set_or_return( :message, arg, - :kind_of => String + :kind_of => String, ) end @@ -67,7 +67,7 @@ class Chef set_or_return( :level, arg, - :equal_to => [ :debug, :info, :warn, :error, :fatal ] + :equal_to => [ :debug, :info, :warn, :error, :fatal ], ) end diff --git a/lib/chef/resource/macosx_service.rb b/lib/chef/resource/macosx_service.rb index f1ed4051cb..e581b8746d 100644 --- a/lib/chef/resource/macosx_service.rb +++ b/lib/chef/resource/macosx_service.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :plist, arg, - :kind_of => String + :kind_of => String, ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :session_type, arg, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/mdadm.rb b/lib/chef/resource/mdadm.rb index b789fab155..93430a656f 100644 --- a/lib/chef/resource/mdadm.rb +++ b/lib/chef/resource/mdadm.rb @@ -46,7 +46,7 @@ class Chef set_or_return( :chunk, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :devices, arg, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -62,7 +62,7 @@ class Chef set_or_return( :exists, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :level, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -78,7 +78,7 @@ class Chef set_or_return( :metadata, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -86,7 +86,7 @@ class Chef set_or_return( :bitmap, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :raid_device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb index a5da0ba329..eefa03a506 100644 --- a/lib/chef/resource/mount.rb +++ b/lib/chef/resource/mount.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :mount_point, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -60,7 +60,7 @@ class Chef set_or_return( :device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :device_type, real_arg, - :equal_to => valid_devices + :equal_to => valid_devices, ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :fsck_device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :fstype, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -98,7 +98,7 @@ class Chef ret = set_or_return( :options, arg, - :kind_of => [ Array, String ] + :kind_of => [ Array, String ], ) if ret.is_a? String @@ -112,7 +112,7 @@ class Chef set_or_return( :dump, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :pass, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -128,7 +128,7 @@ class Chef set_or_return( :mounted, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :enabled, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -154,7 +154,7 @@ class Chef set_or_return( :username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -162,7 +162,7 @@ class Chef set_or_return( :password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -170,7 +170,7 @@ class Chef set_or_return( :domain, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb index 9425e55c0c..8be334fea9 100644 --- a/lib/chef/resource/ohai.rb +++ b/lib/chef/resource/ohai.rb @@ -37,7 +37,7 @@ class Chef set_or_return( :plugin, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -45,7 +45,7 @@ class Chef set_or_return( :name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb index 26b834a9c0..837ab5400b 100644 --- a/lib/chef/resource/osx_profile.rb +++ b/lib/chef/resource/osx_profile.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :profile_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :profile, arg, - :kind_of => [ String, Hash ] + :kind_of => [ String, Hash ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :identifier, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :path, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb index 7d432883e4..1f1171390e 100644 --- a/lib/chef/resource/powershell_script.rb +++ b/lib/chef/resource/powershell_script.rb @@ -31,7 +31,7 @@ class Chef set_or_return( :convert_boolean_return, arg, - :kind_of => [ FalseClass, TrueClass ] + :kind_of => [ FalseClass, TrueClass ], ) end diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb index f1bf7954ce..2faa5243fb 100644 --- a/lib/chef/resource/registry_key.rb +++ b/lib/chef/resource/registry_key.rb @@ -71,7 +71,7 @@ class Chef set_or_return( :key, arg, - :kind_of => String + :kind_of => String, ) end @@ -105,7 +105,7 @@ class Chef set_or_return( :recursive, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -113,7 +113,7 @@ class Chef set_or_return( :architecture, arg, - :kind_of => Symbol + :kind_of => Symbol, ) end diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb index b731f7b201..56473c6420 100644 --- a/lib/chef/resource/remote_directory.rb +++ b/lib/chef/resource/remote_directory.rb @@ -58,7 +58,7 @@ class Chef set_or_return( :source, args, - :kind_of => String + :kind_of => String, ) end @@ -66,7 +66,7 @@ class Chef set_or_return( :files_backup, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :purge, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :files_group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :files_mode, arg, - :regex => /^\d{3,4}$/ + :regex => /^\d{3,4}$/, ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :files_owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end @@ -106,7 +106,7 @@ class Chef set_or_return( :overwrite, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -114,7 +114,7 @@ class Chef set_or_return( :cookbook, args, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index b7a553cbe8..bd0aa5ced7 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -76,7 +76,7 @@ class Chef set_or_return( :checksum, args, - :kind_of => String + :kind_of => String, ) end @@ -92,7 +92,7 @@ class Chef set_or_return( :use_etag, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -102,7 +102,7 @@ class Chef set_or_return( :use_last_modified, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -110,7 +110,7 @@ class Chef set_or_return( :ftp_active_mode, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -118,7 +118,7 @@ class Chef set_or_return( :headers, args, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb index 3ba8f6215b..a8c9ebd8fe 100644 --- a/lib/chef/resource/route.rb +++ b/lib/chef/resource/route.rb @@ -48,7 +48,7 @@ class Chef set_or_return( :networking, arg, - :kind_of => String + :kind_of => String, ) end @@ -56,7 +56,7 @@ class Chef set_or_return( :networking_ipv6, arg, - :kind_of => String + :kind_of => String, ) end @@ -64,7 +64,7 @@ class Chef set_or_return( :hostname, arg, - :kind_of => String + :kind_of => String, ) end @@ -72,7 +72,7 @@ class Chef set_or_return( :domainname, arg, - :kind_of => String + :kind_of => String, ) end @@ -80,7 +80,7 @@ class Chef set_or_return( :domain, arg, - :kind_of => String + :kind_of => String, ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :target, arg, - :kind_of => String + :kind_of => String, ) end @@ -96,7 +96,7 @@ class Chef set_or_return( :netmask, arg, - :kind_of => String + :kind_of => String, ) end @@ -104,7 +104,7 @@ class Chef set_or_return( :gateway, arg, - :kind_of => String + :kind_of => String, ) end @@ -112,7 +112,7 @@ class Chef set_or_return( :metric, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :device, arg, - :kind_of => String + :kind_of => String, ) end @@ -129,7 +129,7 @@ class Chef set_or_return( :route_type, real_arg, - :equal_to => [ :host, :net ] + :equal_to => [ :host, :net ], ) end end diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb index ae8e4cb7cd..f529289b1b 100644 --- a/lib/chef/resource/ruby_block.rb +++ b/lib/chef/resource/ruby_block.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :block_name, arg, - :kind_of => String + :kind_of => String, ) end end diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb index 85028c266b..b81a3bfb24 100644 --- a/lib/chef/resource/scm.rb +++ b/lib/chef/resource/scm.rb @@ -46,7 +46,7 @@ class Chef set_or_return( :destination, arg, - :kind_of => String + :kind_of => String, ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :repository, arg, - :kind_of => String + :kind_of => String, ) end @@ -62,7 +62,7 @@ class Chef set_or_return( :revision, arg, - :kind_of => String + :kind_of => String, ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [String, Integer] + :kind_of => [String, Integer], ) end @@ -78,7 +78,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [String, Integer] + :kind_of => [String, Integer], ) end @@ -86,7 +86,7 @@ class Chef set_or_return( :svn_username, arg, - :kind_of => String + :kind_of => String, ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :svn_password, arg, - :kind_of => String + :kind_of => String, ) end @@ -103,7 +103,7 @@ class Chef set_or_return( :svn_arguments, arg, - :kind_of => String + :kind_of => String, ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :depth, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -128,7 +128,7 @@ class Chef set_or_return( :enable_submodules, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :enable_checkout, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -144,7 +144,7 @@ class Chef set_or_return( :remote, arg, - :kind_of => String + :kind_of => String, ) end @@ -152,7 +152,7 @@ class Chef set_or_return( :ssh_wrapper, arg, - :kind_of => String + :kind_of => String, ) end @@ -160,7 +160,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -168,7 +168,7 @@ class Chef set_or_return( :checkout_branch, arg, - :kind_of => String + :kind_of => String, ) end @@ -176,7 +176,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index 5081adf918..1579b06eba 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -49,7 +49,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :interpreter, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :flags, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 6d1b81f9cb..809eb5f2cb 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :service_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :pattern, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :start_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -79,7 +79,7 @@ class Chef set_or_return( :stop_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :status_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -97,7 +97,7 @@ class Chef set_or_return( :restart_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -105,7 +105,7 @@ class Chef set_or_return( :reload_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -118,7 +118,7 @@ class Chef set_or_return( :init_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -127,7 +127,7 @@ class Chef set_or_return( :enabled, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :running, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -154,7 +154,7 @@ class Chef set_or_return( :priority, arg, - :kind_of => [ Integer, String, Hash ] + :kind_of => [ Integer, String, Hash ], ) end @@ -163,7 +163,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -171,7 +171,7 @@ class Chef set_or_return( :parameters, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 5a7f7efd6f..1d8d690c1a 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :source, file, - :kind_of => [ String, Array ] + :kind_of => [ String, Array ], ) end @@ -53,7 +53,7 @@ class Chef set_or_return( :variables, args, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :cookbook, args, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :local, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb index b85b648c92..f9c272170c 100644 --- a/lib/chef/resource/user.rb +++ b/lib/chef/resource/user.rb @@ -43,7 +43,7 @@ class Chef @non_unique = false @supports = { :manage_home => false, - :non_unique => false + :non_unique => false, } @iterations = 27855 @salt = nil @@ -53,7 +53,7 @@ class Chef set_or_return( :username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :comment, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :uid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :gid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :home, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -95,7 +95,7 @@ class Chef set_or_return( :shell, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -103,7 +103,7 @@ class Chef set_or_return( :password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -111,7 +111,7 @@ class Chef set_or_return( :salt, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -119,7 +119,7 @@ class Chef set_or_return( :iterations, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -127,7 +127,7 @@ class Chef set_or_return( :system, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -135,7 +135,7 @@ class Chef set_or_return( :manage_home, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -143,7 +143,7 @@ class Chef set_or_return( :force, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -151,7 +151,7 @@ class Chef set_or_return( :non_unique, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb index 2dff4cde31..8fb9ef9e0d 100644 --- a/lib/chef/resource/windows_script.rb +++ b/lib/chef/resource/windows_script.rb @@ -45,7 +45,7 @@ class Chef result = set_or_return( :architecture, arg, - :kind_of => Symbol + :kind_of => Symbol, ) end diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb index a77690652e..f7ec02a294 100644 --- a/lib/chef/resource/windows_service.rb +++ b/lib/chef/resource/windows_service.rb @@ -47,7 +47,7 @@ class Chef set_or_return( :startup_type, arg, - :equal_to => [ :automatic, :manual, :disabled ] + :equal_to => [ :automatic, :manual, :disabled ], ) end @@ -55,7 +55,7 @@ class Chef set_or_return( :run_as_user, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -63,7 +63,7 @@ class Chef set_or_return( :run_as_password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource_collection/resource_collection_serialization.rb b/lib/chef/resource_collection/resource_collection_serialization.rb index 3651fb2a2a..738671e20b 100644 --- a/lib/chef/resource_collection/resource_collection_serialization.rb +++ b/lib/chef/resource_collection/resource_collection_serialization.rb @@ -26,7 +26,7 @@ class Chef end { 'json_class' => self.class.name, - 'instance_vars' => instance_vars + 'instance_vars' => instance_vars, } end diff --git a/lib/chef/role.rb b/lib/chef/role.rb index 6984a8a245..d1854ed44d 100644 --- a/lib/chef/role.rb +++ b/lib/chef/role.rb @@ -57,7 +57,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_]+$/ + :regex => /^[\-[:alnum:]_]+$/, ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :description, arg, - :kind_of => String + :kind_of => String, ) end @@ -121,7 +121,7 @@ class Chef set_or_return( :default_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -129,7 +129,7 @@ class Chef set_or_return( :override_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -150,7 +150,7 @@ class Chef "env_run_lists" => env_run_lists_without_default.inject({}) do |accumulator, (k, v)| accumulator[k] = v.map { |x| x.to_s } accumulator - end + end, } result end diff --git a/lib/chef/user.rb b/lib/chef/user.rb index 1bcef448ff..0944bc05c8 100644 --- a/lib/chef/user.rb +++ b/lib/chef/user.rb @@ -81,7 +81,7 @@ class Chef result = { "name" => @name, "public_key" => @public_key, - "admin" => @admin + "admin" => @admin, } result["private_key"] = @private_key if @private_key result["password"] = @password if @password diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index 1bded3500f..033c71548c 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -146,7 +146,7 @@ class Chef :first_name => @first_name, :last_name => @last_name, :email => @email, - :password => @password + :password => @password, } payload[:public_key] = @public_key unless @public_key.nil? payload[:create_key] = @create_key unless @create_key.nil? @@ -172,7 +172,7 @@ class Chef :first_name => @first_name, :last_name => @last_name, :email => @email, - :password => @password + :password => @password, } payload[:middle_name] = @middle_name unless @middle_name.nil? payload[:public_key] = @public_key unless @public_key.nil? diff --git a/lib/chef/win32/api/crypto.rb b/lib/chef/win32/api/crypto.rb index 1837a57557..cf32287a17 100644 --- a/lib/chef/win32/api/crypto.rb +++ b/lib/chef/win32/api/crypto.rb @@ -1,63 +1,63 @@ -#
-# Author:: Jay Mundrawala (<jdm@chef.io>)
-# Copyright:: Copyright 2015 Chef Software, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'chef/win32/api'
-
-class Chef
- module ReservedNames::Win32
- module API
- module Crypto
- extend Chef::ReservedNames::Win32::API
-
- ###############################################
- # Win32 API Bindings
- ###############################################
-
- ffi_lib 'Crypt32'
-
- CRYPTPROTECT_UI_FORBIDDEN = 0x1
- CRYPTPROTECT_LOCAL_MACHINE = 0x4
- CRYPTPROTECT_AUDIT = 0x10
-
- class CRYPT_INTEGER_BLOB < FFI::Struct
- layout :cbData, :DWORD, # Count, in bytes, of data
- :pbData, :pointer # Pointer to data buffer
- def initialize(str=nil)
- super(nil)
- if str
- self[:pbData] = FFI::MemoryPointer.from_string(str)
- self[:cbData] = str.bytesize
- end
- end
-
- end
-
- safe_attach_function :CryptProtectData, [
- :PDATA_BLOB,
- :LPCWSTR,
- :PDATA_BLOB,
- :pointer,
- :PCRYPTPROTECT_PROMPTSTRUCT,
- :DWORD,
- :PDATA_BLOB
- ], :BOOL
-
- end
- end
- end
-end
+# +# Author:: Jay Mundrawala (<jdm@chef.io>) +# Copyright:: Copyright 2015 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/win32/api' + +class Chef + module ReservedNames::Win32 + module API + module Crypto + extend Chef::ReservedNames::Win32::API + + ############################################### + # Win32 API Bindings + ############################################### + + ffi_lib 'Crypt32' + + CRYPTPROTECT_UI_FORBIDDEN = 0x1 + CRYPTPROTECT_LOCAL_MACHINE = 0x4 + CRYPTPROTECT_AUDIT = 0x10 + + class CRYPT_INTEGER_BLOB < FFI::Struct + layout :cbData, :DWORD, # Count, in bytes, of data + :pbData, :pointer # Pointer to data buffer + def initialize(str=nil) + super(nil) + if str + self[:pbData] = FFI::MemoryPointer.from_string(str) + self[:cbData] = str.bytesize + end + end + + end + + safe_attach_function :CryptProtectData, [ + :PDATA_BLOB, + :LPCWSTR, + :PDATA_BLOB, + :pointer, + :PCRYPTPROTECT_PROMPTSTRUCT, + :DWORD, + :PDATA_BLOB, + ], :BOOL + + end + end + end +end diff --git a/lib/chef/win32/api/security.rb b/lib/chef/win32/api/security.rb index 4353c488f8..06fdf650f4 100644 --- a/lib/chef/win32/api/security.rb +++ b/lib/chef/win32/api/security.rb @@ -239,7 +239,7 @@ class Chef :SE_DS_OBJECT_ALL, :SE_PROVIDER_DEFINED_OBJECT, :SE_WMIGUID_OBJECT, - :SE_REGISTRY_WOW64_32KEY + :SE_REGISTRY_WOW64_32KEY, ] SID_NAME_USE = enum :SID_NAME_USE, [ @@ -312,7 +312,7 @@ class Chef :SecurityAnonymous, :SecurityIdentification, :SecurityImpersonation, - :SecurityDelegation + :SecurityDelegation, ] @@ -351,7 +351,7 @@ class Chef ACCESS_ALLOWED_ACE_TYPE, ACCESS_DENIED_ACE_TYPE, SYSTEM_AUDIT_ACE_TYPE, - SYSTEM_ALARM_ACE_TYPE + SYSTEM_ALARM_ACE_TYPE, ].include?(ace_type) end end diff --git a/lib/chef/win32/file/version_info.rb b/lib/chef/win32/file/version_info.rb index 2974c8a695..30e9604ad1 100644 --- a/lib/chef/win32/file/version_info.rb +++ b/lib/chef/win32/file/version_info.rb @@ -45,7 +45,7 @@ class Chef :ProductName, :ProductVersion, :PrivateBuild, - :SpecialBuild + :SpecialBuild, ].each do |method| define_method method do begin diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index c0cf564621..9e4f90b1b7 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -62,7 +62,7 @@ class Chef usri3_primary_group_id: DOMAIN_GROUP_RID_USERS, usri3_profile: nil, usri3_home_dir_drive: nil, - usri3_password_expired: 0 + usri3_password_expired: 0, }.each do |(k,v)| s.set(k, v) end diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 3c1f62d9b8..af8de59d0f 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -326,7 +326,7 @@ class Chef :expand_string => ::Win32::Registry::REG_EXPAND_SZ, :dword => ::Win32::Registry::REG_DWORD, :dword_big_endian => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - :qword => ::Win32::Registry::REG_QWORD + :qword => ::Win32::Registry::REG_QWORD, } end @@ -342,7 +342,7 @@ class Chef 2 => ::Win32::Registry::REG_EXPAND_SZ, 4 => ::Win32::Registry::REG_DWORD, 5 => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - 11 => ::Win32::Registry::REG_QWORD + 11 => ::Win32::Registry::REG_QWORD, }[val_type] return value end diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb index 6a7a65b01b..ca715dd604 100644 --- a/lib/chef/win32/version.rb +++ b/lib/chef/win32/version.rb @@ -62,7 +62,7 @@ class Chef "Windows Home Server" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| (suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER }}, "Windows Server 2003" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| get_system_metrics(SM_SERVERR2) == 0 }}, "Windows XP" => {:major => 5, :minor => 1}, - "Windows 2000" => {:major => 5, :minor => 0} + "Windows 2000" => {:major => 5, :minor => 0}, } def initialize diff --git a/spec/functional/file_content_management/deploy_strategies_spec.rb b/spec/functional/file_content_management/deploy_strategies_spec.rb index 48aaa29fbf..793da28ef9 100644 --- a/spec/functional/file_content_management/deploy_strategies_spec.rb +++ b/spec/functional/file_content_management/deploy_strategies_spec.rb @@ -180,7 +180,7 @@ describe Chef::FileContentManagement::Deploy::Cp do :uid, :gid, :mode, - :ino + :ino, ] end @@ -188,7 +188,7 @@ describe Chef::FileContentManagement::Deploy::Cp do [ :owner, :group, - :dacl + :dacl, ] end @@ -202,7 +202,7 @@ describe Chef::FileContentManagement::Deploy::MvUnix, :unix_only do [ :uid, :gid, - :mode + :mode, ] end @@ -220,7 +220,7 @@ describe Chef::FileContentManagement::Deploy::MvWindows, :windows_only do [ :owner, :group, - :dacl + :dacl, ] end diff --git a/spec/functional/notifications_spec.rb b/spec/functional/notifications_spec.rb index f14f35ebba..d448ea175d 100644 --- a/spec/functional/notifications_spec.rb +++ b/spec/functional/notifications_spec.rb @@ -106,7 +106,7 @@ describe "Notifications" do { resource: package_resource.to_s, action: :install, notification_type: :before, notifying_resource: log_resource.to_s }, # Then it runs the actual action { resource: log_resource.to_s, action: :write }, - { resource: package_resource.to_s, action: :nothing } + { resource: package_resource.to_s, action: :nothing }, ] end @@ -140,7 +140,7 @@ describe "Notifications" do # Then it does NOT run the before action # Then it runs the actual action { resource: log_resource.to_s, action: :write }, - { resource: package_resource.to_s, action: :nothing } + { resource: package_resource.to_s, action: :nothing }, ] end diff --git a/spec/functional/rebooter_spec.rb b/spec/functional/rebooter_spec.rb index a0e2665de5..79f3a49010 100644 --- a/spec/functional/rebooter_spec.rb +++ b/spec/functional/rebooter_spec.rb @@ -24,7 +24,7 @@ describe Chef::Platform::Rebooter do { :delay_mins => 5, :requested_by => "reboot resource functional test", - :reason => "rebooter spec test" + :reason => "rebooter spec test", } end @@ -44,7 +44,7 @@ describe Chef::Platform::Rebooter do let(:expected) do { :windows => 'shutdown /r /t 300 /c "rebooter spec test"', - :linux => 'shutdown -r +5 "rebooter spec test"' + :linux => 'shutdown -r +5 "rebooter spec test"', } end diff --git a/spec/functional/resource/execute_spec.rb b/spec/functional/resource/execute_spec.rb index 692ccfb796..9369a8050d 100644 --- a/spec/functional/resource/execute_spec.rb +++ b/spec/functional/resource/execute_spec.rb @@ -89,7 +89,7 @@ describe Chef::Resource::Execute do resource.environment({ "SAWS_SECRET" => "supersecret", "SAWS_KEY" => "qwerty", - }) + },) end it "guard inherits :environment value from resource and runs" do diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb index 7e903b30b4..6b214f0b16 100644 --- a/spec/functional/resource/link_spec.rb +++ b/spec/functional/resource/link_spec.rb @@ -422,7 +422,7 @@ describe Chef::Resource::Link do { '../' => 'with a relative link destination', - '' => 'with a bare filename for the link destination' + '' => 'with a bare filename for the link destination', }.each do |prefix, desc| context desc do let(:to) { "#{prefix}#{File.basename(absolute_to)}" } diff --git a/spec/functional/resource/package_spec.rb b/spec/functional/resource/package_spec.rb index 25ec872b9b..00120afc29 100644 --- a/spec/functional/resource/package_spec.rb +++ b/spec/functional/resource/package_spec.rb @@ -54,7 +54,7 @@ module AptServer :DocumentRoot => apt_data_dir + "/var/www/apt", # Make WEBrick quiet, comment out for debug. :Logger => Logger.new(StringIO.new), - :AccessLog => [ StringIO.new, WEBrick::AccessLog::COMMON_LOG_FORMAT ] + :AccessLog => [ StringIO.new, WEBrick::AccessLog::COMMON_LOG_FORMAT ], ) end diff --git a/spec/functional/resource/reboot_spec.rb b/spec/functional/resource/reboot_spec.rb index 99de136827..da3775ef20 100644 --- a/spec/functional/resource/reboot_spec.rb +++ b/spec/functional/resource/reboot_spec.rb @@ -24,7 +24,7 @@ describe Chef::Resource::Reboot do { :delay_mins => 5, :requested_by => "reboot resource functional test", - :reason => "reboot resource spec test" + :reason => "reboot resource spec test", } end diff --git a/spec/functional/resource/remote_directory_spec.rb b/spec/functional/resource/remote_directory_spec.rb index 37ffbbc971..669ee60831 100644 --- a/spec/functional/resource/remote_directory_spec.rb +++ b/spec/functional/resource/remote_directory_spec.rb @@ -64,7 +64,7 @@ describe Chef::Resource::RemoteDirectory do File.join(path, 'remotesubdir', 'remote_subdir_file1.txt'), File.join(path, 'remotesubdir', 'remote_subdir_file2.txt'), File.join(path, 'remotesubdir', '.a_dotfile'), - File.join(path, '.a_dotdir', '.a_dotfile_in_a_dotdir') + File.join(path, '.a_dotdir', '.a_dotfile_in_a_dotdir'), ] end diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb index 474f6a4ecf..2750d33fd1 100644 --- a/spec/functional/resource/user/useradd_spec.rb +++ b/spec/functional/resource/user/useradd_spec.rb @@ -33,7 +33,7 @@ end metadata = { :unix_only => true, :requires_root => true, :not_supported_on_mac_osx => true, - :provider => {:user => user_provider_for_platform} + :provider => {:user => user_provider_for_platform}, } describe Chef::Provider::User::Useradd, metadata do diff --git a/spec/functional/resource/windows_service_spec.rb b/spec/functional/resource/windows_service_spec.rb index 9ee4adde87..bbefb49623 100644 --- a/spec/functional/resource/windows_service_spec.rb +++ b/spec/functional/resource/windows_service_spec.rb @@ -49,7 +49,7 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_ service_display_name: "windows_service spec #{id}}", service_description: "Test service for running the windows_service functional spec.", service_file_path: global_service_file_path, - } ) + }, ) } let(:manager) { diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb index 908657e5f7..31525cdf25 100644 --- a/spec/integration/knife/chef_repo_path_spec.rb +++ b/spec/integration/knife/chef_repo_path_spec.rb @@ -278,7 +278,7 @@ EOM %w(client cookbook data_bag environment node role user).each do |object_name| Chef::Config["#{object_name}_path".to_sym] = [ File.join(Chef::Config.chef_repo_path, "#{object_name}s"), - File.join(Chef::Config.chef_repo_path, "#{object_name}s2") + File.join(Chef::Config.chef_repo_path, "#{object_name}s2"), ] end Chef::Config.chef_repo_path = File.join(Chef::Config.chef_repo_path, 'chef_repo2') @@ -516,7 +516,7 @@ EOM end Chef::Config.chef_repo_path = [ Chef::Config.chef_repo_path, - File.join(Chef::Config.chef_repo_path, 'chef_repo2') + File.join(Chef::Config.chef_repo_path, 'chef_repo2'), ] end @@ -677,7 +677,7 @@ EOM Chef::Config.delete(:chef_repo_path) Chef::Config.cookbook_path = [ File.join(@repository_dir, 'cookbooks'), - File.join(@repository_dir, 'chef_repo2', 'cookbooks') + File.join(@repository_dir, 'chef_repo2', 'cookbooks'), ] end diff --git a/spec/integration/knife/chefignore_spec.rb b/spec/integration/knife/chefignore_spec.rb index 34bf391f88..10cfbbf557 100644 --- a/spec/integration/knife/chefignore_spec.rb +++ b/spec/integration/knife/chefignore_spec.rb @@ -216,7 +216,7 @@ EOM before :each do Chef::Config.cookbook_path = [ File.join(Chef::Config.chef_repo_path, 'cookbooks1'), - File.join(Chef::Config.chef_repo_path, 'cookbooks2') + File.join(Chef::Config.chef_repo_path, 'cookbooks2'), ] end @@ -285,7 +285,7 @@ EOM before :each do Chef::Config.cookbook_path = [ File.join(Chef::Config.chef_repo_path, 'cookbooks1'), - File.join(Chef::Config.chef_repo_path, 'cookbooks2') + File.join(Chef::Config.chef_repo_path, 'cookbooks2'), ] end it 'knife list -Rfp /cookbooks shows the chefignore cookbook' do diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb index b7333cefda..6861913d59 100644 --- a/spec/integration/knife/deps_spec.rb +++ b/spec/integration/knife/deps_spec.rb @@ -218,13 +218,13 @@ depends "self"' it 'knife deps prints each once' do knife('deps /cookbooks/foo /cookbooks/self').should_succeed( stdout: "/cookbooks/baz\n/cookbooks/bar\n/cookbooks/foo\n/cookbooks/self\n", - stderr: "WARN: Ignoring self-dependency in cookbook self, please remove it (in the future this will be fatal).\n" + stderr: "WARN: Ignoring self-dependency in cookbook self, please remove it (in the future this will be fatal).\n", ) end it 'knife deps --tree prints each once' do knife('deps --tree /cookbooks/foo /cookbooks/self').should_succeed( stdout: "/cookbooks/foo\n /cookbooks/bar\n /cookbooks/baz\n /cookbooks/foo\n/cookbooks/self\n", - stderr: "WARN: Ignoring self-dependency in cookbook self, please remove it (in the future this will be fatal).\n" + stderr: "WARN: Ignoring self-dependency in cookbook self, please remove it (in the future this will be fatal).\n", ) end end @@ -258,42 +258,42 @@ EOM knife('deps /blah').should_fail( :exit_code => 2, :stdout => "/blah\n", - :stderr => "ERROR: /blah: No such file or directory\n" + :stderr => "ERROR: /blah: No such file or directory\n", ) end it 'knife deps /roles/x.json reports an error' do knife('deps /roles/x.json').should_fail( :exit_code => 2, :stdout => "/roles/x.json\n", - :stderr => "ERROR: /roles/x.json: No such file or directory\n" + :stderr => "ERROR: /roles/x.json: No such file or directory\n", ) end it 'knife deps /nodes/x.json reports an error' do knife('deps /nodes/x.json').should_fail( :exit_code => 2, :stdout => "/nodes/x.json\n", - :stderr => "ERROR: /nodes/x.json: No such file or directory\n" + :stderr => "ERROR: /nodes/x.json: No such file or directory\n", ) end it 'knife deps /environments/x.json reports an error' do knife('deps /environments/x.json').should_fail( :exit_code => 2, :stdout => "/environments/x.json\n", - :stderr => "ERROR: /environments/x.json: No such file or directory\n" + :stderr => "ERROR: /environments/x.json: No such file or directory\n", ) end it 'knife deps /cookbooks/x reports an error' do knife('deps /cookbooks/x').should_fail( :exit_code => 2, :stdout => "/cookbooks/x\n", - :stderr => "ERROR: /cookbooks/x: No such file or directory\n" + :stderr => "ERROR: /cookbooks/x: No such file or directory\n", ) end it 'knife deps /data_bags/bag/item reports an error' do knife('deps /data_bags/bag/item').should_fail( :exit_code => 2, :stdout => "/data_bags/bag/item\n", - :stderr => "ERROR: /data_bags/bag/item: No such file or directory\n" + :stderr => "ERROR: /data_bags/bag/item: No such file or directory\n", ) end end @@ -305,7 +305,7 @@ EOM knife('deps /roles/starring.json').should_fail( :exit_code => 2, :stdout => "/cookbooks/quiche\n/roles/starring.json\n", - :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n" + :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n", ) end end @@ -317,7 +317,7 @@ EOM knife('deps /nodes/mort.json').should_fail( :exit_code => 2, :stdout => "/environments/desert.json\n/nodes/mort.json\n", - :stderr => "ERROR: /environments/desert.json: No such file or directory\n" + :stderr => "ERROR: /environments/desert.json: No such file or directory\n", ) end end @@ -329,7 +329,7 @@ EOM knife('deps /roles/starring.json').should_fail( :exit_code => 2, :stdout => "/roles/minor.json\n/roles/starring.json\n", - :stderr => "ERROR: /roles/minor.json: No such file or directory\n" + :stderr => "ERROR: /roles/minor.json: No such file or directory\n", ) end end @@ -343,7 +343,7 @@ EOM knife('deps /roles').should_fail( :exit_code => 2, :stderr => "ERROR: /roles: No such file or directory\n", - :stdout => "/roles\n" + :stdout => "/roles\n", ) end end @@ -596,42 +596,42 @@ EOM knife('deps --remote /blah').should_fail( :exit_code => 2, :stdout => "/blah\n", - :stderr => "ERROR: /blah: No such file or directory\n" + :stderr => "ERROR: /blah: No such file or directory\n", ) end it 'knife deps /roles/x.json reports an error' do knife('deps --remote /roles/x.json').should_fail( :exit_code => 2, :stdout => "/roles/x.json\n", - :stderr => "ERROR: /roles/x.json: No such file or directory\n" + :stderr => "ERROR: /roles/x.json: No such file or directory\n", ) end it 'knife deps /nodes/x.json reports an error' do knife('deps --remote /nodes/x.json').should_fail( :exit_code => 2, :stdout => "/nodes/x.json\n", - :stderr => "ERROR: /nodes/x.json: No such file or directory\n" + :stderr => "ERROR: /nodes/x.json: No such file or directory\n", ) end it 'knife deps /environments/x.json reports an error' do knife('deps --remote /environments/x.json').should_fail( :exit_code => 2, :stdout => "/environments/x.json\n", - :stderr => "ERROR: /environments/x.json: No such file or directory\n" + :stderr => "ERROR: /environments/x.json: No such file or directory\n", ) end it 'knife deps /cookbooks/x reports an error' do knife('deps --remote /cookbooks/x').should_fail( :exit_code => 2, :stdout => "/cookbooks/x\n", - :stderr => "ERROR: /cookbooks/x: No such file or directory\n" + :stderr => "ERROR: /cookbooks/x: No such file or directory\n", ) end it 'knife deps /data_bags/bag/item reports an error' do knife('deps --remote /data_bags/bag/item').should_fail( :exit_code => 2, :stdout => "/data_bags/bag/item\n", - :stderr => "ERROR: /data_bags/bag/item: No such file or directory\n" + :stderr => "ERROR: /data_bags/bag/item: No such file or directory\n", ) end end @@ -643,7 +643,7 @@ EOM knife('deps --remote /roles/starring.json').should_fail( :exit_code => 2, :stdout => "/cookbooks/quiche\n/roles/starring.json\n", - :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n" + :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n", ) end end @@ -655,7 +655,7 @@ EOM knife('deps --remote /nodes/mort.json').should_fail( :exit_code => 2, :stdout => "/environments/desert.json\n/nodes/mort.json\n", - :stderr => "ERROR: /environments/desert.json: No such file or directory\n" + :stderr => "ERROR: /environments/desert.json: No such file or directory\n", ) end end @@ -667,7 +667,7 @@ EOM knife('deps --remote /roles/starring.json').should_fail( :exit_code => 2, :stdout => "/roles/minor.json\n/roles/starring.json\n", - :stderr => "ERROR: /roles/minor.json: No such file or directory\n" + :stderr => "ERROR: /roles/minor.json: No such file or directory\n", ) end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index 0c334fc65c..24618ebcae 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -314,7 +314,7 @@ EOM data_bag 'x', { 'added' => {}, 'modified' => { 'foo' => 'bar' }, - 'unmodified' => {} + 'unmodified' => {}, } end @@ -810,7 +810,7 @@ EOM data_bag 'x', { 'added' => {}, 'modified' => { 'foo' => 'bar' }, - 'unmodified' => {} + 'unmodified' => {}, } end @@ -1184,7 +1184,7 @@ EOM policy_group 'x', { 'policies' => { 'x' => { 'revision_id' => '1.0.0' }, - 'blah' => { 'revision_id' => '1.0.0' } + 'blah' => { 'revision_id' => '1.0.0' }, } } role 'x', {} @@ -1267,7 +1267,7 @@ EOM file 'policy_groups/x.json', { 'policies' => { 'x' => { 'revision_id' => '1.0.1' }, - 'y' => { 'revision_id' => '1.0.0' } + 'y' => { 'revision_id' => '1.0.0' }, } } file 'roles/x.json', { 'run_list' => [ 'blah' ] } diff --git a/spec/integration/knife/show_spec.rb b/spec/integration/knife/show_spec.rb index 8f1887e738..fad5126f66 100644 --- a/spec/integration/knife/show_spec.rb +++ b/spec/integration/knife/show_spec.rb @@ -132,7 +132,7 @@ EOM 'cookbook_versions' => { 'blah' => '= 1.0.0'}, 'override_attributes' => { 'x' => 'y' }, 'description' => 'woo', - 'name' => 'x' + 'name' => 'x', } end it 'knife show shows the attributes in a predetermined order', :skip => (RUBY_VERSION < "1.9") do diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index f7d4fb3cd4..6b7679de44 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -162,7 +162,7 @@ EOM it "should warn", :chef_lt_13_only do knife('upload /cookbooks').should_succeed( stdout: "Updated /cookbooks/x\n", - stderr: "WARN: Ignoring self-dependency in cookbook x, please remove it (in the future this will be fatal).\n" + stderr: "WARN: Ignoring self-dependency in cookbook x, please remove it (in the future this will be fatal).\n", ) knife('diff --name-status /').should_succeed '' end @@ -1345,7 +1345,7 @@ EOM policy_group 'x', { 'policies' => { 'x' => { 'revision_id' => '1.0.0' }, - 'blah' => { 'revision_id' => '1.0.0' } + 'blah' => { 'revision_id' => '1.0.0' }, } } role 'x', {} @@ -1386,7 +1386,7 @@ EOM policy_group 'x', { 'policies' => { 'x' => { 'revision_id' => '1.0.1' }, - 'y' => { 'revision_id' => '1.0.0' } + 'y' => { 'revision_id' => '1.0.0' }, } } role 'x', { 'run_list' => [ 'blah' ] } diff --git a/spec/stress/win32/security_spec.rb b/spec/stress/win32/security_spec.rb index cb520e515e..4e0c903aea 100644 --- a/spec/stress/win32/security_spec.rb +++ b/spec/stress/win32/security_spec.rb @@ -60,7 +60,7 @@ describe 'Chef::ReservedNames::Win32::Security', :windows_only do expect { securable_object.dacl = Chef::ReservedNames::Win32::Security::ACL.create([ Chef::ReservedNames::Win32::Security::ACE.access_allowed(Chef::ReservedNames::Win32::Security::SID.Everyone, Chef::ReservedNames::Win32::API::Security::GENERIC_READ), - Chef::ReservedNames::Win32::Security::ACE.access_denied(Chef::ReservedNames::Win32::Security::SID.from_account("Users"), Chef::ReservedNames::Win32::API::Security::GENERIC_ALL) + Chef::ReservedNames::Win32::Security::ACE.access_denied(Chef::ReservedNames::Win32::Security::SID.from_account("Users"), Chef::ReservedNames::Win32::API::Security::GENERIC_ALL), ]) GC.start }.not_to leak_memory(:warmup => 50, :iterations => 100) diff --git a/spec/support/shared/context/client.rb b/spec/support/shared/context/client.rb index cb387a9478..eec66dcb26 100644 --- a/spec/support/shared/context/client.rb +++ b/spec/support/shared/context/client.rb @@ -15,7 +15,7 @@ shared_context "client" do :hostname => hostname, :machinename => machinename, :platform => platform, - :platform_version => platform_version + :platform_version => platform_version, } end diff --git a/spec/support/shared/functional/directory_resource.rb b/spec/support/shared/functional/directory_resource.rb index 39bdc313e5..51c7550a78 100644 --- a/spec/support/shared/functional/directory_resource.rb +++ b/spec/support/shared/functional/directory_resource.rb @@ -68,14 +68,14 @@ shared_examples_for "a directory resource" do def allowed_acl(sid, expected_perms) [ ACE.access_allowed(sid, expected_perms[:specific]), - ACE.access_allowed(sid, expected_perms[:generic], (Chef::ReservedNames::Win32::API::Security::INHERIT_ONLY_ACE | Chef::ReservedNames::Win32::API::Security::CONTAINER_INHERIT_ACE | Chef::ReservedNames::Win32::API::Security::OBJECT_INHERIT_ACE)) + ACE.access_allowed(sid, expected_perms[:generic], (Chef::ReservedNames::Win32::API::Security::INHERIT_ONLY_ACE | Chef::ReservedNames::Win32::API::Security::CONTAINER_INHERIT_ACE | Chef::ReservedNames::Win32::API::Security::OBJECT_INHERIT_ACE)), ] end def denied_acl(sid, expected_perms) [ ACE.access_denied(sid, expected_perms[:specific]), - ACE.access_denied(sid, expected_perms[:generic], (Chef::ReservedNames::Win32::API::Security::INHERIT_ONLY_ACE | Chef::ReservedNames::Win32::API::Security::CONTAINER_INHERIT_ACE | Chef::ReservedNames::Win32::API::Security::OBJECT_INHERIT_ACE)) + ACE.access_denied(sid, expected_perms[:generic], (Chef::ReservedNames::Win32::API::Security::INHERIT_ONLY_ACE | Chef::ReservedNames::Win32::API::Security::CONTAINER_INHERIT_ACE | Chef::ReservedNames::Win32::API::Security::OBJECT_INHERIT_ACE)), ] end diff --git a/spec/support/shared/functional/http.rb b/spec/support/shared/functional/http.rb index 963fbf1c5b..cfbb8e3689 100644 --- a/spec/support/shared/functional/http.rb +++ b/spec/support/shared/functional/http.rb @@ -81,7 +81,7 @@ module ChefHTTPShared # (expected_content should be uncompressed) @api.get("/nyan_cat_content_length.png", 200, nil, { - 'Content-Length' => nyan_uncompressed_size.to_s, + 'Content-Length' => nyan_uncompressed_size.to_s } ) { File.open(nyan_uncompressed_filename, "rb") do |f| @@ -94,7 +94,7 @@ module ChefHTTPShared { 'Content-Length' => nyan_compressed_size.to_s, 'Content-Type' => 'application/gzip', - 'Content-Encoding' => 'gzip' + 'Content-Encoding' => 'gzip', } ) { File.open(nyan_compressed_filename, "rb") do |f| @@ -109,7 +109,7 @@ module ChefHTTPShared # (expected_content should be uncompressed) @api.get("/nyan_cat_truncated.png", 200, nil, { - 'Content-Length' => (nyan_uncompressed_size + 1).to_s, + 'Content-Length' => (nyan_uncompressed_size + 1).to_s } ) { File.open(nyan_uncompressed_filename, "rb") do |f| @@ -122,7 +122,7 @@ module ChefHTTPShared { 'Content-Length' => (nyan_compressed_size + 1).to_s, 'Content-Type' => 'application/gzip', - 'Content-Encoding' => 'gzip' + 'Content-Encoding' => 'gzip', } ) { File.open(nyan_compressed_filename, "rb") do |f| diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index b3c32356aa..1e8edec9ae 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -111,28 +111,28 @@ shared_context "use Windows permissions", :windows_only do let(:expected_read_execute_perms) do { :generic => Chef::ReservedNames::Win32::API::Security::GENERIC_READ | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE, - :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_EXECUTE + :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_EXECUTE, } end let(:expected_write_perms) do { :generic => Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE, - :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE + :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE, } end let(:expected_modify_perms) do { :generic => Chef::ReservedNames::Win32::API::Security::GENERIC_READ | Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE | Chef::ReservedNames::Win32::API::Security::DELETE, - :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_EXECUTE | Chef::ReservedNames::Win32::API::Security::DELETE + :specific => Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE | Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_EXECUTE | Chef::ReservedNames::Win32::API::Security::DELETE, } end let(:expected_full_control_perms) do { :generic => Chef::ReservedNames::Win32::API::Security::GENERIC_ALL, - :specific => Chef::ReservedNames::Win32::API::Security::FILE_ALL_ACCESS + :specific => Chef::ReservedNames::Win32::API::Security::FILE_ALL_ACCESS, } end @@ -470,7 +470,7 @@ shared_examples_for "a securable resource without existing target" do expect(explicit_aces).to eq([ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE), ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_EXECUTE), - ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_READ) + ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_READ), ]) end @@ -483,7 +483,7 @@ shared_examples_for "a securable resource without existing target" do expect(explicit_aces).to eq([ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ), ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_WRITE | Security::DELETE), - ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_EXECUTE) + ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_EXECUTE), ]) end diff --git a/spec/support/shared/functional/win32_service.rb b/spec/support/shared/functional/win32_service.rb index 2ee1a8ad88..8eca7a47fa 100644 --- a/spec/support/shared/functional/win32_service.rb +++ b/spec/support/shared/functional/win32_service.rb @@ -47,7 +47,7 @@ shared_context "using Win32::Service" do :service_display_name => "Spec Test Service", :service_description => "Service for testing Chef::Application::WindowsServiceManager.", :service_file_path => File.expand_path(File.join(File.dirname(__FILE__), '../../platforms/win32/spec_service.rb')), - :delayed_start => true + :delayed_start => true, } } diff --git a/spec/support/shared/integration/app_server_support.rb b/spec/support/shared/integration/app_server_support.rb index 0ca6c54ede..a133833d3e 100644 --- a/spec/support/shared/integration/app_server_support.rb +++ b/spec/support/shared/integration/app_server_support.rb @@ -27,7 +27,7 @@ module AppServerSupport Rack::Handler::WEBrick.run(app, :Port => 9018, :AccessLog => [], - :Logger => WEBrick::Log::new(StringIO.new, 7) + :Logger => WEBrick::Log::new(StringIO.new, 7), ) do |found_server| server = found_server end diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb index 30293be6cf..fb624bca8b 100644 --- a/spec/support/shared/integration/knife_support.rb +++ b/spec/support/shared/integration/knife_support.rb @@ -40,7 +40,7 @@ module KnifeSupport checksums_cache_dir = Dir.mktmpdir('checksums') do |checksums_cache_dir| Chef::Config[:cache_options] = { :path => checksums_cache_dir, - :skip_expires => true + :skip_expires => true, } # This is Chef::Knife.run without load_commands--we'll load stuff diff --git a/spec/support/shared/unit/api_error_inspector.rb b/spec/support/shared/unit/api_error_inspector.rb index 29faa07f29..82581fae5c 100644 --- a/spec/support/shared/unit/api_error_inspector.rb +++ b/spec/support/shared/unit/api_error_inspector.rb @@ -34,7 +34,7 @@ shared_examples_for "an api error inspector" do :validation_key => "/etc/chef/testorg-validator.pem", :chef_server_url => "https://chef-api.example.com", :node_name => "testnode-name", - :client_key => "/etc/chef/client.pem" + :client_key => "/etc/chef/client.pem", } @description = Chef::Formatters::ErrorDescription.new("Error registering the node:") @outputter = Chef::Formatters::IndentableOutputStream.new(StringIO.new, STDERR) diff --git a/spec/support/shared/unit/api_versioning.rb b/spec/support/shared/unit/api_versioning.rb index 05a4117f8e..ccbe95d029 100644 --- a/spec/support/shared/unit/api_versioning.rb +++ b/spec/support/shared/unit/api_versioning.rb @@ -47,7 +47,7 @@ shared_examples_for "user and client reregister" do { "min_version" => min_version, "max_version" => max_version, - "request_version" => "30" + "request_version" => "30", } } diff --git a/spec/support/shared/unit/mock_shellout.rb b/spec/support/shared/unit/mock_shellout.rb index 7c3e49ec82..82cd618143 100644 --- a/spec/support/shared/unit/mock_shellout.rb +++ b/spec/support/shared/unit/mock_shellout.rb @@ -31,7 +31,7 @@ class MockShellout @properties = { stdout: "", stderr: "", - exitstatus: 0 + exitstatus: 0, }.merge(properties) end def method_missing(name, *args) diff --git a/spec/support/shared/unit/platform_introspector.rb b/spec/support/shared/unit/platform_introspector.rb index df24370fde..52a780eb10 100644 --- a/spec/support/shared/unit/platform_introspector.rb +++ b/spec/support/shared/unit/platform_introspector.rb @@ -24,7 +24,7 @@ shared_examples_for "a platform introspector" do %w{openbsd freebsd}.each do |x| @platform_hash[x] = { "default" => x, - "1.2.3" => "#{x}-1.2.3" + "1.2.3" => "#{x}-1.2.3", } end @platform_hash["debian"] = {["5", "6"] => "debian-5/6", "default" => "debian"} @@ -39,7 +39,7 @@ shared_examples_for "a platform introspector" do "debian" => "debian value", [:rhel, :fedora] => "redhatty value", "suse" => "suse value", - :default => "default value" + :default => "default value", } end diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index fc7c79ef7d..60b048975a 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -384,25 +384,25 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option "action" => "should return false if home matches", "current_resource_home" => [ "/home/laurent" ], "new_resource_home" => [ "/home/laurent" ], - "expected_result" => false + "expected_result" => false, }, { "action" => "should return true if home doesn't match", "current_resource_home" => [ "/home/laurent" ], "new_resource_home" => [ "/something/else" ], - "expected_result" => true + "expected_result" => true, }, { "action" => "should return false if home only differs by trailing slash", "current_resource_home" => [ "/home/laurent" ], "new_resource_home" => [ "/home/laurent/", "/home/laurent" ], - "expected_result" => false + "expected_result" => false, }, { "action" => "should return false if home is an equivalent path", "current_resource_home" => [ "/home/laurent" ], "new_resource_home" => [ "/home/./laurent", "/home/laurent" ], - "expected_result" => false + "expected_result" => false, }, ].each do |home_check| it home_check["action"] do diff --git a/spec/support/shared/unit/user_and_client_shared.rb b/spec/support/shared/unit/user_and_client_shared.rb index bc5ffa07c2..98f2982f12 100644 --- a/spec/support/shared/unit/user_and_client_shared.rb +++ b/spec/support/shared/unit/user_and_client_shared.rb @@ -74,7 +74,7 @@ shared_examples_for "user or client create" do { "chef_key" => { "public_key" => "some_public_key", - "private_key" => "some_private_key" + "private_key" => "some_private_key", } } } diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb index 4cf1c20eaa..6f0f552c4d 100644 --- a/spec/unit/api_client/registration_spec.rb +++ b/spec/unit/api_client/registration_spec.rb @@ -48,7 +48,7 @@ describe Chef::ApiClient::Registration do let(:server_v10_response) do { "uri" => "https://chef.local/clients/#{client_name}", - "private_key" => "--begin rsa key etc--" + "private_key" => "--begin rsa key etc--", } end @@ -73,7 +73,7 @@ describe Chef::ApiClient::Registration do "uri" => "", "chef_key" => { "public_key" => generated_public_key.to_pem - } + }, } end diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb index 810c806af5..2a3f63bde5 100644 --- a/spec/unit/api_client_spec.rb +++ b/spec/unit/api_client_spec.rb @@ -176,7 +176,7 @@ describe Chef::ApiClient do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "json_class" => "Chef::ApiClient" + "json_class" => "Chef::ApiClient", } end @@ -221,7 +221,7 @@ describe Chef::ApiClient do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "json_class" => "Chef::ApiClient" + "json_class" => "Chef::ApiClient", } @http_client = double("Chef::ServerAPI mock") allow(Chef::ServerAPI).to receive(:new).and_return(@http_client) diff --git a/spec/unit/api_client_v1_spec.rb b/spec/unit/api_client_v1_spec.rb index 17aba8c3af..ab55a04950 100644 --- a/spec/unit/api_client_v1_spec.rb +++ b/spec/unit/api_client_v1_spec.rb @@ -199,7 +199,7 @@ describe Chef::ApiClientV1 do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "create_key" => true + "create_key" => true, } end @@ -248,7 +248,7 @@ describe Chef::ApiClientV1 do "private_key" => "monkeypants", "admin" => true, "create_key" => true, - "validator" => true + "validator" => true, } @http_client = double("Chef::ServerAPI mock") @@ -332,7 +332,7 @@ describe Chef::ApiClientV1 do { :name => "some_name", :validator => true, - :admin => true + :admin => true, } } diff --git a/spec/unit/audit/audit_event_proxy_spec.rb b/spec/unit/audit/audit_event_proxy_spec.rb index 17a5d3d771..d8c495deeb 100644 --- a/spec/unit/audit/audit_event_proxy_spec.rb +++ b/spec/unit/audit/audit_event_proxy_spec.rb @@ -128,21 +128,21 @@ describe Chef::Audit::AuditEventProxy do { :described_class => described_class, :example_group => example_group, - :line_number => line + :line_number => line, } } let(:example_group) { { :description => group_description, - :parent_example_group => parent_group + :parent_example_group => parent_group, } } let(:parent_group) { { :description => control_group_name, - :parent_example_group => nil + :parent_example_group => nil, } } @@ -155,7 +155,7 @@ describe Chef::Audit::AuditEventProxy do :resource_type => resource_type, :resource_name => resource_name, :context => context, - :line_number => line + :line_number => line, } } @@ -287,14 +287,14 @@ describe Chef::Audit::AuditEventProxy do let(:parent_group) { { :description => outer_group_description, - :parent_example_group => control_group + :parent_example_group => control_group, } } let(:control_group) { { :description => control_group_name, - :parent_example_group => nil + :parent_example_group => nil, } } diff --git a/spec/unit/audit/audit_reporter_spec.rb b/spec/unit/audit/audit_reporter_spec.rb index 1a8cee1cd5..f9f03c9620 100644 --- a/spec/unit/audit/audit_reporter_spec.rb +++ b/spec/unit/audit/audit_reporter_spec.rb @@ -284,7 +284,7 @@ EOM let(:ordered_control_groups) { { "foo" => control_group_foo, - "bar" => control_group_bar + "bar" => control_group_bar, } } diff --git a/spec/unit/audit/control_group_data_spec.rb b/spec/unit/audit/control_group_data_spec.rb index e21ab066fd..3705fafbe7 100644 --- a/spec/unit/audit/control_group_data_spec.rb +++ b/spec/unit/audit/control_group_data_spec.rb @@ -178,7 +178,7 @@ describe Chef::Audit::ControlGroupData do :resource_type => resource_type, :resource_name => resource_name, :context => context, - :line_number => line_number + :line_number => line_number, } } diff --git a/spec/unit/chef_fs/config_spec.rb b/spec/unit/chef_fs/config_spec.rb index c9cf756dc0..145cdf2d12 100644 --- a/spec/unit/chef_fs/config_spec.rb +++ b/spec/unit/chef_fs/config_spec.rb @@ -67,8 +67,8 @@ describe Chef::ChefFS::Config do node_path: "/base_path/nodes", role_path: "/base_path/roles", user_path: "/base_path/users", - policy_path: "/base_path/policies" - }) + policy_path: "/base_path/policies", + },) end let(:chef_fs_config) { Chef::ChefFS::Config.new(chef_config, Dir.pwd) } diff --git a/spec/unit/chef_fs/data_handler/group_handler_spec.rb b/spec/unit/chef_fs/data_handler/group_handler_spec.rb index 5f14646602..6e71fa3b10 100644 --- a/spec/unit/chef_fs/data_handler/group_handler_spec.rb +++ b/spec/unit/chef_fs/data_handler/group_handler_spec.rb @@ -38,7 +38,7 @@ describe Chef::ChefFS::DataHandler::GroupDataHandler do { 'name' => 'worker_bees', 'clients' => %w(honey sting), 'users' => %w(fizz buzz), - 'actors' => %w(honey) + 'actors' => %w(honey), } end @@ -46,11 +46,11 @@ describe Chef::ChefFS::DataHandler::GroupDataHandler do { 'actors' => { 'users' => %w(fizz buzz), 'clients'=> %w(honey sting), - 'groups'=> [] + 'groups'=> [], }, 'groupname' => 'workers', 'name' => 'worker_bees', - 'orgname' => 'hive' + 'orgname' => 'hive', } end diff --git a/spec/unit/chef_fs/diff_spec.rb b/spec/unit/chef_fs/diff_spec.rb index 71605393f3..284a7a5ab7 100644 --- a/spec/unit/chef_fs/diff_spec.rb +++ b/spec/unit/chef_fs/diff_spec.rb @@ -44,7 +44,7 @@ describe 'diff', :uses_diff => true do :sub_a_only_dir => { :subsub => nil }, :sub_a_only_file => nil, :sub_dir_in_a_file_in_b => {}, - :sub_file_in_a_dir_in_b => nil + :sub_file_in_a_dir_in_b => nil, }, :both_files => nil, :both_files_different => "a\n", @@ -56,7 +56,7 @@ describe 'diff', :uses_diff => true do :a_only_dir => { :subsub => nil }, :a_only_file => nil, :dir_in_a_file_in_b => {}, - :file_in_a_dir_in_b => nil + :file_in_a_dir_in_b => nil, }, /cannot_be_in_a/) } let(:b) { @@ -71,7 +71,7 @@ describe 'diff', :uses_diff => true do :sub_b_only_dir => { :subsub => nil }, :sub_b_only_file => nil, :sub_dir_in_a_file_in_b => nil, - :sub_file_in_a_dir_in_b => {} + :sub_file_in_a_dir_in_b => {}, }, :both_files => nil, :both_files_different => "b\n", @@ -83,7 +83,7 @@ describe 'diff', :uses_diff => true do :b_only_dir => { :subsub => nil }, :b_only_file => nil, :dir_in_a_file_in_b => nil, - :file_in_a_dir_in_b => {} + :file_in_a_dir_in_b => {}, }, /cannot_be_in_b/) } it 'Chef::ChefFS::CommandLine.diff_print(/)' do @@ -295,7 +295,7 @@ CONTEXT_LINE_NUMBERS "b/b_only_dir\n", "b/b_only_file\n", "b/dir_in_a_file_in_b\n", - "b/file_in_a_dir_in_b\n" + "b/file_in_a_dir_in_b\n", ]) end it 'Chef::ChefFS::CommandLine.diff_print(/) in name-status mode' do @@ -321,7 +321,7 @@ CONTEXT_LINE_NUMBERS "A\tb/b_only_dir\n", "A\tb/b_only_file\n", "T\tb/dir_in_a_file_in_b\n", - "T\tb/file_in_a_dir_in_b\n" + "T\tb/file_in_a_dir_in_b\n", ]) end end diff --git a/spec/unit/chef_fs/file_system_spec.rb b/spec/unit/chef_fs/file_system_spec.rb index 75ca4d4be9..a765be61db 100644 --- a/spec/unit/chef_fs/file_system_spec.rb +++ b/spec/unit/chef_fs/file_system_spec.rb @@ -60,15 +60,15 @@ describe Chef::ChefFS::FileSystem do :a => { :aa => { :c => '', - :zz => '' + :zz => '', }, :ab => { - :c => '', - } + :c => '' + }, }, :x => '', - :y => {} - }) + :y => {}, + },) } context 'list' do it '/**' do diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 633632b58c..48b0b2a059 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -203,7 +203,7 @@ describe Chef::Cookbook::Metadata do :version => "0.6.0", :source_url => "http://example.com", :issues_url => "http://example.com/issues", - :privacy => true + :privacy => true, } params.sort { |a,b| a.to_s <=> b.to_s }.each do |field, field_value| describe field do @@ -434,7 +434,7 @@ describe Chef::Cookbook::Metadata do it "should allow you set a grouping" do group = { "title" => "MySQL Tuning", - "description" => "Setting from the my.cnf file that allow you to tune your mysql server" + "description" => "Setting from the my.cnf file that allow you to tune your mysql server", } expect(metadata.grouping("/db/mysql/databases/tuning", group)).to eq(group) end @@ -470,7 +470,7 @@ describe Chef::Cookbook::Metadata do "default" => [ ], "source_url" => "http://example.com", "issues_url" => "http://example.com/issues", - "privacy" => true + "privacy" => true, } expect(metadata.attribute("/db/mysql/databases", attrs)).to eq(attrs) end @@ -654,7 +654,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "string", :choice => [ "test1", "test2" ], - :default => "test1" + :default => "test1", } expect { metadata.attribute("test_cookbook/test", options) @@ -663,7 +663,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "boolean", :choice => [ true, false ], - :default => true + :default => true, } expect { metadata.attribute("test_cookbook/test", options) @@ -672,7 +672,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "numeric", :choice => [ 1337, 420 ], - :default => 1337 + :default => 1337, } expect { metadata.attribute("test_cookbook/test", options) @@ -681,7 +681,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "numeric", :choice => [ true, "false" ], - :default => false + :default => false, } expect { metadata.attribute("test_cookbook/test", options) @@ -692,14 +692,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :calculated => true, - :default => [ "I thought you said calculated" ] + :default => [ "I thought you said calculated" ], } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) expect { attrs = { :calculated => true, - :default => "I thought you said calculated" + :default => "I thought you said calculated", } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) @@ -709,14 +709,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :choice => [ "a", "b", "c"], - :default => "b" + :default => "b", } metadata.attribute("db/mysql/databases", attrs) }.not_to raise_error expect { attrs = { :choice => [ "a", "b", "c", "d", "e"], - :default => ["b", "d"] + :default => ["b", "d"], } metadata.attribute("db/mysql/databases", attrs) }.not_to raise_error @@ -726,14 +726,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :choice => [ "a", "b", "c"], - :default => "d" + :default => "d", } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) expect { attrs = { :choice => [ "a", "b", "c", "d", "e"], - :default => ["b", "z"] + :default => ["b", "z"], } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb index 7234183a11..8d4413105d 100644 --- a/spec/unit/cookbook_loader_spec.rb +++ b/spec/unit/cookbook_loader_spec.rb @@ -25,7 +25,7 @@ describe Chef::CookbookLoader do let(:repo_paths) do [ File.expand_path(File.join(CHEF_SPEC_DATA, "kitchen")), - File.expand_path(File.join(CHEF_SPEC_DATA, "cookbooks")) + File.expand_path(File.join(CHEF_SPEC_DATA, "cookbooks")), ] end @@ -179,7 +179,7 @@ describe Chef::CookbookLoader do [ File.join(CHEF_SPEC_DATA, "kitchen"), File.join(CHEF_SPEC_DATA, "cookbooks"), - File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo") + File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"), ] end @@ -245,7 +245,7 @@ describe Chef::CookbookLoader do [ File.join(CHEF_SPEC_DATA, "kitchen"), File.join(CHEF_SPEC_DATA, "cookbooks"), - File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo") + File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"), ] end diff --git a/spec/unit/cookbook_site_streaming_uploader_spec.rb b/spec/unit/cookbook_site_streaming_uploader_spec.rb index 0041a142dc..07069810dd 100644 --- a/spec/unit/cookbook_site_streaming_uploader_spec.rb +++ b/spec/unit/cookbook_site_streaming_uploader_spec.rb @@ -108,7 +108,7 @@ describe Chef::CookbookSiteStreamingUploader do it "should be able to receive strings to attach as argument" do Chef::CookbookSiteStreamingUploader.make_request(:put, @uri, 'bill', @secret_filename, { - :mystring => 'Lorem ipsum', + :mystring => 'Lorem ipsum' }) end diff --git a/spec/unit/cookbook_uploader_spec.rb b/spec/unit/cookbook_uploader_spec.rb index a08b6b29d0..b74d08f620 100644 --- a/spec/unit/cookbook_uploader_spec.rb +++ b/spec/unit/cookbook_uploader_spec.rb @@ -97,7 +97,7 @@ describe Chef::CookbookUploader do upload_headers = { "content-type" => "application/x-binary", "content-md5" => an_instance_of(String), - "accept" => "application/json" + "accept" => "application/json", } expect(http_client).to receive(:put). diff --git a/spec/unit/cookbook_version_file_specificity_spec.rb b/spec/unit/cookbook_version_file_specificity_spec.rb index 73b10899d4..ff79573113 100644 --- a/spec/unit/cookbook_version_file_specificity_spec.rb +++ b/spec/unit/cookbook_version_file_specificity_spec.rb @@ -30,31 +30,31 @@ describe Chef::CookbookVersion, "file specificity" do :name => "afile.rb", :path => "files/host-examplehost.example.org/afile.rb", :checksum => "csum-host", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "afile.rb", :path => "files/ubuntu-9.10/afile.rb", :checksum => "csum-platver-full", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "afile.rb", :path => "files/newubuntu-9/afile.rb", :checksum => "csum-platver-partial", - :specificity => "newubuntu-9" + :specificity => "newubuntu-9", }, { :name => "afile.rb", :path => "files/ubuntu/afile.rb", :checksum => "csum-plat", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "afile.rb", :path => "files/default/afile.rb", :checksum => "csum-default", - :specificity => "default" + :specificity => "default", }, # for different/odd platform_versions @@ -62,25 +62,25 @@ describe Chef::CookbookVersion, "file specificity" do :name => "bfile.rb", :path => "files/fakeos-2.0.rc.1/bfile.rb", :checksum => "csum2-platver-full", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "bfile.rb", :path => "files/newfakeos-2.0.rc/bfile.rb", :checksum => "csum2-platver-partial", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "bfile.rb", :path => "files/fakeos-maple tree/bfile.rb", :checksum => "csum3-platver-full", - :specificity => "maple tree" + :specificity => "maple tree", }, { :name => "bfile.rb", :path => "files/fakeos-1/bfile.rb", :checksum => "csum4-platver-full", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, # directory adirectory @@ -88,114 +88,114 @@ describe Chef::CookbookVersion, "file specificity" do :name => "anotherfile1.rb", :path => "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host", :checksum => "csum-host-1", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "anotherfile2.rb", :path => "files/host-examplehost.example.org/adirectory/anotherfile2.rb.host", :checksum => "csum-host-2", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "anotherfile1.rb", :path => "files/ubuntu-9.10/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum-platver-full-1", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "anotherfile2.rb", :path => "files/ubuntu-9.10/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum-platver-full-2", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "anotherfile1.rb", :path => "files/newubuntu-9/adirectory/anotherfile1.rb.platform-partial-version", :checksum => "csum-platver-partial-1", - :specificity => "newubuntu-9" + :specificity => "newubuntu-9", }, { :name => "anotherfile2.rb", :path => "files/newubuntu-9/adirectory/anotherfile2.rb.platform-partial-version", :checksum => "csum-platver-partial-2", - :specificity => "nweubuntu-9" + :specificity => "nweubuntu-9", }, { :name => "anotherfile1.rb", :path => "files/ubuntu/adirectory/anotherfile1.rb.platform", :checksum => "csum-plat-1", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "anotherfile2.rb", :path => "files/ubuntu/adirectory/anotherfile2.rb.platform", :checksum => "csum-plat-2", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "anotherfile1.rb", :path => "files/default/adirectory/anotherfile1.rb.default", :checksum => "csum-default-1", - :specificity => "default" + :specificity => "default", }, { :name => "anotherfile2.rb", :path => "files/default/adirectory/anotherfile2.rb.default", :checksum => "csum-default-2", - :specificity => "default" + :specificity => "default", }, # for different/odd platform_versions { :name => "anotherfile1.rb", :path => "files/fakeos-2.0.rc.1/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum2-platver-full-1", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "anotherfile2.rb", :path => "files/fakeos-2.0.rc.1/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum2-platver-full-2", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "anotherfile1.rb", :path => "files/newfakeos-2.0.rc.1/adirectory/anotherfile1.rb.platform-partial-version", :checksum => "csum2-platver-partial-1", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "anotherfile2.rb", :path => "files/newfakeos-2.0.rc.1/adirectory/anotherfile2.rb.platform-partial-version", :checksum => "csum2-platver-partial-2", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "anotherfile1.rb", :path => "files/fakeos-maple tree/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum3-platver-full-1", - :specificity => "fakeos-maple tree" + :specificity => "fakeos-maple tree", }, { :name => "anotherfile2.rb", :path => "files/fakeos-maple tree/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum3-platver-full-2", - :specificity => "fakeos-maple tree" + :specificity => "fakeos-maple tree", }, { :name => "anotherfile1.rb", :path => "files/fakeos-1/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum4-platver-full-1", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, { :name => "anotherfile2.rb", :path => "files/fakeos-1/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum4-platver-full-2", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, ] } diff --git a/spec/unit/cookbook_version_spec.rb b/spec/unit/cookbook_version_spec.rb index 2bccddcaec..e248267eab 100644 --- a/spec/unit/cookbook_version_spec.rb +++ b/spec/unit/cookbook_version_spec.rb @@ -249,7 +249,7 @@ describe Chef::CookbookVersion do ["1.2", "1.3.0"], ["1.2", "1.3"], ["1.2", "2.1.1"], - ["1.2", "2.1"] + ["1.2", "2.1"], ] examples.each do |smaller, larger| sm = Chef::CookbookVersion.new("foo", '/tmp/blah') diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb index b93ae1f1d6..7bca47af3e 100644 --- a/spec/unit/dsl/data_query_spec.rb +++ b/spec/unit/dsl/data_query_spec.rb @@ -65,8 +65,8 @@ describe Chef::DSL::DataQuery do "greeting" => "hello", "nested" => { "a1" => [1, 2, 3], - "a2" => { "b1" => true } - } + "a2" => { "b1" => true }, + }, }} let(:item) do diff --git a/spec/unit/dsl/platform_introspection_spec.rb b/spec/unit/dsl/platform_introspection_spec.rb index e41560c034..438dde126e 100644 --- a/spec/unit/dsl/platform_introspection_spec.rb +++ b/spec/unit/dsl/platform_introspection_spec.rb @@ -42,7 +42,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformDependentValue do :openbsd => {:default => 'free, functional, secure'}, [:redhat, :centos, :fedora, :scientific] => {:default => '"stable"'}, :ubuntu => {'10.04' => 'using upstart more', :default => 'using init more'}, - :default => 'bork da bork' + :default => 'bork da bork', } @platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformDependentValue.new(platform_hash) end @@ -91,7 +91,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue do [:rhel, "fedora"] => "redhatty value", "suse" => @array_values, :gentoo => "gentoo value", - :default => "default value" + :default => "default value", } @platform_family_value = Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue.new(@platform_family_hash) diff --git a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb index 1e2b2a85e8..1090f46745 100644 --- a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +++ b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb @@ -44,8 +44,8 @@ describe Chef::EncryptedDataBagItem::CheckEncrypted do "greeting" => "hello", "nested" => { "a1" => [1, 2, 3], - "a2" => { "b1" => true } - } + "a2" => { "b1" => true }, + }, }} let(:version) { 1 } diff --git a/spec/unit/encrypted_data_bag_item_spec.rb b/spec/unit/encrypted_data_bag_item_spec.rb index b4d75d2480..26501684c8 100644 --- a/spec/unit/encrypted_data_bag_item_spec.rb +++ b/spec/unit/encrypted_data_bag_item_spec.rb @@ -323,7 +323,7 @@ describe Chef::EncryptedDataBagItem do let(:plaintext_data) {{ "id" => "item_name", "greeting" => "hello", - "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }} + "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }}, }} let(:secret) { "abc123SECRET" } let(:encoded_data) { subject.encrypt_data_bag_item(plaintext_data, secret) } diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 4116150d6e..4a8f94e770 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -106,7 +106,7 @@ describe Chef::Environment do @cookbook_versions = { "apt" => "= 1.0.0", "god" => "= 2.0.0", - "apache2" => "= 4.2.0" + "apache2" => "= 4.2.0", } end @@ -221,10 +221,10 @@ describe Chef::Environment do "cookbook_versions" => { "apt" => "= 1.2.3", "god" => ">= 4.2.0", - "apache2" => "= 2.0.0" + "apache2" => "= 2.0.0", }, "json_class" => "Chef::Environment", - "chef_type" => "environment" + "chef_type" => "environment", } @environment = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(@data)) end @@ -245,7 +245,7 @@ describe Chef::Environment do @cookbook_versions = { "apt" => "= 1.0.0", "god" => "= 2.0.0", - "apache2" => "= 4.2.0" + "apache2" => "= 4.2.0", } end @@ -422,7 +422,7 @@ describe Chef::Environment do }, "json_class" => "Chef::Environment", "description" => "desc", - "chef_type" => "environment" + "chef_type" => "environment", } expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(Chef::JSONCompat.to_json(environment_hash)) environment = Chef::Environment.load('foo') diff --git a/spec/unit/exceptions_spec.rb b/spec/unit/exceptions_spec.rb index 85c54aa693..c738bcf840 100644 --- a/spec/unit/exceptions_spec.rb +++ b/spec/unit/exceptions_spec.rb @@ -67,7 +67,7 @@ describe Chef::Exceptions do Chef::Exceptions::InvalidEnvironmentPath => ArgumentError, Chef::Exceptions::EnvironmentNotFound => RuntimeError, Chef::Exceptions::InvalidVersionConstraint => ArgumentError, - Chef::Exceptions::IllegalVersionConstraint => NotImplementedError + Chef::Exceptions::IllegalVersionConstraint => NotImplementedError, } exception_to_super_class.each do |exception, expected_super_class| diff --git a/spec/unit/formatters/doc_spec.rb b/spec/unit/formatters/doc_spec.rb index 7266afc320..b0be913304 100644 --- a/spec/unit/formatters/doc_spec.rb +++ b/spec/unit/formatters/doc_spec.rb @@ -34,9 +34,9 @@ describe Chef::Formatters::Base do "recipe[apt::default]", "recipe[java::default]", "recipe[jenkins::master]", - "recipe[policyfile_demo::default]" + "recipe[policyfile_demo::default]", ], - "cookbook_locks"=> { } + "cookbook_locks"=> { }, } formatter.policyfile_loaded(minimal_policyfile) diff --git a/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb b/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb index b8c2de2b8b..6f90ea0b27 100644 --- a/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +++ b/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb @@ -37,7 +37,7 @@ describe Chef::Formatters::APIErrorFormatting do { "min_version" => min_version, "max_version" => max_version, - "request_version" => request_version + "request_version" => request_version, } } diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb index 3c8d5dfa29..6cea22680b 100644 --- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb @@ -63,7 +63,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do [ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", - "/home/someuser/.multiruby/gems/chef/lib/chef/client.rb:123:in `run'" + "/home/someuser/.multiruby/gems/chef/lib/chef/client.rb:123:in `run'", ] end @@ -122,7 +122,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do let(:trace) do [ "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:2:in `block in from_file'", - "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:1:in `from_file'" + "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:1:in `from_file'", ] end @@ -148,7 +148,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:229:in `block in foreach_cookbook_load_segment'", "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:227:in `each'", "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:227:in `foreach_cookbook_load_segment'", - "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:137:in `load_libraries'" + "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:137:in `load_libraries'", ] end @@ -199,7 +199,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do "C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/application.rb:70:in `run'", "C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/bin/chef-client:26:in `<top (required)>'", "C:/opscode/chef/bin/chef-client:19:in `load'", - "C:/opscode/chef/bin/chef-client:19:in `<main>'" + "C:/opscode/chef/bin/chef-client:19:in `<main>'", ] end diff --git a/spec/unit/http/basic_client_spec.rb b/spec/unit/http/basic_client_spec.rb index b7552f54aa..16f62f8d97 100644 --- a/spec/unit/http/basic_client_spec.rb +++ b/spec/unit/http/basic_client_spec.rb @@ -89,7 +89,7 @@ describe "HTTP Connection" do { "https_proxy" => "https://proxy.mycorp.com:8080", "https_proxy_user" => "jane_username", - "https_proxy_pass" => "opensesame" + "https_proxy_pass" => "opensesame", } end diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb index 79bd539af3..16eede1859 100644 --- a/spec/unit/http/validate_content_length_spec.rb +++ b/spec/unit/http/validate_content_length_spec.rb @@ -157,7 +157,7 @@ describe Chef::HTTP::ValidateContentLength do let(:response_headers) { { "content-length" => content_length_value, - "transfer-encoding" => "chunked" + "transfer-encoding" => "chunked", } } diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb index 66f5fb9b13..64601cfbab 100644 --- a/spec/unit/key_spec.rb +++ b/spec/unit/key_spec.rb @@ -443,12 +443,12 @@ EOS actor_type => "foobar", "name" => key.name, "create_key" => true, - "expiration_date" => key.expiration_date + "expiration_date" => key.expiration_date, } $expected_input = { "name" => key.name, "create_key" => true, - "expiration_date" => key.expiration_date + "expiration_date" => key.expiration_date, } end @@ -534,8 +534,8 @@ EOS key.create_key true allow(rest).to receive(:put).with(url, key.to_hash).and_return({ "key" => "key_name", - "public_key" => public_key_string - }) + "public_key" => public_key_string, + },) end diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb index a1dcc564e2..9066505dfd 100644 --- a/spec/unit/knife/client_create_spec.rb +++ b/spec/unit/knife/client_create_spec.rb @@ -29,7 +29,7 @@ describe Chef::Knife::ClientCreate do { "name" => "adam", "validator" => false, - "admin" => false + "admin" => false, } end diff --git a/spec/unit/knife/client_edit_spec.rb b/spec/unit/knife/client_edit_spec.rb index ad56d9212d..75b0ef8c92 100644 --- a/spec/unit/knife/client_edit_spec.rb +++ b/spec/unit/knife/client_edit_spec.rb @@ -33,7 +33,7 @@ describe Chef::Knife::ClientEdit do "validator" => false, "admin" => false, "chef_type" => "client", - "create_key" => true + "create_key" => true, } } diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb index 3354432d39..8619c8f64b 100644 --- a/spec/unit/knife/cookbook_create_spec.rb +++ b/spec/unit/knife/cookbook_create_spec.rb @@ -56,7 +56,7 @@ describe Chef::Knife::CookbookCreate do @dir = Dir.tmpdir @knife.config = { :cookbook_path => @dir, - :cookbook_copyright => "Opscode, Inc" + :cookbook_copyright => "Opscode, Inc", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -71,7 +71,7 @@ describe Chef::Knife::CookbookCreate do @knife.config = { :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", - :cookbook_email => "nuo@opscode.com" + :cookbook_email => "nuo@opscode.com", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -87,7 +87,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "apachev2" + :cookbook_license => "apachev2", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "apachev2") @@ -103,7 +103,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => false + :cookbook_license => false, } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -119,7 +119,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "false" + :cookbook_license => "false", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -135,7 +135,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "gplv2" + :cookbook_license => "gplv2", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv2") @@ -151,7 +151,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "gplv3" + :cookbook_license => "gplv3", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv3") @@ -167,7 +167,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "mit" + :cookbook_license => "mit", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -184,7 +184,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "rdoc" + :readme_format => "rdoc", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -201,7 +201,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "mkd" + :readme_format => "mkd", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -218,7 +218,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "txt" + :readme_format => "txt", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -235,7 +235,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "foo" + :readme_format => "foo", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index 8b85e52b75..64b754d173 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -52,18 +52,18 @@ describe Chef::Knife::CookbookDownload do {'path' => 'recipes/foo.rb', 'url' => 'http://example.org/files/foo.rb'}, {'path' => 'recipes/bar.rb', - 'url' => 'http://example.org/files/bar.rb'} + 'url' => 'http://example.org/files/bar.rb'}, ], :templates => [ {'path' => 'templates/default/foo.erb', 'url' => 'http://example.org/files/foo.erb'}, {'path' => 'templates/default/bar.erb', - 'url' => 'http://example.org/files/bar.erb'} + 'url' => 'http://example.org/files/bar.erb'}, ], :attributes => [ {'path' => 'attributes/default.rb', - 'url' => 'http://example.org/files/default.rb'} - ] + 'url' => 'http://example.org/files/default.rb'}, + ], } @cookbook_mock = double('cookbook') diff --git a/spec/unit/knife/cookbook_metadata_spec.rb b/spec/unit/knife/cookbook_metadata_spec.rb index 861d85f1f7..bd54d4278b 100644 --- a/spec/unit/knife/cookbook_metadata_spec.rb +++ b/spec/unit/knife/cookbook_metadata_spec.rb @@ -57,7 +57,7 @@ describe Chef::Knife::CookbookMetadata do @bar.version = '2.0.0' @cookbook_loader = { "foo" => @foo, - "bar" => @bar + "bar" => @bar, } expect(@cookbook_loader).to receive(:load_cookbooks).and_return(@cookbook_loader) expect(@knife).to receive(:generate_metadata).with('foo') @@ -123,7 +123,7 @@ describe Chef::Knife::CookbookMetadata do end { Chef::Exceptions::ObsoleteDependencySyntax => 'obsolote dependency', - Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint' + Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint', }.each_pair do |klass, description| it "should print an error and exit when an #{description} syntax exception is encountered" do exception = klass.new("#{description} blah") @@ -157,7 +157,7 @@ describe Chef::Knife::CookbookMetadata do end { Chef::Exceptions::ObsoleteDependencySyntax => 'obsolote dependency', - Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint' + Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint', }.each_pair do |klass, description| it "should print an error and exit when an #{description} syntax exception is encountered" do expect(File).to receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json"). diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb index a06e53b9a1..6c77db013f 100644 --- a/spec/unit/knife/cookbook_show_spec.rb +++ b/spec/unit/knife/cookbook_show_spec.rb @@ -49,8 +49,8 @@ describe Chef::Knife::CookbookShow do "versions" => [ { "version" => "0.10.0", "url" => "http://url/cookbooks/cookbook_name/0.10.0" }, { "version" => "0.9.0", "url" => "http://url/cookbookx/cookbook_name/0.9.0" }, - { "version" => "0.8.0", "url" => "http://url/cookbooks/cookbook_name/0.8.0" } - ] + { "version" => "0.8.0", "url" => "http://url/cookbooks/cookbook_name/0.8.0" }, + ], } } end @@ -92,8 +92,8 @@ describe Chef::Knife::CookbookShow do :name => "default.rb", :path => "recipes/default.rb", :checksum => "1234", - :url => "http://example.org/files/default.rb" - } + :url => "http://example.org/files/default.rb", + }, ] } @cookbook_response.manifest = @manifest @@ -117,8 +117,8 @@ describe Chef::Knife::CookbookShow do :name => "default.rb", :path => "recipes/default.rb", :checksum => "1234", - :url => "http://example.org/files/default.rb" - } + :url => "http://example.org/files/default.rb", + }, ] } @response = "Example recipe text" @@ -143,28 +143,28 @@ describe Chef::Knife::CookbookShow do :path => "files/host-examplehost.example.org/afile.rb", :checksum => "1111", :specificity => "host-examplehost.example.org", - :url => "http://example.org/files/1111" + :url => "http://example.org/files/1111", }, { :name => "afile.rb", :path => "files/ubuntu-9.10/afile.rb", :checksum => "2222", :specificity => "ubuntu-9.10", - :url => "http://example.org/files/2222" + :url => "http://example.org/files/2222", }, { :name => "afile.rb", :path => "files/ubuntu/afile.rb", :checksum => "3333", :specificity => "ubuntu", - :url => "http://example.org/files/3333" + :url => "http://example.org/files/3333", }, { :name => "afile.rb", :path => "files/default/afile.rb", :checksum => "4444", :specificity => "default", - :url => "http://example.org/files/4444" + :url => "http://example.org/files/4444", }, ] } diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb index 1b2ffd10fb..14ade10e09 100644 --- a/spec/unit/knife/cookbook_site_share_spec.rb +++ b/spec/unit/knife/cookbook_site_share_spec.rb @@ -55,13 +55,13 @@ describe Chef::Knife::CookbookSiteShare do allow(@knife).to receive(:do_upload).and_return(true) @category_response = { "name" => "cookbook_name", - "category" => "Testing Category" + "category" => "Testing Category", } @bad_category_response = { "error_code" => "NOT_FOUND", "error_messages" => [ "Resource does not exist." - ] + ], } end diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index fb94886cad..ecee34f308 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -134,7 +134,7 @@ E { 'test_cookbook1' => Chef::CookbookVersion.new('test_cookbook1', '/tmp/blah'), 'test_cookbook2' => Chef::CookbookVersion.new('test_cookbook2', '/tmp/blah'), - 'test_cookbook3' => Chef::CookbookVersion.new('test_cookbook3', '/tmp/blah') + 'test_cookbook3' => Chef::CookbookVersion.new('test_cookbook3', '/tmp/blah'), } end diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index ac44e2915f..1d93f64e32 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::Core::BootstrapContext do { :validation_key => File.join(CHEF_SPEC_DATA, 'ssl', 'private_key.pem'), :chef_server_url => 'http://chef.example.com:4444', - :validation_client_name => 'chef-validator-testing' + :validation_client_name => 'chef-validator-testing', } end diff --git a/spec/unit/knife/core/gem_glob_loader_spec.rb b/spec/unit/knife/core/gem_glob_loader_spec.rb index 465eea2656..89de9f98e4 100644 --- a/spec/unit/knife/core/gem_glob_loader_spec.rb +++ b/spec/unit/knife/core/gem_glob_loader_spec.rb @@ -47,7 +47,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do gems = [ double('knife-ec2-0.5.12') ] gem_files = [ '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_base.rb', - '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_otherstuff.rb' + '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_otherstuff.rb', ] expect($LOAD_PATH).to receive(:map).and_return([]) if Gem::Specification.respond_to? :latest_specs @@ -135,7 +135,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do # `SubcommandLoader::MATCHES_CHEF_GEM` should make it clear why we want # to test these two cases. "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb", - "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb" + "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb", ] end @@ -153,7 +153,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-foo-#{Chef::VERSION}/lib/chef/knife/chef-foo.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/foo-chef-#{Chef::VERSION}/lib/chef/knife/foo-chef.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb", - "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb" + "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb", ] end diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb index 00e7ba377b..1a6c2f42b7 100644 --- a/spec/unit/knife/core/hashed_command_loader_spec.rb +++ b/spec/unit/knife/core/hashed_command_loader_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do "_autogenerated_command_paths" => { "plugins_paths" => { "cool_a" => ["/file/for/plugin/a"], - "cooler_b" => ["/file/for/plugin/b"] + "cooler_b" => ["/file/for/plugin/b"], }, "plugins_by_category" => { "cool" => [ @@ -35,8 +35,8 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do ], "cooler" => [ "cooler_b" - ] - } + ], + }, } } } diff --git a/spec/unit/knife/core/object_loader_spec.rb b/spec/unit/knife/core/object_loader_spec.rb index 67fa858029..0b572cc1f0 100644 --- a/spec/unit/knife/core/object_loader_spec.rb +++ b/spec/unit/knife/core/object_loader_spec.rb @@ -41,7 +41,7 @@ describe Chef::Knife::Core::ObjectLoader do { 'nodes' => Chef::Node, 'roles' => Chef::Role, - 'environments' => Chef::Environment + 'environments' => Chef::Environment, }.each do |repo_location, chef_class| describe "when the file is a #{chef_class}" do diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index ab420518a3..2c3b067e4f 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -405,8 +405,8 @@ EOM "versions" => [ { "version" => "3.0.0", "url" => "http://url/cookbooks/3.0.0" }, { "version" => "2.0.0", "url" => "http://url/cookbooks/2.0.0" }, - { "version" => "1.0.0", "url" => "http://url/cookbooks/1.0.0" } - ] + { "version" => "1.0.0", "url" => "http://url/cookbooks/1.0.0" }, + ], } } end diff --git a/spec/unit/knife/data_bag_from_file_spec.rb b/spec/unit/knife/data_bag_from_file_spec.rb index dc65a3e64c..ddf877d9f7 100644 --- a/spec/unit/knife/data_bag_from_file_spec.rb +++ b/spec/unit/knife/data_bag_from_file_spec.rb @@ -75,7 +75,7 @@ describe Chef::Knife::DataBagFromFile do let(:plain_data) { { "id" => "item_name", "greeting" => "hello", - "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }} + "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }}, } } let(:enc_data) { Chef::EncryptedDataBagItem.encrypt_data_bag_item(plain_data, secret) } diff --git a/spec/unit/knife/environment_compare_spec.rb b/spec/unit/knife/environment_compare_spec.rb index 81ec19d7af..14dc5c52cf 100644 --- a/spec/unit/knife/environment_compare_spec.rb +++ b/spec/unit/knife/environment_compare_spec.rb @@ -24,14 +24,14 @@ describe Chef::Knife::EnvironmentCompare do @environments = { "cita" => "http://localhost:4000/environments/cita", - "citm" => "http://localhost:4000/environments/citm" + "citm" => "http://localhost:4000/environments/citm", } allow(@knife).to receive(:environment_list).and_return(@environments) @constraints = { "cita" => { "foo" => "= 1.0.1", "bar" => "= 0.0.4" }, - "citm" => { "foo" => "= 1.0.1", "bar" => "= 0.0.2" } + "citm" => { "foo" => "= 1.0.1", "bar" => "= 0.0.2" }, } allow(@knife).to receive(:constraint_list).and_return(@constraints) diff --git a/spec/unit/knife/environment_list_spec.rb b/spec/unit/knife/environment_list_spec.rb index 6488a073b6..1d5462257d 100644 --- a/spec/unit/knife/environment_list_spec.rb +++ b/spec/unit/knife/environment_list_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::EnvironmentList do @environments = { "production" => "http://localhost:4000/environments/production", "development" => "http://localhost:4000/environments/development", - "testing" => "http://localhost:4000/environments/testing" + "testing" => "http://localhost:4000/environments/testing", } allow(Chef::Environment).to receive(:list).and_return @environments end diff --git a/spec/unit/knife/index_rebuild_spec.rb b/spec/unit/knife/index_rebuild_spec.rb index d8a0dd72d7..6c1ff7b98e 100644 --- a/spec/unit/knife/index_rebuild_spec.rb +++ b/spec/unit/knife/index_rebuild_spec.rb @@ -93,7 +93,7 @@ describe Chef::Knife::IndexRebuild do let(:api_info) do {"flavor" => "osc", "version" => "11.0.0", - "erchef" => "1.2.3" + "erchef" => "1.2.3", } end let(:server_specific_stubs!) do diff --git a/spec/unit/knife/key_create_spec.rb b/spec/unit/knife/key_create_spec.rb index 5998e10274..039dba7a44 100644 --- a/spec/unit/knife/key_create_spec.rb +++ b/spec/unit/knife/key_create_spec.rb @@ -125,7 +125,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo actor_field_name => "charmander", "public_key" => public_key, "expiration_date" => valid_expiration_date, - "key_name" => key_name + "key_name" => key_name, } } before do @@ -144,7 +144,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "public_key" => public_key + "public_key" => public_key, } } before do @@ -162,7 +162,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "name" => "charmander-key", - "create_key" => true + "create_key" => true, } } before do @@ -180,7 +180,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "public_key" => public_key, - "private_key" => "super_private" + "private_key" => "super_private", } } diff --git a/spec/unit/knife/key_edit_spec.rb b/spec/unit/knife/key_edit_spec.rb index 538b91de2d..06b31ce71c 100644 --- a/spec/unit/knife/key_edit_spec.rb +++ b/spec/unit/knife/key_edit_spec.rb @@ -130,7 +130,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "name" => new_keyname + "name" => new_keyname, } } before do @@ -161,7 +161,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo actor_field_name => "charmander", "public_key" => public_key, "name" => new_keyname, - "expiration_date" => "infinity" + "expiration_date" => "infinity", } } before do @@ -181,7 +181,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "create_key" => true + "create_key" => true, } } @@ -200,7 +200,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "public_key" => public_key + "public_key" => public_key, } } before do @@ -219,7 +219,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "public_key" => public_key, - "private_key" => "super_private" + "private_key" => "super_private", } } diff --git a/spec/unit/knife/key_list_spec.rb b/spec/unit/knife/key_list_spec.rb index aabe02ac02..775a7cdfb1 100644 --- a/spec/unit/knife/key_list_spec.rb +++ b/spec/unit/knife/key_list_spec.rb @@ -195,7 +195,7 @@ describe Chef::Knife::KeyList do [ {"uri"=>"https://api.opscode.piab/users/charmander/keys/non-expired1", "name"=>"non-expired1", "expired"=>false}, {"uri"=>"https://api.opscode.piab/users/charmander/keys/non-expired2", "name"=>"non-expired2", "expired"=>false}, - {"uri"=>"https://api.opscode.piab/users/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true} + {"uri"=>"https://api.opscode.piab/users/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true}, ] } end @@ -208,7 +208,7 @@ describe Chef::Knife::KeyList do [ {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/charmander/keys/non-expired1", "name"=>"non-expired1", "expired"=>false}, {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/charmander/keys/non-expired2", "name"=>"non-expired2", "expired"=>false}, - {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true} + {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true}, ] } end diff --git a/spec/unit/knife/key_show_spec.rb b/spec/unit/knife/key_show_spec.rb index 5a0d839e4f..f4923ef235 100644 --- a/spec/unit/knife/key_show_spec.rb +++ b/spec/unit/knife/key_show_spec.rb @@ -83,7 +83,7 @@ describe Chef::Knife::KeyShow do actor_field_name => "charmander", "name" => "charmander-key", "public_key" => "some-public-key", - "expiration_date" => "infinity" + "expiration_date" => "infinity", } } diff --git a/spec/unit/knife/node_edit_spec.rb b/spec/unit/knife/node_edit_spec.rb index 58e2da2a1c..be42a15ee7 100644 --- a/spec/unit/knife/node_edit_spec.rb +++ b/spec/unit/knife/node_edit_spec.rb @@ -32,7 +32,7 @@ describe Chef::Knife::NodeEdit do @knife.config = { :editor => 'cat', :attribute => nil, - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam" ] @node = Chef::Node.new() diff --git a/spec/unit/knife/node_list_spec.rb b/spec/unit/knife/node_list_spec.rb index 71edea78f7..ec694cb040 100644 --- a/spec/unit/knife/node_list_spec.rb +++ b/spec/unit/knife/node_list_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::NodeList do allow(@knife).to receive(:output).and_return(true) @list = { "foo" => "http://example.com/foo", - "bar" => "http://example.com/foo" + "bar" => "http://example.com/foo", } allow(Chef::Node).to receive(:list).and_return(@list) allow(Chef::Node).to receive(:list_by_environment).and_return(@list) diff --git a/spec/unit/knife/role_list_spec.rb b/spec/unit/knife/role_list_spec.rb index 808a04d204..65c4f94ff2 100644 --- a/spec/unit/knife/role_list_spec.rb +++ b/spec/unit/knife/role_list_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::RoleList do allow(@knife).to receive(:output).and_return(true) @list = { "foo" => "http://example.com/foo", - "bar" => "http://example.com/foo" + "bar" => "http://example.com/foo", } allow(Chef::Role).to receive(:list).and_return(@list) end diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb index 723280bead..197dc4ca77 100644 --- a/spec/unit/knife/ssh_spec.rb +++ b/spec/unit/knife/ssh_spec.rb @@ -71,7 +71,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['foo.example.org', nil], - ['bar.example.org', nil] + ['bar.example.org', nil], ]) @knife.configure_session end @@ -87,7 +87,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['ec2-10-0-0-1.compute-1.amazonaws.com', nil], - ['ec2-10-0-0-2.compute-1.amazonaws.com', nil] + ['ec2-10-0-0-2.compute-1.amazonaws.com', nil], ]) @knife.configure_session end @@ -105,7 +105,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['foo.example.org', nil], - ['bar.example.org', nil] + ['bar.example.org', nil], ]) @knife.configure_session end diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index c2127fdfd5..55b4f5c88a 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -156,7 +156,7 @@ describe Chef::Knife do "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", 'X-Chef-Version' => Chef::VERSION, "Host"=>"api.opscode.piab", - "X-REMOTE-REQUEST-ID"=>request_id + "X-REMOTE-REQUEST-ID"=>request_id, }} let(:request_id) {"1234"} diff --git a/spec/unit/mixin/api_version_request_handling_spec.rb b/spec/unit/mixin/api_version_request_handling_spec.rb index cc5340e424..fc42d76d72 100644 --- a/spec/unit/mixin/api_version_request_handling_spec.rb +++ b/spec/unit/mixin/api_version_request_handling_spec.rb @@ -54,7 +54,7 @@ describe Chef::Mixin::ApiVersionRequestHandling do let(:return_hash) { { "min_version" => min_server_version, - "max_version" => max_server_version + "max_version" => max_server_version, } } diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 3724bbf583..99d5230a75 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -63,7 +63,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => String } - } + }, ) }.not_to raise_error @@ -74,7 +74,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => Array } - } + }, ) }.to raise_error(ArgumentError) end @@ -87,7 +87,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => true } - } + }, ) }.not_to raise_error @@ -98,7 +98,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => true } - } + }, ) }.to raise_error(ArgumentError) @@ -109,7 +109,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => false } - } + }, ) }.not_to raise_error end @@ -122,7 +122,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => "validate" } - } + }, ) }.not_to raise_error @@ -133,7 +133,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => "monkey" } - } + }, ) }.to raise_error(ArgumentError) end @@ -146,7 +146,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => ["validate", "music"] } - } + }, ) }.not_to raise_error @@ -157,7 +157,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => ["monkey", "validate"] } - } + }, ) }.to raise_error(ArgumentError) end @@ -168,7 +168,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :default => "is the loneliest number" } - }) + },) expect(arguments[:one]).to eq("is the loneliest number") end @@ -180,7 +180,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :regex => /^is good$/ } - } + }, ) }.not_to raise_error @@ -191,7 +191,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :regex => /^is bad$/ } - } + }, ) }.to raise_error(ArgumentError) end @@ -205,10 +205,10 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to is good" => lambda { |a| a == "is good" - }, + } } } - } + }, ) }.not_to raise_error @@ -220,10 +220,10 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to 'is good'" => lambda { |a| a == "is good" - }, + } } } - } + }, ) }.to raise_error(ArgumentError) end @@ -243,14 +243,14 @@ describe Chef::Mixin::ParamsValidate do a == "is good" } }, - :required => true + :required => true, }, :two => { :kind_of => String, - :required => false + :required => false, }, - :three => { :default => "neato mosquito" } - } + :three => { :default => "neato mosquito" }, + }, ) }.not_to raise_error expect(args[:three]).to eq("neato mosquito") @@ -267,14 +267,14 @@ describe Chef::Mixin::ParamsValidate do a == "is good" } }, - :required => true + :required => true, }, :two => { :kind_of => Hash, - :required => false + :required => false, }, - :three => { :default => "neato mosquito" } - } + :three => { :default => "neato mosquito" }, + }, ) }.to raise_error(ArgumentError) end @@ -286,7 +286,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :busted => "check" } - } + }, ) }.to raise_error(ArgumentError) end @@ -305,7 +305,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.not_to raise_error expect { @@ -315,7 +315,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.not_to raise_error expect { @@ -325,7 +325,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.to raise_error(ArgumentError) end diff --git a/spec/unit/mixin/powershell_out_spec.rb b/spec/unit/mixin/powershell_out_spec.rb index 0fede582fa..79faf8127d 100644 --- a/spec/unit/mixin/powershell_out_spec.rb +++ b/spec/unit/mixin/powershell_out_spec.rb @@ -31,7 +31,7 @@ describe Chef::Mixin::PowershellOut do ret = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - {} + {}, ).and_return(ret) expect(object.powershell_out("Get-Process")).to eql(ret) end @@ -40,7 +40,7 @@ describe Chef::Mixin::PowershellOut do ret = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - timeout: 600 + timeout: 600, ).and_return(ret) expect(object.powershell_out("Get-Process", timeout: 600)).to eql(ret) end @@ -51,7 +51,7 @@ describe Chef::Mixin::PowershellOut do mixlib_shellout = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - {} + {}, ).and_return(mixlib_shellout) expect(mixlib_shellout).to receive(:error!) expect(object.powershell_out!("Get-Process")).to eql(mixlib_shellout) @@ -61,7 +61,7 @@ describe Chef::Mixin::PowershellOut do mixlib_shellout = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - timeout: 600 + timeout: 600, ).and_return(mixlib_shellout) expect(mixlib_shellout).to receive(:error!) expect(object.powershell_out!("Get-Process", timeout: 600)).to eql(mixlib_shellout) diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index beaf624ddb..c22d45e5fd 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -143,8 +143,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -156,8 +156,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:environment].has_key?('LC_ALL')).to be false end @@ -185,7 +185,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], } - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -198,7 +198,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], } - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:env].has_key?('LC_ALL')).to be false end @@ -214,7 +214,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], }, - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) end end @@ -227,8 +227,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd) end end diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 250b8c630c..9956ef1ec9 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -188,7 +188,7 @@ describe Chef::Node::Attribute do "os_version"=>"9.7.0", "hostname"=>"latte", "macaddress"=>"00:23:6c:7f:67:6c", - "music" => { "jimmy_eat_world" => "nice", "apophis" => false } + "music" => { "jimmy_eat_world" => "nice", "apophis" => false }, } @default_hash = { "domain" => "opscode.com", @@ -198,8 +198,8 @@ describe Chef::Node::Attribute do "mastodon" => "rocks", "mars_volta" => "is loud and nutty", "deeper" => { "gates_of_ishtar" => nil }, - "this" => {"apparatus" => {"must" => "be unearthed"}} - } + "this" => {"apparatus" => {"must" => "be unearthed"}}, + }, } @override_hash = { "macaddress" => "00:00:00:00:00:00", @@ -207,7 +207,7 @@ describe Chef::Node::Attribute do "fire" => "still burn", "music" => { "mars_volta" => "cicatriz" - } + }, } @automatic_hash = {"week" => "friday"} @attributes = Chef::Node::Attribute.new(@attribute_hash, @default_hash, @override_hash, @automatic_hash) @@ -272,7 +272,7 @@ describe Chef::Node::Attribute do ["role_override", "role_override"], ["env_override", "env_override"], ["force_override", "force_override"], - ["automatic", "automatic"] + ["automatic", "automatic"], ] expect(@attributes.debug_value(:foo, :bar)).to eq(expected) end @@ -592,17 +592,17 @@ describe Chef::Node::Attribute do { "one" => { "two" => "three" }, "hut" => { "two" => "three" }, - "place" => { } + "place" => { }, }, { "one" => { "four" => "five" }, - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => { "six" => "seven" }, - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -644,13 +644,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -682,13 +682,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -718,13 +718,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -754,13 +754,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -798,13 +798,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) @empty = Chef::Node::Attribute.new({}, {}, {}, {}) end @@ -832,13 +832,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -852,7 +852,7 @@ describe Chef::Node::Attribute do "one" => "six", "hut" => "three", "snakes" => "on a plane", - "snack" => "cookies" + "snack" => "cookies", }.each do |k,v| expect(@attributes.fetch(k)).to eq(v) end @@ -889,13 +889,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -934,13 +934,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -975,13 +975,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -1011,13 +1011,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -1046,7 +1046,7 @@ describe Chef::Node::Attribute do ["hut", "three"], ["one", "six"], ["snack", "cookies"], - ["snakes", "on a plane"] + ["snakes", "on a plane"], ] ) end @@ -1061,13 +1061,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) @empty = Chef::Node::Attribute.new({},{},{},{}) @@ -1117,11 +1117,11 @@ describe Chef::Node::Attribute do it "should output merged attributes" do default_hash = { "a" => 1, - "b" => 2 + "b" => 2, } override_hash = { "b" => 3, - "c" => 4 + "c" => 4, } attributes = Chef::Node::Attribute.new(nil, default_hash, override_hash, nil) expect(attributes.to_s).to eq('{"a"=>1, "b"=>3, "c"=>4}') diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb index d0ec81c7f7..73165c1fba 100644 --- a/spec/unit/node/immutable_collections_spec.rb +++ b/spec/unit/node/immutable_collections_spec.rb @@ -24,7 +24,7 @@ describe Chef::Node::ImmutableMash do @data_in = {:top => {:second_level => "some value"}, "top_level_2" => %w[array of values], :top_level_3 => [{:hash_array => 1, :hash_array_b => 2}], - :top_level_4 => {:level2 => {:key => "value"}} + :top_level_4 => {:level2 => {:key => "value"}}, } @immutable_mash = Chef::Node::ImmutableMash.new(@data_in) end @@ -94,7 +94,7 @@ describe Chef::Node::ImmutableMash do :reject!, :replace, :select!, - :shift + :shift, ].each do |mutator| it "doesn't allow mutation via `#{mutator}'" do expect { @immutable_mash.send(mutator) }.to raise_error @@ -151,7 +151,7 @@ describe Chef::Node::ImmutableArray do :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ].each do |mutator| it "does not allow mutation via `#{mutator}" do expect { @immutable_array.send(mutator)}.to raise_error diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index d7cee80d40..39ef684f31 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -438,13 +438,13 @@ describe Chef::Node do context "with real arrays" do before do node.role_default["mysql"]["server"] = [ { - "port" => 1234, + "port" => 1234 } ] node.normal["mysql"]["server"] = [ { - "port" => 2345, + "port" => 2345 } ] node.override["mysql"]["server"] = [ { - "port" => 3456, + "port" => 3456 } ] end @@ -610,12 +610,12 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 2345 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end it "removes all values from the precedence level when setting" do @@ -624,14 +624,14 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 3456 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end it "higher precedence levels are not removed" do @@ -641,7 +641,7 @@ describe Chef::Node do node.override["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -649,12 +649,12 @@ describe Chef::Node do expect( node["mysql"]["server"] ).to eql({ "service_name" => "fancypants-sql", "data_dir" => "/my_raid_volume/lib/mysql", - }) + },) end it "will autovivify" do node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -666,7 +666,7 @@ describe Chef::Node do node.default["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -674,14 +674,14 @@ describe Chef::Node do expect( node["mysql"]["server"] ).to eql({ "service_name" => "fancypants-sql", "data_dir" => "/my_raid_volume/lib/mysql", - }) + },) end it "when overwriting a non-hash/array" do node.override["mysql"] = false node.force_override["mysql"] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -689,11 +689,11 @@ describe Chef::Node do it "when overwriting an array with a hash" do node.force_override["mysql"][0] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end end @@ -1359,21 +1359,21 @@ describe Chef::Node do it "should only save whitelisted attributes (and subattributes)" do Chef::Config[:automatic_attribute_whitelist] = [ ["filesystem", "/dev/disk0s2"], - "network/interfaces/eth0" + "network/interfaces/eth0", ] data = { "automatic" => { "filesystem" => { "/dev/disk0s2" => { "size" => "10mb" }, - "map - autohome" => { "size" => "10mb" } + "map - autohome" => { "size" => "10mb" }, }, "network" => { "interfaces" => { "eth0" => {}, - "eth1" => {} + "eth1" => {}, } - } + }, }, "default" => {}, "normal" => {}, "override" => {} } @@ -1387,7 +1387,7 @@ describe Chef::Node do "interfaces" => { "eth0" => {} } - } + }, }, "default" => {}, "normal" => {}, "override" => {} } @@ -1407,11 +1407,11 @@ describe Chef::Node do "default" => { "foo" => { "bar" => { - "baz" => false, + "baz" => false }, "other" => { - "stuff" => true, - } + "stuff" => true + }, } } } @@ -1420,7 +1420,7 @@ describe Chef::Node do "default" => { "foo" => { "bar" => { - "baz" => false, + "baz" => false } } } @@ -1439,7 +1439,7 @@ describe Chef::Node do "automatic" => { "filesystem" => { "/dev/disk0s2" => { "size" => "10mb" }, - "map - autohome" => { "size" => "10mb" } + "map - autohome" => { "size" => "10mb" }, } }, "default" => {}, "normal" => {}, "override" => {} diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb index 34b46f657f..d16294a8aa 100644 --- a/spec/unit/platform_spec.rb +++ b/spec/unit/platform_spec.rb @@ -38,20 +38,20 @@ describe Chef::Platform do }, "9.2.2" => { :file => "darwinian", - :else => "thing" + :else => "thing", }, :default => { :file => "old school", - :snicker => "snack" - } + :snicker => "snack", + }, }, :mars_volta => { }, :default => { :file => Chef::Provider::File, :pax => "brittania", - :cat => "nice" - } + :cat => "nice", + }, } @events = Chef::EventDispatch::Dispatcher.new end @@ -183,18 +183,18 @@ describe Chef::Platform do :platform => :darwin, :version => "9.2.2", :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:darwin]["9.2.2"][:file]).to eql("masterful") Chef::Platform.set( :platform => :darwin, :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:darwin][:default][:file]).to eql("masterful") Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -202,13 +202,13 @@ describe Chef::Platform do :platform => :hero, :version => "9.2.2", :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:hero]["9.2.2"][:file]).to eql("masterful") Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -216,7 +216,7 @@ describe Chef::Platform do Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -230,7 +230,7 @@ describe Chef::Platform do Chef::Platform.set( :resource => :file, :platform => :default, - :provider => "new school" + :provider => "new school", ) expect(Chef::Platform.platforms[:default][:file]).to eql("new school") expect(Chef::Platform.platforms[:default][:cat]).to eql("nice") diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb index 3dfa8d9802..98515a4102 100644 --- a/spec/unit/policy_builder/policyfile_spec.rb +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -56,8 +56,8 @@ describe Chef::PolicyBuilder::Policyfile do "scm_identifier"=> { "vcs"=> "git", "rev_id"=> "9d5b09026470c322c3cb5ca8a4157c4d2f16cef3", - "remote"=> nil - } + "remote"=> nil, + }, } end @@ -67,7 +67,7 @@ describe Chef::PolicyBuilder::Policyfile do "version" => "4.2.0", # NOTE: for compatibility mode we include the dotted id in the policyfile to enhance discoverability. "dotted_decimal_identifier" => id_to_dotted("feab40e1fca77c7360ccca1481bb8ba5f919ce3a"), - "source" => { "api" => "https://community.getchef.com/api/v1/cookbooks/example2" } + "source" => { "api" => "https://community.getchef.com/api/v1/cookbooks/example2" }, } end @@ -85,11 +85,11 @@ describe Chef::PolicyBuilder::Policyfile do "cookbook_locks" => { "example1" => example1_lock_data, - "example2" => example2_lock_data + "example2" => example2_lock_data, }, "default_attributes" => policyfile_default_attributes, - "override_attributes" => policyfile_override_attributes + "override_attributes" => policyfile_override_attributes, } end @@ -286,7 +286,7 @@ describe Chef::PolicyBuilder::Policyfile do it "extracts the cookbooks and versions for display from the policyfile" do expected = [ "example1::default@2.3.5 (168d210)", - "example2::server@4.2.0 (feab40e)" + "example2::server@4.2.0 (feab40e)", ] expect(policy_builder.run_list_with_versions_for_display).to eq(expected) @@ -357,7 +357,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -378,7 +378,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end @@ -419,7 +419,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end @@ -435,7 +435,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -465,7 +465,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -480,7 +480,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end diff --git a/spec/unit/property/state_spec.rb b/spec/unit/property/state_spec.rb index e7fee0387f..032b0aba52 100644 --- a/spec/unit/property/state_spec.rb +++ b/spec/unit/property/state_spec.rb @@ -91,7 +91,7 @@ describe "Chef::Resource#identity and #state" do resource.y 'bar' expect(resource_class.state_properties).to eq [ resource_class.properties[:x], - resource_class.properties[:y] + resource_class.properties[:y], ] expect(resource.state_for_resource_reporter).to eq(x: 'foo', y: 'bar') end @@ -141,7 +141,7 @@ describe "Chef::Resource#identity and #state" do it "The subclass's identity includes both x and y" do expect(subresource_class.identity_properties).to eq [ subresource_class.properties[:x], - subresource_class.properties[:y] + subresource_class.properties[:y], ] subresource.x 'foo' subresource.y 'bar' @@ -162,7 +162,7 @@ describe "Chef::Resource#identity and #state" do expect(subresource.state_for_resource_reporter).to eq(x: 'foo', y: 'bar') expect(subresource_class.state_properties).to eq [ subresource_class.properties[:x], - subresource_class.properties[:y] + subresource_class.properties[:y], ] end it "y is the identity" do @@ -304,7 +304,7 @@ describe "Chef::Resource#identity and #state" do expect(resource_class.state_properties).to eq [ resource_class.properties[:x], resource_class.properties[:y], - resource_class.properties[:z] + resource_class.properties[:z], ] expect(resource.state_for_resource_reporter).to eq(x: 1, y: 2, z: 3) end @@ -323,7 +323,7 @@ describe "Chef::Resource#identity and #state" do resource.z 3 expect(resource_class.state_properties).to eq [ resource_class.properties[:x], - resource_class.properties[:z] + resource_class.properties[:z], ] expect(resource.state_for_resource_reporter).to eq(x: 1, z: 3) end diff --git a/spec/unit/property/validation_spec.rb b/spec/unit/property/validation_spec.rb index a54a38eb85..fef983ccf4 100644 --- a/spec/unit/property/validation_spec.rb +++ b/spec/unit/property/validation_spec.rb @@ -464,7 +464,7 @@ describe "Chef::Resource.property validation" do validation_test 'respond_to: [ :to_s, :split ]', [ 'hi' ], - [ 1, ], + [ 1 ], [ nil ] validation_test 'respond_to: []', diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb index 3af35a17ca..8a55025d9e 100644 --- a/spec/unit/provider/execute_spec.rb +++ b/spec/unit/provider/execute_spec.rb @@ -33,7 +33,7 @@ describe Chef::Provider::Execute do timeout: 3600, returns: 0, log_level: :info, - log_tag: new_resource.to_s + log_tag: new_resource.to_s, } end diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 0106244665..41536a450f 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -224,7 +224,7 @@ SHAS { :user => deploy_user, :environment => { "GIT_SSH" => wrapper, "HOME" => "/home/deployNinja" }, - :log_tag => "git[web2.0 app]" + :log_tag => "git[web2.0 app]", } end before do @@ -254,7 +254,7 @@ SHAS { :user => deploy_user, :environment => { "GIT_SSH" => wrapper, "HOME" => "/home/masterNinja" }, - :log_tag => "git[web2.0 app]" + :log_tag => "git[web2.0 app]", } end before do diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb index a11d790d07..6c4c4d2e07 100644 --- a/spec/unit/provider/group/usermod_spec.rb +++ b/spec/unit/provider/group/usermod_spec.rb @@ -52,7 +52,7 @@ describe Chef::Provider::Group::Usermod do "suse" => "-a -G", "opensuse" => "-a -G", "smartos" => "-G", - "omnios" => "-G" + "omnios" => "-G", } before do diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb index b36bfe364b..55a2f97aa5 100644 --- a/spec/unit/provider/group_spec.rb +++ b/spec/unit/provider/group_spec.rb @@ -39,7 +39,7 @@ describe Chef::Provider::User do @pw_group = double("Struct::Group", :name => "wheel", :gid => 20, - :mem => [ "root", "aj" ] + :mem => [ "root", "aj" ], ) allow(Etc).to receive(:getgrnam).with('wheel').and_return(@pw_group) end diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb index 45688cedb7..4072487f35 100644 --- a/spec/unit/provider/ohai_spec.rb +++ b/spec/unit/provider/ohai_spec.rb @@ -38,8 +38,8 @@ describe Chef::Provider::Ohai do }, :data2 => { :origdata => "somevalue", - :newdata => "somevalue" - } + :newdata => "somevalue", + }, } allow(mock_ohai).to receive(:all_plugins).and_return(true) allow(mock_ohai).to receive(:data).and_return(mock_ohai[:data], diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index 85f9d56e16..2e87faeb48 100644 --- a/spec/unit/provider/osx_profile_spec.rb +++ b/spec/unit/provider/osx_profile_spec.rb @@ -67,7 +67,7 @@ describe Chef::Provider::OsxProfile do "ProfileType"=>"Configuration", "ProfileUUID"=>"6e95927c-f200-54b4-85c7-52ab99b61c47", "ProfileVerificationState"=>"unsigned", - "ProfileVersion"=>1}], + "ProfileVersion"=>1}] } end # If anything is changed within this profile, be sure to update the @@ -95,14 +95,14 @@ describe Chef::Provider::OsxProfile do 'Forced' => [ { 'mcx_preference_settings' => { - 'idleTime' => 0, + 'idleTime' => 0 } - } + }, ] } - } - } - ] + }, + }, + ], } end let(:no_profiles) do @@ -232,7 +232,7 @@ describe Chef::Provider::OsxProfile do "ProfileType"=>"Configuration", "ProfileUUID"=>"1781fbec-3325-565f-9022-8aa28135c3cc", "ProfileVerificationState"=>"unsigned", - "ProfileVersion"=>1}], + "ProfileVersion"=>1}] } end before(:each) do diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index 8528480689..f1845abfb1 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -52,7 +52,7 @@ irssi: it "should create a current resource with the name of the new_resource" do expect(@provider).to receive(:shell_out!).with( "apt-cache policy #{@new_resource.package_name}", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource @@ -95,7 +95,7 @@ libmysqlclient15-dev: virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy libmysqlclient15-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(virtual_package) showpkg_out =<<-SHOWPKG_STDOUT Package: libmysqlclient15-dev @@ -118,7 +118,7 @@ libmysqlclient-dev 5.1.41-3ubuntu12 showpkg = double(:stdout => showpkg_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache showpkg libmysqlclient15-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(showpkg) real_package_out=<<-RPKG_STDOUT libmysqlclient-dev: @@ -136,7 +136,7 @@ libmysqlclient-dev: real_package = double(:stdout => real_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy libmysqlclient-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(real_package) @provider.load_current_resource end @@ -152,7 +152,7 @@ mp3-decoder: virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy mp3-decoder", - :timeout => @timeout + :timeout => @timeout, ).and_return(virtual_package) showpkg_out=<<-SHOWPKG_STDOUT Package: mp3-decoder @@ -178,7 +178,7 @@ mpg123 1.12.1-0ubuntu1 showpkg = double(:stdout => showpkg_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache showpkg mp3-decoder", - :timeout => @timeout + :timeout => @timeout, ).and_return(showpkg) expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package) end @@ -191,7 +191,7 @@ mpg123 1.12.1-0ubuntu1 allow(@new_resource).to receive(:provider).and_return(nil) expect(@provider).to receive(:shell_out!).with( "apt-cache -o APT::Default-Release=lenny-backports policy irssi", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource end @@ -200,7 +200,7 @@ mpg123 1.12.1-0ubuntu1 @new_resource.source "pluto" expect(@provider).to receive(:shell_out!).with( "apt-cache policy #{@new_resource.package_name}", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource @provider.define_resource_requirements @@ -220,7 +220,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!). with( "apt-get -q -y install irssi=0.8.12-7", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("irssi", "0.8.12-7") end @@ -229,7 +229,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes install irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @provider.install_package("irssi", "0.8.12-7") @@ -245,7 +245,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y -o APT::Default-Release=lenny-backports install irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("irssi", "0.8.12-7") @@ -266,7 +266,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y remove irssi", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.remove_package("irssi", "0.8.12-7") end @@ -275,7 +275,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes remove irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @@ -289,7 +289,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y purge irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.purge_package("irssi", "0.8.12-7") end @@ -298,7 +298,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes purge irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @@ -317,7 +317,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "debconf-set-selections /tmp/irssi-0.8.12-7.seed", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.preseed_package(file) @@ -327,7 +327,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "debconf-set-selections /tmp/irssi-0.8.12-7.seed", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) file = @provider.get_preseed_file("irssi", "0.8.12-7") @provider.preseed_package(file) @@ -348,7 +348,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "dpkg-reconfigure irssi", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.reconfig_package("irssi", "0.8.12-7") end @@ -360,7 +360,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y install libmysqlclient-dev", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("libmysqlclient-dev", "not_a_real_version") end @@ -374,7 +374,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y install libmysqlclient-dev irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package(["libmysqlclient-dev", "irssi"], ["not_a_real_version", "0.8.12-7"]) end diff --git a/spec/unit/provider/package/easy_install_spec.rb b/spec/unit/provider/package/easy_install_spec.rb index b734bc57cf..4ac325e7d4 100644 --- a/spec/unit/provider/package/easy_install_spec.rb +++ b/spec/unit/provider/package/easy_install_spec.rb @@ -63,14 +63,14 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install \"boto==1.8d\"" - }) + },) @provider.install_package("boto", "1.8d") end it "should run easy_install with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ :command => "easy_install --always-unzip \"boto==1.8d\"" - }) + },) allow(@new_resource).to receive(:options).and_return("--always-unzip") @provider.install_package("boto", "1.8d") end @@ -78,21 +78,21 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install \"boto==1.8d\"" - }) + },) @provider.upgrade_package("boto", "1.8d") end it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -m boto" - }) + },) @provider.remove_package("boto", "1.8d") end it "should run easy_install -m with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -x -m boto" - }) + },) allow(@new_resource).to receive(:options).and_return("-x") @provider.remove_package("boto", "1.8d") end @@ -100,7 +100,7 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -m boto" - }) + },) @provider.purge_package("boto", "1.8d") end diff --git a/spec/unit/provider/package/homebrew_spec.rb b/spec/unit/provider/package/homebrew_spec.rb index d01d455b09..926c1a0ff0 100644 --- a/spec/unit/provider/package/homebrew_spec.rb +++ b/spec/unit/provider/package/homebrew_spec.rb @@ -38,7 +38,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3', 'bottle' => false, 'devel' => nil, - 'head' => nil + 'head' => nil, }, 'revision' => 0, 'installed' => [], @@ -47,7 +47,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => nil, - 'options' => [] + 'options' => [], } end @@ -59,7 +59,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [{ 'version' => '24.3' }], @@ -68,7 +68,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end @@ -80,7 +80,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3-keggy', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [{ 'version' => '24.3-keggy' }], @@ -89,7 +89,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end @@ -101,7 +101,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3-keggy', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [], @@ -110,7 +110,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end diff --git a/spec/unit/provider/package/windows/exe_spec.rb b/spec/unit/provider/package/windows/exe_spec.rb index 677ab87f29..6756ffa9e0 100644 --- a/spec/unit/provider/package/windows/exe_spec.rb +++ b/spec/unit/provider/package/windows/exe_spec.rb @@ -42,7 +42,7 @@ describe Chef::Provider::Package::Windows::Exe do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => File.join("uninst_dir", "uninst_file") + 'UninstallString' => File.join("uninst_dir", "uninst_file"), }] end let(:uninstall_entry) do @@ -122,12 +122,12 @@ describe Chef::Provider::Package::Windows::Exe do [ { 'DisplayVersion' => 'v1', - 'UninstallString' => File.join("uninst_dir1", "uninst_file1") + 'UninstallString' => File.join("uninst_dir1", "uninst_file1"), }, { 'DisplayVersion' => 'v2', - 'UninstallString' => File.join("uninst_dir2", "uninst_file2") - } + 'UninstallString' => File.join("uninst_dir2", "uninst_file2"), + }, ] end diff --git a/spec/unit/provider/package/windows/msi_spec.rb b/spec/unit/provider/package/windows/msi_spec.rb index 9377dcaad9..835bd4ad19 100644 --- a/spec/unit/provider/package/windows/msi_spec.rb +++ b/spec/unit/provider/package/windows/msi_spec.rb @@ -35,7 +35,7 @@ describe Chef::Provider::Package::Windows::MSI do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }] end let(:uninstall_entry) do @@ -130,12 +130,12 @@ describe Chef::Provider::Package::Windows::MSI do [ { 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }, { 'DisplayVersion' => 'really_outdated', - 'UninstallString' => "MsiExec.exe /X{guid2}" - } + 'UninstallString' => "MsiExec.exe /X{guid2}", + }, ] end diff --git a/spec/unit/provider/package/windows_spec.rb b/spec/unit/provider/package/windows_spec.rb index 6952a91d92..200cc9888a 100644 --- a/spec/unit/provider/package/windows_spec.rb +++ b/spec/unit/provider/package/windows_spec.rb @@ -171,7 +171,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "blah blah" + 'UninstallString' => "blah blah", }] end let(:uninstall_key) { "blah" } @@ -192,7 +192,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }] end @@ -205,7 +205,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => %q{"c:/hfhfheru/uninst.exe"} + 'UninstallString' => %q{"c:/hfhfheru/uninst.exe"}, }] end diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb index 41118b70fb..70ab257a54 100644 --- a/spec/unit/provider/package/yum_spec.rb +++ b/spec/unit/provider/package/yum_spec.rb @@ -36,7 +36,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [ "kernel" ], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -172,7 +172,7 @@ describe Chef::Provider::Package::Yum do allow(@yum_cache).to receive(:package_available?) { |pkg| pkg == 'cups' ? true : false } allow(@yum_cache).to receive(:packages_from_require) do |pkg| [Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.3", "noarch", [], false, true, "base"), - Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.2", "noarch", [], false, true, "base"),] + Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.2", "noarch", [], false, true, "base")] end expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{checking yum info}) expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{installed version}) @@ -320,7 +320,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) } @@ -395,7 +395,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -417,7 +417,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -440,7 +440,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -465,7 +465,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -485,7 +485,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -510,7 +510,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -580,7 +580,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5_2.3", :package_available? => true, :version_available? => nil, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -599,7 +599,7 @@ describe Chef::Provider::Package::Yum do :package_available? => true, :version_available? => true, :allow_multi_install => [ "kernel" ], - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -619,7 +619,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [ "cups" ], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -643,7 +643,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -710,7 +710,7 @@ describe Chef::Provider::Package::Yum do :package_available? => true, :version_available? => true, :allow_multi_install => [ "kernel" ], - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -726,7 +726,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return('11') expect(@provider).to receive(:upgrade_package).with( "cups", - "11" + "11", ) @provider.run_action(:upgrade) end @@ -745,7 +745,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return('11') expect(@provider).to receive(:upgrade_package).with( "cups", - "11" + "11", ) @provider.run_action(:upgrade) end @@ -792,7 +792,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) @provider.yum_command("-d0 -e0 -y install emacs-1.0") end @@ -802,7 +802,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) end @@ -813,7 +813,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) # will still raise an exception, can't stub out the subsequent call expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) @@ -825,7 +825,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).twice.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) # will still raise an exception, can't stub out the subsequent call expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) @@ -839,7 +839,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum-deprecated -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) @provider.yum_command("-d0 -e0 -y install emacs-1.0") end @@ -856,7 +856,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "0:3.3", [ 0, "3.3", nil ] ], [ "9:1.7.3", [ 9, "1.7.3", nil ] ], - [ "15:20020927", [ 15, "20020927", nil ] ] + [ "15:20020927", [ 15, "20020927", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -866,7 +866,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ ":3.3", [ 0, "3.3", nil ] ], [ "-1:1.7.3", [ nil, nil, "1:1.7.3" ] ], - [ "-:20020927", [ nil, nil, ":20020927" ] ] + [ "-:20020927", [ nil, nil, ":20020927" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -876,7 +876,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3", [ nil, "3.3", nil ] ], [ "1.7.3", [ nil, "1.7.3", nil ] ], - [ "20020927", [ nil, "20020927", nil ] ] + [ "20020927", [ nil, "20020927", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -886,7 +886,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3..3", [ nil, "3..3", nil ] ], [ "0001.7.3", [ nil, "0001.7.3", nil ] ], - [ "20020927,3", [ nil, "20020927,3", nil ] ] + [ "20020927,3", [ nil, "20020927,3", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -896,7 +896,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3-0.pre3.1.60.el5_5.1", [ nil, "3.3", "0.pre3.1.60.el5_5.1" ] ], [ "1.7.3-1jpp.2.el5", [ nil, "1.7.3", "1jpp.2.el5" ] ], - [ "20020927-46.el5", [ nil, "20020927", "46.el5" ] ] + [ "20020927-46.el5", [ nil, "20020927", "46.el5" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -906,7 +906,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3-", [ nil, "3.3", nil ] ], [ "-1jpp.2.el5", [ nil, nil, "1jpp.2.el5" ] ], - [ "-0020020927-46.el5", [ nil, "-0020020927", "46.el5" ] ] + [ "-0020020927-46.el5", [ nil, "-0020020927", "46.el5" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -982,7 +982,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ nil, "1.0.1", -1 ], [ "1.0.1", "", 1 ], [ "", "", 0 ], - [ "", "1.0.1", -1 ] + [ "", "1.0.1", -1 ], ].each do |x, y, result| expect(@rpmutils.rpmvercmp(x,y)).to eq(result) end @@ -1001,7 +1001,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do end it "tests isalpha good input" do - [ 'a', 'z', 'A', 'Z', ].each do |t| + [ 'a', 'z', 'A', 'Z' ].each do |t| expect(@rpmutils.isalpha(t)).to eq(true) end end @@ -1013,7 +1013,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do end it "tests isdigit good input" do - [ '0', '9', ].each do |t| + [ '0', '9' ].each do |t| expect(@rpmutils.isdigit(t)).to eq(true) end end @@ -1102,7 +1102,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:1.4.10-7.20090624svn.el5", "0:1.4.10-7.20090625svn.el5" ], [ "0:2.3.4-2.el5", - "0:2.3.4-2.el6" ] + "0:2.3.4-2.el6" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1128,7 +1128,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:1.9", "3:1.9" ], [ "2.3-2.el5", - "2.3-2.el6" ] + "2.3-2.el6" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1145,7 +1145,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:2.3-15.el5", "0:2.3-15.el5" ], [ "0:alpha9.8-27.2", - "0:alpha9.8-27.2" ] + "0:alpha9.8-27.2" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1160,7 +1160,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "2.3-15.el5", "2.3-15.el5" ], [ "alpha9.8-3", - "alpha9.8-3" ] + "alpha9.8-3" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1460,7 +1460,7 @@ describe Chef::Provider::Package::Yum::RPMDependency do [ "=", :== ], [ "==", :== ], [ "<=", :<= ], - [ "<", :< ] + [ "<", :< ], ].each do |before, after| @rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1") expect(@rpmdep.flag).to eq(after) @@ -1474,7 +1474,7 @@ describe Chef::Provider::Package::Yum::RPMDependency do [ ">>", :== ], [ "<<", :== ], [ "!", :== ], - [ "~", :== ] + [ "~", :== ], ].each do |before, after| @rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1") expect(@rpmdep.name).to eq("testing #{before} 1:1.1-1") @@ -1549,12 +1549,12 @@ describe Chef::Provider::Package::Yum::RPMDb do # name, version, arch, installed, available deps_v = [ Chef::Provider::Package::Yum::RPMDependency.parse("libz.so.1()(64bit)"), - Chef::Provider::Package::Yum::RPMDependency.parse("test-package-a = 0:1.6.5-9.36.el5") + Chef::Provider::Package::Yum::RPMDependency.parse("test-package-a = 0:1.6.5-9.36.el5"), ] deps_z = [ Chef::Provider::Package::Yum::RPMDependency.parse("libz.so.1()(64bit)"), Chef::Provider::Package::Yum::RPMDependency.parse("config(test) = 0:1.6.5-9.36.el5"), - Chef::Provider::Package::Yum::RPMDependency.parse("test-package-c = 0:1.6.5-9.36.el5") + Chef::Provider::Package::Yum::RPMDependency.parse("test-package-c = 0:1.6.5-9.36.el5"), ] @rpm_v = Chef::Provider::Package::Yum::RPMDbPackage.new("test-package-a", "0:1.6.5-9.36.el5", "i386", deps_v, true, false, "base") @rpm_w = Chef::Provider::Package::Yum::RPMDbPackage.new("test-package-b", "0:1.6.5-9.36.el5", "i386", [], true, true, "extras") @@ -2127,7 +2127,7 @@ describe "Chef::Provider::Package::Yum - Multi" do :version_available? => true, :allow_multi_install => [ 'kernel' ], :package_repository => 'base', - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb index f77c2b5d0d..cf905aeab7 100644 --- a/spec/unit/provider/package_spec.rb +++ b/spec/unit/provider/package_spec.rb @@ -58,7 +58,7 @@ describe Chef::Provider::Package do new_resource.response_file("foo") expect(provider).to receive(:get_preseed_file).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return("/var/cache/preseed-test") expect(provider).to receive(:preseed_package).with( @@ -75,7 +75,7 @@ describe Chef::Provider::Package do it "should install the package at the candidate_version if it is not already installed" do expect(provider).to receive(:install_package).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -85,7 +85,7 @@ describe Chef::Provider::Package do new_resource.version("1.0") expect(provider).to receive(:install_package).with( new_resource.name, - new_resource.version + new_resource.version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -96,7 +96,7 @@ describe Chef::Provider::Package do allow(current_resource).to receive(:version).and_return("0.99") expect(provider).to receive(:install_package).with( new_resource.name, - new_resource.version + new_resource.version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -144,7 +144,7 @@ describe Chef::Provider::Package do it "should upgrade the package if the current version is not the candidate version" do expect(provider).to receive(:upgrade_package).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -468,7 +468,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:install_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -481,7 +481,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:install_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -494,7 +494,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:upgrade_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -507,7 +507,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:upgrade_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -521,7 +521,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:remove_package).with( [ "vim" ], - [ nil ] + [ nil ], ).and_return(true) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action @@ -535,7 +535,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:purge_package).with( [ "vim" ], - [ nil ] + [ nil ], ).and_return(true) provider.run_action(:purge) expect(new_resource).to be_updated_by_last_action @@ -582,7 +582,7 @@ describe "Chef::Provider::Package - Multi" do it "installs the candidate versions when none are installed" do expect(provider).to receive(:install_package).with( ["emacs", "vi"], - ["1.0", "6.2"] + ["1.0", "6.2"], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated @@ -591,7 +591,7 @@ describe "Chef::Provider::Package - Multi" do it "installs the candidate versions when some are installed" do expect(provider).to receive(:install_package).with( [ 'vi' ], - [ '6.2' ] + [ '6.2' ], ).and_return(true) current_resource.version(['1.0', nil]) provider.run_action(:install) @@ -675,7 +675,7 @@ describe "Chef::Provider::Package - Multi" do current_resource.version ['0.9', '6.1'] expect(provider).to receive(:upgrade_package).with( new_resource.package_name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -685,7 +685,7 @@ describe "Chef::Provider::Package - Multi" do current_resource.version ['1.0', '6.1'] expect(provider).to receive(:upgrade_package).with( ["vi"], - ["6.2"] + ["6.2"], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action diff --git a/spec/unit/provider/remote_file/content_spec.rb b/spec/unit/provider/remote_file/content_spec.rb index ce18d23a09..2639c39faa 100644 --- a/spec/unit/provider/remote_file/content_spec.rb +++ b/spec/unit/provider/remote_file/content_spec.rb @@ -180,7 +180,7 @@ describe Chef::Provider::RemoteFile::Content do Timeout::Error, Net::HTTPServerException, Net::HTTPFatalError, - Net::FTPError + Net::FTPError, ].each do |exception| describe "with an exception of #{exception}" do before do diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb index a4667e8ce8..346e349db7 100644 --- a/spec/unit/provider/service/debian_service_spec.rb +++ b/spec/unit/provider/service/debian_service_spec.rb @@ -134,12 +134,12 @@ describe Chef::Provider::Service::Debian do "3"=>[:start, "20"], "4"=>[:start, "20"], "5"=>[:start, "20"], - "6"=>[:stop, "20"] - } + "6"=>[:stop, "20"], + }, }, "not linked" => { "stdout" => " Removing any system startup links for /etc/init.d/chef ...", - "stderr" => "" + "stderr" => "", }, }, "Debian/Squeeze and earlier" => { @@ -162,13 +162,13 @@ insserv: remove service /etc/init.d/../rc0.d/K20chef-client "3"=>[:start, "20"], "4"=>[:start, "20"], "5"=>[:start, "20"], - "6"=>[:stop, "20"] - } + "6"=>[:stop, "20"], + }, }, "not linked" => { "stdout" => "update-rc.d: using dependency based boot sequencing", - "stderr" => "" - } + "stderr" => "", + }, }, "Debian/Wheezy and earlier, a service only starting at run level S" => { "linked" => { @@ -184,14 +184,14 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop "0"=>[:stop, "06"], "1"=>[:stop, "06"], "6"=>[:stop, "06"], - "S"=>[:start, "13"] - } + "S"=>[:start, "13"], + }, }, "not linked" => { "stdout" => "", - "stderr" => "insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop" - } - } + "stderr" => "insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop", + }, + }, }.each do |model, expected_results| context "on #{model}" do context "when update-rc.d shows init linked to rc*.d/" do @@ -311,7 +311,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' defaults" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} defaults" + "/usr/sbin/update-rc.d #{service_name} defaults", ]) @provider.enable_service end @@ -325,7 +325,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' defaults" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} defaults 75 25" + "/usr/sbin/update-rc.d #{service_name} defaults 75 25", ]) @provider.enable_service end @@ -339,7 +339,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' with those priorities" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} start 20 2 . stop 55 3 . " + "/usr/sbin/update-rc.d #{service_name} start 20 2 . stop 55 3 . ", ]) @provider.enable_service end @@ -352,7 +352,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d -f 'service_name' remove + stop with default priority" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d -f #{service_name} stop 80 2 3 4 5 ." + "/usr/sbin/update-rc.d -f #{service_name} stop 80 2 3 4 5 .", ]) @provider.disable_service end @@ -366,7 +366,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d -f 'service_name' remove + stop with the specified priority" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d -f #{service_name} stop #{100 - @new_resource.priority} 2 3 4 5 ." + "/usr/sbin/update-rc.d -f #{service_name} stop #{100 - @new_resource.priority} 2 3 4 5 .", ]) @provider.disable_service end diff --git a/spec/unit/provider/service/solaris_smf_service_spec.rb b/spec/unit/provider/service/solaris_smf_service_spec.rb index 62c3ac6c6e..4ff3e89ae3 100644 --- a/spec/unit/provider/service/solaris_smf_service_spec.rb +++ b/spec/unit/provider/service/solaris_smf_service_spec.rb @@ -42,7 +42,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # disabled / stopped service (svcs -l chef) @@ -56,7 +56,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # disabled / stopped service (svcs -l chef) @@ -70,7 +70,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # shell_out! return value for a service that is running diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index b225972e87..6683a75f42 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -52,7 +52,7 @@ describe Chef::Provider::User::Pw do 'home' => "-d", 'gid' => "-g", 'uid' => "-u", - 'shell' => "-s" + 'shell' => "-s", } field_list.each do |attribute, option| it "should check for differences in #{attribute} between the new and current resources" do diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb index b9f6ee0d86..a295dff679 100644 --- a/spec/unit/provider/user/useradd_spec.rb +++ b/spec/unit/provider/user/useradd_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::User::Useradd do 'gid' => "-g", 'uid' => "-u", 'shell' => "-s", - 'password' => "-p" + 'password' => "-p", } include_examples "a useradd-based user provider", supported_useradd_options diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb index bd24a6a01e..c38abcc049 100644 --- a/spec/unit/provider/user_spec.rb +++ b/spec/unit/provider/user_spec.rb @@ -114,7 +114,7 @@ describe Chef::Provider::User do :gid => :gid, :comment => :gecos, :home => :dir, - :shell => :shell + :shell => :shell, } user_attrib_map.each do |user_attrib, getpwnam_attrib| it "should set the current resources #{user_attrib} based on getpwnam #{getpwnam_attrib}" do @@ -198,7 +198,7 @@ describe Chef::Provider::User do 'gid' => [1000, 1001], 'home' => ["/home/adam", "/Users/adam"], 'shell'=> ["/usr/bin/zsh", "/bin/bash"], - 'password'=> ["abcd","12345"] + 'password'=> ["abcd","12345"], } } diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 8c087cf3f3..cee097e715 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -259,7 +259,7 @@ describe Chef::ProviderResolver do Chef::Provider::Service::Invokercd, ) expect(provider_resolver.supported_handlers).to_not include( - Chef::Provider::Service::Upstart, + Chef::Provider::Service::Upstart ) end @@ -314,7 +314,7 @@ describe Chef::ProviderResolver do it "supports only the upstart handler" do expect(provider_resolver.supported_handlers).to include( - Chef::Provider::Service::Upstart, + Chef::Provider::Service::Upstart ) expect(provider_resolver.supported_handlers).to_not include( Chef::Provider::Service::Debian, @@ -591,35 +591,35 @@ describe Chef::ProviderResolver do # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ], }, "5.0" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] }, }, "gcel" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "linaro" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "linuxmint" => { "3.1.4" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ], - }, + } }, "raspbian" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "ubuntu" => { "11.10" => { }, "10.04" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] }, }, }, @@ -640,7 +640,7 @@ describe Chef::ProviderResolver do "freebsd" => { "3.1.4" => { - }, + } }, }, "suse" => { @@ -649,7 +649,7 @@ describe Chef::ProviderResolver do "12.0" => { }, %w(11.1 11.2 11.3) => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] }, }, "opensuse" => { @@ -659,7 +659,7 @@ describe Chef::ProviderResolver do "12.3" => { }, "12.2" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] }, }, }, @@ -672,7 +672,7 @@ describe Chef::ProviderResolver do "gentoo" => { "3.1.4" => { - }, + } }, }, @@ -684,7 +684,7 @@ describe Chef::ProviderResolver do %w(amazon xcp xenserver ibm_powerkvm cloudlinux parallels) => { "3.1.4" => { # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], - }, + } }, %w(redhat centos scientific oracle) => { "7.0" => { @@ -713,9 +713,9 @@ describe Chef::ProviderResolver do "mac_os_x" => { "10.9.2" => { - }, + } }, - }, + } }, "windows" => { @@ -734,8 +734,8 @@ describe Chef::ProviderResolver do "windows" => { %w(mswin mingw32 windows) => { "10.9.2" => { - }, - }, + } + } }, }, @@ -754,8 +754,8 @@ describe Chef::ProviderResolver do "aix" => { "aix" => { "5.6" => { - }, - }, + } + } }, }, @@ -773,10 +773,10 @@ describe Chef::ProviderResolver do "netbsd" => { "netbsd" => { "3.1.4" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ], - }, - }, - }, + group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ] + } + } + } }, "openbsd" => { @@ -786,8 +786,8 @@ describe Chef::ProviderResolver do "openbsd" => { "openbsd" => { "3.1.4" => { - }, - }, + } + } }, }, @@ -804,32 +804,32 @@ describe Chef::ProviderResolver do "smartos" => { "3.1.4" => { - }, + } }, }, "solaris2" => { "nexentacore" => { "3.1.4" => { - }, + } }, "omnios" => { "3.1.4" => { - user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], + user: [ Chef::Resource::User, Chef::Provider::User::Solaris ] } }, "openindiana" => { "3.1.4" => { - }, + } }, "opensolaris" => { "3.1.4" => { - }, + } }, "solaris2" => { user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], "5.11" => { - package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ], + package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ] }, "5.9" => { }, @@ -842,9 +842,9 @@ describe Chef::ProviderResolver do "solaris" => { "solaris" => { "3.1.4" => { - }, - }, - }, + } + } + } }, "exherbo" => { @@ -856,7 +856,7 @@ describe Chef::ProviderResolver do } } } - } + }, } def self.create_provider_tests(providers, test, expected, filter) diff --git a/spec/unit/resource/rpm_package_spec.rb b/spec/unit/resource/rpm_package_spec.rb index d3b505fff5..b2e06f7f68 100644 --- a/spec/unit/resource/rpm_package_spec.rb +++ b/spec/unit/resource/rpm_package_spec.rb @@ -27,7 +27,7 @@ describe Chef::Resource::RpmPackage, "initialize" do provider: Chef::Provider::Package::Rpm, name: :rpm_package, action: :install, - os: os + os: os, ) end diff --git a/spec/unit/resource/windows_package_spec.rb b/spec/unit/resource/windows_package_spec.rb index 6aa5d357ea..3623c24e29 100644 --- a/spec/unit/resource/windows_package_spec.rb +++ b/spec/unit/resource/windows_package_spec.rb @@ -28,7 +28,7 @@ describe Chef::Resource::WindowsPackage, "initialize" do provider: Chef::Provider::Package::Windows, os: "windows", name: :windows_package, - action: :start + action: :start, ) let(:resource) { Chef::Resource::WindowsPackage.new("solitaire.msi") } diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb index 45a295c24e..64bb05afc4 100644 --- a/spec/unit/resource/windows_service_spec.rb +++ b/spec/unit/resource/windows_service_spec.rb @@ -24,7 +24,7 @@ describe Chef::Resource::WindowsService, "initialize" do provider: Chef::Provider::Service::Windows, os: "windows", name: :windows_service, - action: :start + action: :start, ) let(:resource) { Chef::Resource::WindowsService.new("BITS") } diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index da29cdcc02..34d4b23106 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -696,8 +696,8 @@ describe Chef::ResourceReporter do expect(@rest_client).to receive(:raw_request).ordered do |method, url, headers, data| expect(method).to eq(:POST) expect(headers).to eq({'Content-Encoding' => 'gzip', - 'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION - }) + 'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION, + },) data_stream = Zlib::GzipReader.new(StringIO.new(data)) data = data_stream.read expect(data).to eq(Chef::JSONCompat.to_json(@expected_data)) diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 856ec07b9e..82d224e810 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -820,7 +820,7 @@ describe Chef::Resource do runner = Chef::Runner.new(run_context) Chef::Platform.set( :resource => :cat, - :provider => Chef::Provider::SnakeOil + :provider => Chef::Provider::SnakeOil, ) resource1.only_if { snitch_var1 = 1 } diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 3eee997c50..3ecbbd14b8 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -292,7 +292,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID' => request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } end @@ -341,7 +341,7 @@ describe Chef::REST do let(:custom_headers) do { 'X-Custom-ChefSecret' => 'sharpknives', - 'X-Custom-RequestPriority' => 'extremely low' + 'X-Custom-RequestPriority' => 'extremely low', } end @@ -575,7 +575,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID'=> request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) rest.streaming_request(url, {}) @@ -587,7 +587,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID'=> request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) rest.streaming_request(url, {}) diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb index 99801575ef..efc2a6f63f 100644 --- a/spec/unit/run_context_spec.rb +++ b/spec/unit/run_context_spec.rb @@ -57,33 +57,33 @@ describe Chef::RunContext do expect(run_context.node[:cookbooks]).to eql( { "circular-dep1" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "circular-dep2" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "dependency1" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "dependency2" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "include" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "no-default-attr" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test-with-circular-deps" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test-with-deps" => { - "version" => "0.0.0", + "version" => "0.0.0" }, - } + }, ) end diff --git a/spec/unit/run_list/versioned_recipe_list_spec.rb b/spec/unit/run_list/versioned_recipe_list_spec.rb index be57d6c944..356b9d682c 100644 --- a/spec/unit/run_list/versioned_recipe_list_spec.rb +++ b/spec/unit/run_list/versioned_recipe_list_spec.rb @@ -87,7 +87,7 @@ describe Chef::RunList::VersionedRecipeList do [ {:name => "apt", :version => "1.0.0"}, {:name => "god", :version => nil}, - {:name => "apache2", :version => "0.0.1"} + {:name => "apache2", :version => "0.0.1"}, ] end it "should return an array of hashes with :name and :version" do @@ -108,7 +108,7 @@ describe Chef::RunList::VersionedRecipeList do [ {:name => "apt", :version => "~> 1.2.0"}, {:name => "god", :version => nil}, - {:name => "apache2", :version => "0.0.1"} + {:name => "apache2", :version => "0.0.1"}, ] end diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index b30f818da1..46074728c2 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -104,7 +104,7 @@ describe Chef::Runner do # set up old Chef::Platform resolution instead of provider_resolver Chef::Platform.set( :resource => :cat, - :provider => Chef::Provider::SnakeOil + :provider => Chef::Provider::SnakeOil, ) allow(Chef::ProviderResolver).to receive(:new).and_return(provider_resolver) allow(provider_resolver).to receive(:maybe_dynamic_provider_resolution).with(first_resource, anything()).and_return(nil) diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index c390f658bc..d54e8b5391 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -30,7 +30,7 @@ describe Chef::Search::Query do let(:filter_hash) { { 'env' => [ 'chef_environment' ], - 'ruby_plat' => [ 'languages', 'ruby', 'platform' ] + 'ruby_plat' => [ 'languages', 'ruby', 'platform' ], } } let(:response) { @@ -39,30 +39,30 @@ describe Chef::Search::Query do { "url" => "#{server_url}/my-name-is-node", "data" => { "env" => "elysium", - "ruby_plat" => "nudibranch" - } + "ruby_plat" => "nudibranch", + }, }, { "url" => "#{server_url}/my-name-is-jonas", "data" => { "env" => "hades", - "ruby_plat" => "i386-mingw32" - } + "ruby_plat" => "i386-mingw32", + }, }, { "url" => "#{server_url}/my-name-is-flipper", "data" => { "env" => "elysium", - "ruby_plat" => "centos" - } + "ruby_plat" => "centos", + }, }, { "url" => "#{server_url}/my-name-is-butters", "data" => { "env" => "moon", "ruby_plat" => "solaris2", - } - } + }, + }, ], "start" => 0, - "total" => 4 + "total" => 4, } } let(:response_rows) { @@ -70,7 +70,7 @@ describe Chef::Search::Query do { "env" => "elysium", "ruby_plat" => "nudibranch" }, { "env" => "hades", "ruby_plat" => "i386-mingw32"}, { "env" => "elysium", "ruby_plat" => "centos"}, - { "env" => "moon", "ruby_plat" => "solaris2"} + { "env" => "moon", "ruby_plat" => "solaris2"}, ] } end @@ -97,10 +97,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "nudibranch", "version" => "1.9.3", - "target" => "ming-the-merciless" + "target" => "ming-the-merciless", } } - } + }, }, { "name" => "my-name-is-jonas", "chef_environment" => "hades", @@ -111,10 +111,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "i386-mingw32", "version" => "1.9.3", - "target" => "bilbo" + "target" => "bilbo", } } - } + }, }, { "name" => "my-name-is-flipper", "chef_environment" => "elysium", @@ -125,10 +125,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "centos", "version" => "2.0.0", - "target" => "uno" + "target" => "uno", } } - } + }, }, { "name" => "my-name-is-butters", "chef_environment" => "moon", @@ -139,14 +139,14 @@ describe Chef::Search::Query do "ruby" => { "platform" => "solaris2", "version" => "2.1.2", - "target" => "random" + "target" => "random", } } - } + }, }, ], "start" => 0, - "total" => 4 + "total" => 4, } } let(:big_response) { @@ -159,7 +159,7 @@ describe Chef::Search::Query do { "start" => 0, "total" => 8, - "rows" => [] + "rows" => [], } } diff --git a/spec/unit/user_v1_spec.rb b/spec/unit/user_v1_spec.rb index a981de1d8c..d2ba0cf4de 100644 --- a/spec/unit/user_v1_spec.rb +++ b/spec/unit/user_v1_spec.rb @@ -261,7 +261,7 @@ describe Chef::UserV1 do "password" => "password", "public_key" => "turtles", "private_key" => "pandas", - "create_key" => false + "create_key" => false, } @user = Chef::UserV1.from_json(Chef::JSONCompat.to_json(user)) end @@ -341,7 +341,7 @@ describe Chef::UserV1 do :middle_name => "some_middle_name", :last_name => "some_last_name", :email => "some_email", - :password => "some_password" + :password => "some_password", } } @@ -364,7 +364,7 @@ describe Chef::UserV1 do :last_name => "some_last_name", :email => "some_email", :password => "some_password", - :public_key => "some_public_key" + :public_key => "some_public_key", } } @@ -450,7 +450,7 @@ describe Chef::UserV1 do :first_name => "some_first_name", :last_name => "some_last_name", :email => "some_email", - :password => "some_password" + :password => "some_password", } } before do @@ -509,7 +509,7 @@ describe Chef::UserV1 do describe "reregister" do let(:payload) { { - "username" => "some_username", + "username" => "some_username" } } diff --git a/spec/unit/util/dsc/resource_store.rb b/spec/unit/util/dsc/resource_store.rb index a89e73fcaa..181ac2bb6c 100644 --- a/spec/unit/util/dsc/resource_store.rb +++ b/spec/unit/util/dsc/resource_store.rb @@ -24,14 +24,14 @@ describe Chef::Util::DSC::ResourceStore do let(:resource_a) { { 'ResourceType' => 'AFoo', 'Name' => 'Foo', - 'Module' => {'Name' => 'ModuleA'} + 'Module' => {'Name' => 'ModuleA'}, } } let(:resource_b) { { 'ResourceType' => 'BFoo', 'Name' => 'Foo', - 'Module' => {'Name' => 'ModuleB'} + 'Module' => {'Name' => 'ModuleB'}, } } diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb index fe1488550b..f1f55c7b05 100644 --- a/spec/unit/version_class_spec.rb +++ b/spec/unit/version_class_spec.rb @@ -90,7 +90,7 @@ describe Chef::Version do ["1.2", "1.3.0"], ["1.2", "1.3"], ["1.2", "2.1.1"], - ["1.2", "2.1"] + ["1.2", "2.1"], ] examples.each do |smaller, larger| sm = Chef::Version.new(smaller) @@ -158,7 +158,7 @@ describe Chef::Version do [ "1.2.2", :>=, "1.2.1", true ], [ "1.2.2", :==, "1.2.1", false ], [ "1.2.2", :<=, "1.2.1", false ], - [ "1.2.2", :<, "1.2.1", false ] + [ "1.2.2", :<, "1.2.1", false ], ].each do |spec| it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do got = Chef::Version.new(spec[0]).send(spec[1], diff --git a/spec/unit/windows_service_spec.rb b/spec/unit/windows_service_spec.rb index 031a3124f8..adc128c9d8 100644 --- a/spec/unit/windows_service_spec.rb +++ b/spec/unit/windows_service_spec.rb @@ -26,14 +26,14 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: STDOUT, config_file: "test_config_file", - log_level: :info + log_level: :info, } end let(:timeout) { 7200 } let(:shellout_options) do { :timeout => timeout, - :logger => Chef::Log + :logger => Chef::Log, } end @@ -52,7 +52,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "passes DEFAULT_LOG_LOCATION to chef-client instead of STDOUT" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{Chef::Application::WindowsService::DEFAULT_LOG_LOCATION}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -63,7 +63,7 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: tempfile.path, config_file: "test_config_file", - log_level: :info + log_level: :info, } end @@ -74,7 +74,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "uses the configured log location" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{tempfile.path}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -84,14 +84,14 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: Chef::Log::WinEvt.new, config_file: "test_config_file", - log_level: :info + log_level: :info, } end it "does not pass log location to new process" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -108,7 +108,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "passes watchdog timeout to new process" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{Chef::Application::WindowsService::DEFAULT_LOG_LOCATION}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end diff --git a/tasks/external_tests.rb b/tasks/external_tests.rb index 6742d3f88d..805ea323cb 100644 --- a/tasks/external_tests.rb +++ b/tasks/external_tests.rb @@ -52,7 +52,7 @@ EXTERNAL_PROJECTS = { "chef-rewind" => "rake spec", "poise" => "rake spec", "halite" => "rake spec", - "knife-windows" => "rake unit_spec" + "knife-windows" => "rake unit_spec", } task :external_specs => EXTERNAL_PROJECTS.keys.map { |g| :"#{g.sub("-","_")}_spec" } |