diff options
36 files changed, 86 insertions, 86 deletions
diff --git a/chef-config/chef-config.gemspec b/chef-config/chef-config.gemspec index f59741629f..afbd69f188 100644 --- a/chef-config/chef-config.gemspec +++ b/chef-config/chef-config.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| end spec.files = %w{Rakefile LICENSE README.md} + Dir.glob("*.gemspec") + - Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) } + Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) } spec.bindir = "bin" spec.executables = [] diff --git a/lib/chef/cookbook/cookbook_collection.rb b/lib/chef/cookbook/cookbook_collection.rb index 853657fb38..81e7bb92b4 100644 --- a/lib/chef/cookbook/cookbook_collection.rb +++ b/lib/chef/cookbook/cookbook_collection.rb @@ -36,7 +36,7 @@ class Chef def initialize(cookbook_versions = {}) super() do |hash, key| raise Chef::Exceptions::CookbookNotFound, "Cookbook #{key} not found. " << - "If you're loading #{key} from another cookbook, make sure you configure the dependency in your metadata" + "If you're loading #{key} from another cookbook, make sure you configure the dependency in your metadata" end cookbook_versions.each { |cookbook_name, cookbook_version| self[cookbook_name] = cookbook_version } end diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index 62e17d4f3b..7d14cea44f 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -828,7 +828,7 @@ INVALID def validate_calculated_default_rule(options) calculated_conflict = ((options[:default].is_a?(Array) && !options[:default].empty?) || (options[:default].is_a?(String) && !options[:default] != "")) && - options[:calculated] == true + options[:calculated] == true raise ArgumentError, "Default cannot be specified if calculated is true!" if calculated_conflict end diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb index 9428858cdf..e0a02a05cf 100644 --- a/lib/chef/http/basic_client.rb +++ b/lib/chef/http/basic_client.rb @@ -98,7 +98,7 @@ class Chef #adapted from buildr/lib/buildr/core/transports.rb def proxy_uri proxy = Chef::Config["#{url.scheme}_proxy"] || - env["#{url.scheme.upcase}_PROXY"] || env["#{url.scheme}_proxy"] + env["#{url.scheme.upcase}_PROXY"] || env["#{url.scheme}_proxy"] # Check if the proxy string contains a scheme. If not, add the url's scheme to the # proxy before parsing. The regex /^.*:\/\// matches, for example, http://. Reusing proxy diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb index 164a2cdeda..fb43f8721b 100644 --- a/lib/chef/knife.rb +++ b/lib/chef/knife.rb @@ -244,7 +244,7 @@ class Chef # Mention rehash when the subcommands cache(plugin_manifest.json) is used if subcommand_loader.is_a?(Chef::Knife::SubcommandLoader::HashedCommandLoader) || - subcommand_loader.is_a?(Chef::Knife::SubcommandLoader::CustomManifestLoader) + subcommand_loader.is_a?(Chef::Knife::SubcommandLoader::CustomManifestLoader) ui.info("If this is a recently installed plugin, please run 'knife rehash' to update the subcommands cache.") end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 971257bf9e..280960f3c6 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -368,7 +368,7 @@ class Chef # chef-vault integration must use the new client-side hawtness, otherwise to use the # new client-side hawtness, just delete your validation key. if chef_vault_handler.doing_chef_vault? || - (Chef::Config[:validation_key] && !File.exist?(File.expand_path(Chef::Config[:validation_key]))) + (Chef::Config[:validation_key] && !File.exist?(File.expand_path(Chef::Config[:validation_key]))) unless config[:chef_node_name] ui.error("You must pass a node name with -N when bootstrapping with user credentials") diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index e62a9dd05c..df41aa7265 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -97,7 +97,7 @@ EOH user_create = Chef::Knife::UserCreate.new user_create.name_args = [ new_client_name ] user_create.config[:user_password] = config[:user_password] || - ui.ask("Please enter a password for the new user: ") { |q| q.echo = false } + ui.ask("Please enter a password for the new user: ") { |q| q.echo = false } user_create.config[:admin] = true user_create.config[:file] = new_client_key user_create.config[:yes] = true diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb index a2d7bd4bc1..e16e21ae64 100644 --- a/lib/chef/knife/cookbook_upload.rb +++ b/lib/chef/knife/cookbook_upload.rb @@ -151,7 +151,7 @@ class Chef ui.info "Uploaded #{upload_ok} cookbook#{upload_ok > 1 ? "s" : ""}." elsif upload_failures > 0 && upload_ok > 0 ui.warn "Uploaded #{upload_ok} cookbook#{upload_ok > 1 ? "s" : ""} ok but #{upload_failures} " + - "cookbook#{upload_failures > 1 ? "s" : ""} upload failed." + "cookbook#{upload_failures > 1 ? "s" : ""} upload failed." elsif upload_failures > 0 && upload_ok == 0 ui.error "Failed to upload #{upload_failures} cookbook#{upload_failures > 1 ? "s" : ""}." exit 1 diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index 62e23cdcc1..a863e0cdb7 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -188,7 +188,7 @@ validation_client_name "#{@chef_config[:validation_client_name]}" if @chef_config[:trusted_certs_dir] Dir.glob(File.join(Chef::Util::PathHelper.escape_glob(@chef_config[:trusted_certs_dir]), "*.{crt,pem}")).each do |cert| content << "cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'\n" + - IO.read(File.expand_path(cert)) + "\nEOP\n" + IO.read(File.expand_path(cert)) + "\nEOP\n" end end content diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index a1e54f784d..4184171a4e 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -186,8 +186,8 @@ class Chef Chef::Log.debug("Using node attribute #{Chef::Config[:knife][:ssh_attribute]}") attribute = Chef::Config[:knife][:ssh_attribute] elsif node[:cloud] && - node[:cloud][:public_hostname] && - !node[:cloud][:public_hostname].empty? + node[:cloud][:public_hostname] && + !node[:cloud][:public_hostname].empty? Chef::Log.debug("Using node attribute 'cloud[:public_hostname]' automatically as the ssh target") attribute = "cloud.public_hostname" else diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb index f749d34c51..c423ccaa42 100644 --- a/lib/chef/mixin/template.rb +++ b/lib/chef/mixin/template.rb @@ -105,7 +105,7 @@ class Chef def node return @node if @node raise "Could not find a value for node. If you are explicitly setting variables in a template, " + - "include a node variable if you plan to use it." + "include a node variable if you plan to use it." end # diff --git a/lib/chef/mixin/windows_architecture_helper.rb b/lib/chef/mixin/windows_architecture_helper.rb index c55f92b362..11e1b5559d 100644 --- a/lib/chef/mixin/windows_architecture_helper.rb +++ b/lib/chef/mixin/windows_architecture_helper.rb @@ -48,7 +48,7 @@ class Chef def with_os_architecture(node, architecture: nil) node ||= begin os_arch = ENV["PROCESSOR_ARCHITEW6432"] || - ENV["PROCESSOR_ARCHITECTURE"] + ENV["PROCESSOR_ARCHITECTURE"] Hash.new.tap do |n| n[:kernel] = Hash.new n[:kernel][:machine] = os_arch == "AMD64" ? :x86_64 : :i386 diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index 39d415e590..d24cd8c18c 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -173,8 +173,8 @@ class Chef def find_provider(platform, version, resource_type) provider_klass = explicit_provider(platform, version, resource_type) || - platform_provider(platform, version, resource_type) || - resource_matching_provider(platform, version, resource_type) + platform_provider(platform, version, resource_type) || + resource_matching_provider(platform, version, resource_type) raise Chef::Exceptions::ProviderNotFound, "Cannot find a provider for #{resource_type} on #{platform} version #{version}" if provider_klass.nil? diff --git a/lib/chef/policy_builder/dynamic.rb b/lib/chef/policy_builder/dynamic.rb index 22438a1e0f..c6c7deeee6 100644 --- a/lib/chef/policy_builder/dynamic.rb +++ b/lib/chef/policy_builder/dynamic.rb @@ -149,9 +149,9 @@ class Chef # testing purposes; production code should call #load_node instead. def select_implementation(node) if policyfile_set_in_config? || - policyfile_attribs_in_node_json? || - node_has_policyfile_attrs?(node) || - policyfile_compat_mode_config? + policyfile_attribs_in_node_json? || + node_has_policyfile_attrs?(node) || + policyfile_compat_mode_config? @implementation = Policyfile.new(node_name, ohai_data, json_attribs, override_runlist, events) else @implementation = ExpandNodeObject.new(node_name, ohai_data, json_attribs, override_runlist, events) diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 1c0145348a..9a6e62bc5d 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -257,7 +257,7 @@ class Chef named_run_list or raise ConfigurationError, "Policy '#{retrieved_policy_name}' revision '#{revision_id}' does not have named_run_list '#{named_run_list_name}'" + - "(available named_run_lists: [#{available_named_run_lists.join(', ')}])" + "(available named_run_lists: [#{available_named_run_lists.join(', ')}])" else policy["run_list"] end diff --git a/lib/chef/property.rb b/lib/chef/property.rb index 8198dd6700..0230c8b23b 100644 --- a/lib/chef/property.rb +++ b/lib/chef/property.rb @@ -336,11 +336,11 @@ class Chef # It won't do what they expect. This checks whether you try to *read* # `content` while we are compiling the resource. if resource.respond_to?(:resource_initializing) && - resource.resource_initializing && - resource.respond_to?(:enclosing_provider) && - resource.enclosing_provider && - resource.enclosing_provider.new_resource && - resource.enclosing_provider.new_resource.respond_to?(name) + resource.resource_initializing && + resource.respond_to?(:enclosing_provider) && + resource.enclosing_provider && + resource.enclosing_provider.new_resource && + resource.enclosing_provider.new_resource.respond_to?(name) Chef::Log.warn("#{Chef::Log.caller_location}: property #{name} is declared in both #{resource} and #{resource.enclosing_provider}. Use new_resource.#{name} instead. At #{Chef::Log.caller_location}") end @@ -486,8 +486,8 @@ class Chef # the original options. options = self.options if modified_options.has_key?(:name_property) || - modified_options.has_key?(:name_attribute) || - modified_options.has_key?(:default) + modified_options.has_key?(:name_attribute) || + modified_options.has_key?(:default) options = options.reject { |k, v| k == :name_attribute || k == :name_property || k == :default } end self.class.new(options.merge(modified_options)) diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb index 854b5c01d9..4f17da0288 100644 --- a/lib/chef/provider/git.rb +++ b/lib/chef/provider/git.rb @@ -53,9 +53,9 @@ class Chef a.assertion { !(@new_resource.revision =~ /^origin\//) } a.failure_message Chef::Exceptions::InvalidRemoteGitReference, "Deploying remote branches is not supported. " + - "Specify the remote branch as a local branch for " + - "the git repository you're deploying from " + - "(ie: '#{@new_resource.revision.gsub('origin/', '')}' rather than '#{@new_resource.revision}')." + "Specify the remote branch as a local branch for " + + "the git repository you're deploying from " + + "(ie: '#{@new_resource.revision.gsub('origin/', '')}' rather than '#{@new_resource.revision}')." end requirements.assert(:all_actions) do |a| diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb index 116efccaef..d184094bbb 100644 --- a/lib/chef/provider/link.rb +++ b/lib/chef/provider/link.rb @@ -58,8 +58,8 @@ class Chef @current_resource.link_type(:hard) if ::File.exists?(@current_resource.target_file) if ::File.exists?(@new_resource.to) && - file_class.stat(@current_resource.target_file).ino == - file_class.stat(@new_resource.to).ino + file_class.stat(@current_resource.target_file).ino == + file_class.stat(@new_resource.to).ino @current_resource.to(canonicalize(@new_resource.to)) else @current_resource.to("") @@ -96,7 +96,7 @@ class Chef # target_file - the name of the link if @current_resource.to != canonicalize(@new_resource.to) || - @current_resource.link_type != @new_resource.link_type + @current_resource.link_type != @new_resource.link_type # Handle the case where the symlink already exists and is pointing at a valid to_file if @current_resource.to # On Windows, to fix a symlink already pointing at a directory we must first @@ -106,7 +106,7 @@ class Chef # directory we want to throw an exception and calling ::File.unlink on the directory symlink # will throw the correct ones. if Chef::Platform.windows? && ::File.directory?(@new_resource.to) && - ::File.directory?(@current_resource.target_file) + ::File.directory?(@current_resource.target_file) converge_by("unlink existing windows symlink to dir at #{@new_resource.target_file}") do ::Dir.unlink(@new_resource.target_file) end diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 1bef30d53b..3747a917fa 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -51,7 +51,7 @@ class Chef @new_profile_identifier = @new_profile_hash["PayloadIdentifier"] else @new_profile_identifier = @new_resource.identifier || - @new_resource.profile_name + @new_resource.profile_name end if all_profiles.empty? diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb index 1ab06a36f8..858b430abe 100644 --- a/lib/chef/provider/package/yum.rb +++ b/lib/chef/provider/package/yum.rb @@ -240,7 +240,7 @@ class Chef @r = args[2] else raise ArgumentError, "Expecting either 'epoch-version-release' or 'epoch, " + - "version, release'" + "version, release'" end end attr_reader :e, :v, :r @@ -349,7 +349,7 @@ class Chef @provides = args[5] else raise ArgumentError, "Expecting either 'name, epoch-version-release, arch, provides' " + - "or 'name, epoch, version, release, arch, provides'" + "or 'name, epoch, version, release, arch, provides'" end # We always have one, ourselves! @@ -433,7 +433,7 @@ class Chef @flag = args[4] || :== else raise ArgumentError, "Expecting either 'name, epoch-version-release, flag' or " + - "'name, epoch, version, release, flag'" + "'name, epoch, version, release, flag'" end end attr_reader :name, :version, :flag @@ -1224,7 +1224,7 @@ class Chef else # we bail like yum when the package is older raise Chef::Exceptions::Package, "Installed package #{n}-#{current_version_array[idx]} is newer " + - "than candidate package #{n}-#{v}" + "than candidate package #{n}-#{v}" end end end @@ -1257,7 +1257,7 @@ class Chef yum_command("-d0 -e0 -y#{expand_options(@new_resource.options)} #{method} #{pkg_string}") else raise Chef::Exceptions::Package, "Version #{version} of #{name} not found. Did you specify both version " + - "and release? (version-release, e.g. 1.84-10.fc6)" + "and release? (version-release, e.g. 1.84-10.fc6)" end end diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb index 795a5950fb..85bd674d8d 100644 --- a/lib/chef/provider/user.rb +++ b/lib/chef/provider/user.rb @@ -98,7 +98,7 @@ class Chef a.assertion { @shadow_lib_ok } a.failure_message Chef::Exceptions::MissingLibrary, "You must have ruby-shadow installed for password support!" a.whyrun "ruby-shadow is not installed. Attempts to set user password will cause failure. Assuming that this gem will have been previously installed." + - "Note that user update converge may report false-positive on the basis of mismatched password. " + "Note that user update converge may report false-positive on the basis of mismatched password. " end requirements.assert(:modify, :lock, :unlock) do |a| a.assertion { @user_exists } diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb index 26711fde16..74fa6685f1 100644 --- a/lib/chef/resource/cron.rb +++ b/lib/chef/resource/cron.rb @@ -126,8 +126,8 @@ class Chef error_message << Provider::Cron::WEEKDAY_SYMBOLS.map { |sym| ":#{sym}" }.join(", ") error_message << " and a string in crontab format" if (arg.is_a?(Symbol) && !Provider::Cron::WEEKDAY_SYMBOLS.include?(arg)) || - (!arg.is_a?(Symbol) && integerize(arg) > 7) || - (!arg.is_a?(Symbol) && integerize(arg) < 0) + (!arg.is_a?(Symbol) && integerize(arg) > 7) || + (!arg.is_a?(Symbol) && integerize(arg) < 0) raise RangeError, error_message end rescue ArgumentError diff --git a/lib/chef/resource_collection.rb b/lib/chef/resource_collection.rb index 293a99991e..6c5b4289d8 100644 --- a/lib/chef/resource_collection.rb +++ b/lib/chef/resource_collection.rb @@ -78,8 +78,8 @@ class Chef # Read-only methods are simple to delegate - doing that below resource_list_methods = Enumerable.instance_methods + - [:iterator, :all_resources, :[], :each, :execute_each_resource, :each_index, :empty?] - - [:find] # find needs to run on the set + [:iterator, :all_resources, :[], :each, :execute_each_resource, :each_index, :empty?] - + [:find] # find needs to run on the set resource_set_methods = [:lookup, :find, :resources, :keys, :validate_lookup_spec!] def_delegators :resource_list, *resource_list_methods diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb index be24dc6ad8..88354de31d 100644 --- a/lib/chef/resource_collection/resource_set.rb +++ b/lib/chef/resource_collection/resource_set.rb @@ -124,7 +124,7 @@ class Chef else raise Chef::Exceptions::InvalidResourceSpecification, "The object `#{query_object.inspect}' is not valid for resource collection lookup. " + - "Use a String like `resource_type[resource_name]' or a Chef::Resource object" + "Use a String like `resource_type[resource_name]' or a Chef::Resource object" end end diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb index 8a205160fa..487a54f0df 100644 --- a/lib/chef/search/query.rb +++ b/lib/chef/search/query.rb @@ -116,8 +116,8 @@ WARNDEP def validate_type(t) unless t.kind_of?(String) || t.kind_of?(Symbol) msg = "Invalid search object type #{t.inspect} (#{t.class}), must be a String or Symbol." + - "Usage: search(:node, QUERY[, OPTIONAL_ARGS])" + - " `knife search environment QUERY (options)`" + "Usage: search(:node, QUERY[, OPTIONAL_ARGS])" + + " `knife search environment QUERY (options)`" raise Chef::Exceptions::InvalidSearchQuery, msg end end diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb index 83863b16f7..40d7e10d2e 100644 --- a/lib/chef/shell/ext.rb +++ b/lib/chef/shell/ext.rb @@ -210,9 +210,9 @@ module Shell desc "prints information about chef" def version puts "This is the chef-shell.\n" + - " Chef Version: #{::Chef::VERSION}\n" + - " http://www.chef.io/\n" + - " http://docs.chef.io/" + " Chef Version: #{::Chef::VERSION}\n" + + " http://www.chef.io/\n" + + " http://docs.chef.io/" :ucanhaz_automation end alias :shell :version diff --git a/lib/chef/win32/api/security.rb b/lib/chef/win32/api/security.rb index 44968372b5..64df077686 100644 --- a/lib/chef/win32/api/security.rb +++ b/lib/chef/win32/api/security.rb @@ -133,11 +133,11 @@ class Chef FILE_READ_ATTRIBUTES = 0x0080 FILE_WRITE_ATTRIBUTES = 0x0100 FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | - SYNCHRONIZE | - 0x1FF + SYNCHRONIZE | + 0x1FF FILE_GENERIC_READ = STANDARD_RIGHTS_READ | - FILE_READ_DATA | FILE_READ_ATTRIBUTES | - FILE_READ_EA | SYNCHRONIZE + FILE_READ_DATA | FILE_READ_ATTRIBUTES | + FILE_READ_EA | SYNCHRONIZE FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE # Access Token Rights (for OpenProcessToken) @@ -163,7 +163,7 @@ class Chef SE_PRIVILEGE_REMOVED = 0X00000004 SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000 SE_PRIVILEGE_VALID_ATTRIBUTES = SE_PRIVILEGE_ENABLED_BY_DEFAULT | - SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS + SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS # Minimum size of a SECURITY_DESCRIPTOR. TODO: this is probably platform dependent. # Make it work on 64 bit. diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb index 94a771c3ba..2a8f453432 100644 --- a/lib/chef/win32/file.rb +++ b/lib/chef/win32/file.rb @@ -167,9 +167,9 @@ class Chef def self.file_access_check(path, desired_access) security_descriptor = Chef::ReservedNames::Win32::Security.get_file_security(path) token_rights = Chef::ReservedNames::Win32::Security::TOKEN_IMPERSONATE | - Chef::ReservedNames::Win32::Security::TOKEN_QUERY | - Chef::ReservedNames::Win32::Security::TOKEN_DUPLICATE | - Chef::ReservedNames::Win32::Security::STANDARD_RIGHTS_READ + Chef::ReservedNames::Win32::Security::TOKEN_QUERY | + Chef::ReservedNames::Win32::Security::TOKEN_DUPLICATE | + Chef::ReservedNames::Win32::Security::STANDARD_RIGHTS_READ token = Chef::ReservedNames::Win32::Security.open_process_token( Chef::ReservedNames::Win32::Process.get_current_process, token_rights) diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 5f8d23b452..bccd2e3c72 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -211,8 +211,8 @@ class Chef hive.open(key, ::Win32::Registry::KEY_READ | registry_system_architecture) do |reg| reg.each do |val_name, val_type, val_data| if safely_downcase(val_name) == safely_downcase(value[:name]) && - val_type == get_type_from_name(value[:type]) && - val_data == value[:data] + val_type == get_type_from_name(value[:type]) && + val_data == value[:data] return true end end diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb index ab324ee907..fe2abdb12a 100644 --- a/spec/functional/shell_spec.rb +++ b/spec/functional/shell_spec.rb @@ -43,7 +43,7 @@ describe Shell do end if Time.new - start > TIMEOUT raise "did not read expected value `#{expected_value}' within #{TIMEOUT}s\n" + - "Buffer so far: `#{buffer}'" + "Buffer so far: `#{buffer}'" end end buffer diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb index e8b0fa7af2..53fce39491 100644 --- a/spec/functional/win32/versions_spec.rb +++ b/spec/functional/win32/versions_spec.rb @@ -107,7 +107,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on if os_version_components.length < 2 raise "WMI returned a Windows version from Win32_OperatingSystem.Version " + - "with an unexpected format. The Windows version could not be determined." + "with an unexpected format. The Windows version could not be determined." end # Windows 6.0 is Windows Server 2008, so test the major and diff --git a/spec/support/shared/unit/script_resource.rb b/spec/support/shared/unit/script_resource.rb index a80ab81fb9..ba33d69a59 100644 --- a/spec/support/shared/unit/script_resource.rb +++ b/spec/support/shared/unit/script_resource.rb @@ -74,7 +74,7 @@ shared_examples_for "a script resource" do it "inherits exactly the :cwd, :environment, :group, :path, :user, and :umask attributes from a parent resource class" do inherited_difference = Chef::Resource::Script.guard_inherited_attributes - - [:cwd, :environment, :group, :path, :user, :umask ] + [:cwd, :environment, :group, :path, :user, :umask ] expect(inherited_difference).to eq([]) end diff --git a/spec/unit/knife/core/node_editor_spec.rb b/spec/unit/knife/core/node_editor_spec.rb index abd034833c..770e2e84aa 100644 --- a/spec/unit/knife/core/node_editor_spec.rb +++ b/spec/unit/knife/core/node_editor_spec.rb @@ -43,7 +43,7 @@ describe Chef::Knife::NodeEditor do describe '#view' do it "returns a Hash with only the name, chef_environment, normal, " + - "policy_name, policy_group, and run_list properties" do + "policy_name, policy_group, and run_list properties" do expected = node_data.select do |key,| %w{ name chef_environment normal policy_name policy_group run_list }.include?(key) @@ -74,7 +74,7 @@ describe Chef::Knife::NodeEditor do expect(ui).to have_received(:warn) .with "Changing the name of a node results in a new node being " + - "created, test_node will not be modified or removed." + "created, test_node will not be modified or removed." expect(ui).to have_received(:confirm) .with("Proceed with creation of new node") @@ -189,7 +189,7 @@ describe Chef::Knife::NodeEditor do end it 'returns an array of property names that doesn\'t include ' + - "the non-editable properties" do + "the non-editable properties" do expect(subject.updated?).to eql %w{ normal policy_name policy_group run_list } end end diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb index bd1e637570..2e3f6e4e9e 100644 --- a/spec/unit/provider/route_spec.rb +++ b/spec/unit/provider/route_spec.rb @@ -52,7 +52,7 @@ describe Chef::Provider::Route do before do @node.automatic_attrs[:os] = "linux" routing_table = "Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT\n" + - "eth0 0064A8C0 0984A8C0 0003 0 0 0 00FFFFFF 0 0 0\n" + "eth0 0064A8C0 0984A8C0 0003 0 0 0 00FFFFFF 0 0 0\n" route_file = StringIO.new(routing_table) allow(File).to receive(:open).with("/proc/net/route", "r").and_return(route_file) end diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb index 372f3499c4..2744fb9207 100644 --- a/spec/unit/provider/subversion_spec.rb +++ b/spec/unit/provider/subversion_spec.rb @@ -54,15 +54,15 @@ describe Chef::Provider::Subversion do end it "determines the current revision if there's a checkout with svn data available" do - example_svn_info = "Path: .\n" + - "URL: http://svn.example.org/trunk/myapp\n" + - "Repository Root: http://svn.example.org\n" + - "Repository UUID: d62ff500-7bbc-012c-85f1-0026b0e37c24\n" + - "Revision: 11739\nNode Kind: directory\n" + - "Schedule: normal\n" + - "Last Changed Author: codeninja\n" + - "Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision - "Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n" + example_svn_info = "Path: .\n" + + "URL: http://svn.example.org/trunk/myapp\n" + + "Repository Root: http://svn.example.org\n" + + "Repository UUID: d62ff500-7bbc-012c-85f1-0026b0e37c24\n" + + "Revision: 11739\nNode Kind: directory\n" + + "Schedule: normal\n" + + "Last Changed Author: codeninja\n" + + "Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision + "Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n" expect(::File).to receive(:exist?).at_least(1).times.with("/my/deploy/dir/.svn").and_return(true) expected_command = ["svn info", { :cwd => "/my/deploy/dir", :returns => [0, 1] }] expect(@provider).to receive(:shell_out!).with(*expected_command). @@ -109,15 +109,15 @@ describe Chef::Provider::Subversion do end it "queries the server and resolves the revision if it's not an integer (i.e. 'HEAD')" do - example_svn_info = "Path: .\n" + - "URL: http://svn.example.org/trunk/myapp\n" + - "Repository Root: http://svn.example.org\n" + - "Repository UUID: d62ff500-7bbc-012c-85f1-0026b0e37c24\n" + - "Revision: 11739\nNode Kind: directory\n" + - "Schedule: normal\n" + - "Last Changed Author: codeninja\n" + - "Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision - "Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n" + example_svn_info = "Path: .\n" + + "URL: http://svn.example.org/trunk/myapp\n" + + "Repository Root: http://svn.example.org\n" + + "Repository UUID: d62ff500-7bbc-012c-85f1-0026b0e37c24\n" + + "Revision: 11739\nNode Kind: directory\n" + + "Schedule: normal\n" + + "Last Changed Author: codeninja\n" + + "Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision + "Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n" @resource.revision "HEAD" expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", { :cwd => "/my/deploy/dir", :returns => [0, 1] }] expect(@provider).to receive(:shell_out!).with(*expected_command). diff --git a/spec/unit/resource/powershell_script_spec.rb b/spec/unit/resource/powershell_script_spec.rb index f1a9215caa..6457090608 100644 --- a/spec/unit/resource/powershell_script_spec.rb +++ b/spec/unit/resource/powershell_script_spec.rb @@ -61,7 +61,7 @@ describe Chef::Resource::PowershellScript do it "inherits exactly the :cwd, :environment, :group, :path, :user, :umask, and :architecture attributes from a parent resource class" do inherited_difference = Chef::Resource::PowershellScript.guard_inherited_attributes - - [:cwd, :environment, :group, :path, :user, :umask, :architecture ] + [:cwd, :environment, :group, :path, :user, :umask, :architecture ] expect(inherited_difference).to eq([]) end |