diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-03-23 10:16:17 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-03-23 17:18:49 +0900 |
commit | 2e3cd1dc3e30f4725b18032b85a36f208c9528bc () | |
tree | 03b319dd2a715c27aa7ca25a892df86aa956416e /lib | |
parent | 19e9c4004b9d137ad48757f3f4c2d92257e6c2c4 (diff) |
[rubygems/rubygems] Enabled Style/RedundantReturn cop
https://.com/rubygems/rubygems/commit/05cc97bdf8
Notes: Merged: https://.com/ruby/ruby/pull/7582
-rw-r--r-- | lib/bundler/installer/gem_installer.rb | 6 | ||||
-rw-r--r-- | lib/rubygems.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/cert_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/contents_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/environment_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/unpack_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/core_ext/kernel_require.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/installer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package/digest_io.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package/tar_reader.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package/tar_writer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/request_set/gem_dependency_api.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/resolver.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/source_list.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/uninstaller.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/user_interaction.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/version.rb | 4 |
23 files changed, 37 insertions, 39 deletions
@@ -16,13 +16,13 @@ module Bundler post_install_message = install Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" generate_executable_stubs - return true, post_install_message rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError raise rescue Errno::ENOSPC - return false, out_of_space_message rescue Bundler::BundlerError, Gem::InstallError, Bundler::APIResponseInvalidDependenciesError => e - return false, specific_failure_message(e) end private @@ -210,7 +210,7 @@ module Gem end end - return true end def self.needs @@ -488,7 +488,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # the spec dirs directly, so we prune. files.uniq! if check_load_path - return files end def self.find_files_from_load_path(glob) # :nodoc: @@ -523,7 +523,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # the spec dirs directly, so we prune. files.uniq! if check_load_path - return files end ## @@ -427,9 +427,9 @@ class Gem::Command def handles?(args) parser.parse!(args.dup) - return true rescue StandardError - return false end ## @@ -179,7 +179,7 @@ class Gem::Commands::CertCommand < Gem::Command key = Gem::Security.create_key(algorithm) key_path = Gem::Security.write key, "gem-private_key.pem", 0600, passphrase - return key, key_path end def certificates_matching(filter) @@ -177,7 +177,7 @@ prefix or only the files that are requireable. @spec_dirs.sort.each {|dir| say dir } end - return nil end def specification_directories # :nodoc: @@ -16,7 +16,7 @@ class Gem::Commands::EnvironmentCommand < Gem::Command platform display the supported gem platforms <omitted> display everything EOF - return args.gsub(/^\s+/, "") end def description # :nodoc: @@ -170,6 +170,6 @@ lib/rubygems/defaults/operating_system.rb end end - return nil end end @@ -356,7 +356,7 @@ By default, this RubyGems will install gem as: say "Set the GEM_HOME environment variable if you want RDoc generated" end - return false end def install_default_bundler_gem(bin_dir) @@ -432,7 +432,7 @@ By default, this RubyGems will install gem as: mkdir_p lib_dir, :mode => 0755 mkdir_p bin_dir, :mode => 0755 - return lib_dir, bin_dir end def generate_default_man_dir @@ -129,7 +129,7 @@ command help for an example. return this_path if File.exist? this_path end - return nil end ## @@ -232,7 +232,7 @@ command to remove old versions. highest_remote_tup = highest_remote_name_tuple(rubygems_update) target = highest_remote_tup ? highest_remote_tup.version : version - return target, requirement end def update_gem(name, version = Gem::Requirement.default) @@ -142,7 +142,7 @@ module Kernel end RUBYGEMS_ACTIVATION_MONITOR.exit - return gem_original_require(path) rescue LoadError => load_error if load_error.path == path RUBYGEMS_ACTIVATION_MONITOR.enter @@ -748,7 +748,7 @@ class Gem::Installer def app_script_text(bin_file_name) # NOTE: that the `load` lines cannot be indented, as old RG versions match # against the beginning of the line - return <<-TEXT #{shebang bin_file_name} # # This file was generated by RubyGems. @@ -186,7 +186,7 @@ class Gem::Package end end - return spec, metadata end ## @@ -35,7 +35,7 @@ class Gem::Package::DigestIO yield digest_io - return digests end ## @@ -87,7 +87,7 @@ class Gem::Package::TarReader return unless found - return yield found ensure rewind end @@ -323,6 +323,6 @@ class Gem::Package::TarWriter end end - return name, prefix end end @@ -813,7 +813,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta end end - return true end ## @@ -144,7 +144,7 @@ class Gem::Resolver activation_request = Gem::Resolver::ActivationRequest.new spec, dep, possible - return spec, activation_request end def requests(s, act, reqs=[]) # :nodoc: @@ -212,7 +212,7 @@ class Gem::Resolver matching_platform = select_local_platforms all - return matching_platform, all end ## @@ -36,7 +36,7 @@ class Gem::SourceList list.replace ary - return list end def initialize_copy(other) # :nodoc: @@ -123,7 +123,7 @@ class Gem::SpecFetcher tuples = tuples.sort_by {|x| x[0].version } - return [tuples, errors] end ## @@ -161,7 +161,7 @@ class Gem::SpecFetcher specs << [spec, source] end - return [specs, errors] end ## @@ -1431,7 +1431,7 @@ class Gem::Specification < Gem::BasicSpecification @activated = true @loaded = true - return true end ## @@ -1521,7 +1521,7 @@ class Gem::Specification < Gem::BasicSpecification executables end rescue StandardError - return nil end ## @@ -2382,8 +2382,8 @@ class Gem::Specification < Gem::BasicSpecification # Checks if this specification meets the requirement of +dependency+. def satisfies_requirement?(dependency) - return @name == dependency.name && - dependency.requirement.satisfied_by?(@version) end ## @@ -2669,8 +2669,6 @@ class Gem::Specification < Gem::BasicSpecification self.required_rubygems_version = "> 1.3.1" end invalidate_memoized_attributes - - return end def stubbed? @@ -347,7 +347,7 @@ class Gem::Uninstaller msg << "If you remove this gem, these dependencies will not be met." msg << "Continue with Uninstall?" - return ask_yes_no(msg.join("\n"), false) end ## @@ -236,7 +236,7 @@ class Gem::StreamUI return nil, nil unless result result = result.strip.to_i - 1 - return list[result], result end ## @@ -273,7 +273,7 @@ class Gem::StreamUI end end - return result end ## @@ -377,7 +377,7 @@ class Gem::Version return lhs <=> rhs end - return 0 end def canonical_segments @@ -413,6 +413,6 @@ class Gem::Version string_start = _segments.index {|s| s.is_a?(String) } string_segments = segments numeric_segments = string_segments.slice!(0, string_start || string_segments.size) - return numeric_segments, string_segments end end |