summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-03 19:56:58 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-03-30 12:48:23 +0900
commit061add792e658878c839887682716737d9f6d677 (patch)
treeb111148a604c7f2ab09f26b1804a2725d7c19680 /lib
parentc16815cca7c223698c11b4c520b75caeb0499f93 (diff)
[rubygems/rubygems] Enable `Style/ExtraSpacing` and auto-correct
https://github.com/rubygems/rubygems/commit/6fa0b1b679
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/defaults.rb2
-rw-r--r--lib/rubygems/install_update_options.rb4
-rw-r--r--lib/rubygems/platform.rb4
-rw-r--r--lib/rubygems/remote_fetcher.rb2
-rw-r--r--lib/rubygems/specification.rb12
-rw-r--r--lib/rubygems/specification_policy.rb4
-rw-r--r--lib/rubygems/test_case.rb2
-rw-r--r--lib/rubygems/test_utilities.rb2
-rw-r--r--lib/rubygems/version.rb2
9 files changed, 17 insertions, 17 deletions
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index d4ff4a262c..0e83f1b006 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -115,7 +115,7 @@ module Gem
# The default directory for binaries
def self.default_bindir
- if defined? RUBY_FRAMEWORK_VERSION # mac framework support
+ if defined? RUBY_FRAMEWORK_VERSION # mac framework support
'/usr/bin'
else # generic install
RbConfig::CONFIG['bindir']
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb
index dbf787c7ba..65c2f300ed 100644
--- a/lib/rubygems/install_update_options.rb
+++ b/lib/rubygems/install_update_options.rb
@@ -30,7 +30,7 @@ module Gem::InstallUpdateOptions
options[:bin_dir] = File.expand_path(value)
end
- add_option(:"Install/Update", '--document [TYPES]', Array,
+ add_option(:"Install/Update", '--document [TYPES]', Array,
'Generate documentation for installed gems',
'List the documentation types you wish to',
'generate. For example: rdoc,ri') do |value, options|
@@ -88,7 +88,7 @@ module Gem::InstallUpdateOptions
options[:ignore_dependencies] = value
end
- add_option(:"Install/Update", '--[no-]format-executable',
+ add_option(:"Install/Update", '--[no-]format-executable',
'Make installed executable names match Ruby.',
'If Ruby is ruby18, foo_exec will be',
'foo_exec18') do |value, options|
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 521c552bea..1692eb7e5d 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -56,7 +56,7 @@ class Gem::Platform
when String then
arch = arch.split '-'
- if arch.length > 2 and arch.last !~ /\d/ # reassemble x86-linux-gnu
+ if arch.length > 2 and arch.last !~ /\d/ # reassemble x86-linux-gnu
extra = arch.pop
arch.last << "-#{extra}"
end
@@ -68,7 +68,7 @@ class Gem::Platform
else cpu
end
- if arch.length == 2 and arch.last =~ /^\d+(\.\d+)?$/ # for command-line
+ if arch.length == 2 and arch.last =~ /^\d+(\.\d+)?$/ # for command-line
@os, @version = arch
return
end
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb
index b37ebc15fd..e260926da8 100644
--- a/lib/rubygems/remote_fetcher.rb
+++ b/lib/rubygems/remote_fetcher.rb
@@ -118,7 +118,7 @@ class Gem::RemoteFetcher
def download(spec, source_uri, install_dir = Gem.dir)
cache_dir =
- if Dir.pwd == install_dir # see fetch_command
+ if Dir.pwd == install_dir # see fetch_command
install_dir
elsif File.writable? install_dir
File.join install_dir, "cache"
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 3a2a6090fd..6c37555dd0 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -720,7 +720,7 @@ class Gem::Specification < Gem::BasicSpecification
# Deprecated: You must now specify the executable name to Gem.bin_path.
attr_writer :default_executable
- deprecate :default_executable=, :none, 2018, 12
+ deprecate :default_executable=, :none, 2018, 12
##
# Allows deinstallation of gems with legacy platforms.
@@ -733,7 +733,7 @@ class Gem::Specification < Gem::BasicSpecification
# Formerly used to set rubyforge project.
attr_writer :rubyforge_project
- deprecate :rubyforge_project=, :none, 2019, 12
+ deprecate :rubyforge_project=, :none, 2019, 12
##
# The Gem::Specification version of this gemspec.
@@ -1725,7 +1725,7 @@ class Gem::Specification < Gem::BasicSpecification
end
result
end
- deprecate :default_executable, :none, 2018, 12
+ deprecate :default_executable, :none, 2018, 12
##
# The default value for specification attribute +name+
@@ -1928,7 +1928,7 @@ class Gem::Specification < Gem::BasicSpecification
def has_rdoc # :nodoc:
true
end
- deprecate :has_rdoc, :none, 2018, 12
+ deprecate :has_rdoc, :none, 2018, 12
##
# Deprecated and ignored.
@@ -1938,10 +1938,10 @@ class Gem::Specification < Gem::BasicSpecification
def has_rdoc=(ignored) # :nodoc:
@has_rdoc = true
end
- deprecate :has_rdoc=, :none, 2018, 12
+ deprecate :has_rdoc=, :none, 2018, 12
alias :has_rdoc? :has_rdoc # :nodoc:
- deprecate :has_rdoc?, :none, 2018, 12
+ deprecate :has_rdoc?, :none, 2018, 12
##
# True if this gem has files in test_files
diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb
index a50fafbc82..d9f415d25f 100644
--- a/lib/rubygems/specification_policy.rb
+++ b/lib/rubygems/specification_policy.rb
@@ -8,7 +8,7 @@ class Gem::SpecificationPolicy
SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/.freeze # :nodoc:
- VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}.freeze # :nodoc:
+ VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}.freeze # :nodoc:
METADATA_LINK_KEYS = %w[
bug_tracker_uri
@@ -281,7 +281,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
platform = @specification.platform
case platform
- when Gem::Platform, Gem::Platform::RUBY # ok
+ when Gem::Platform, Gem::Platform::RUBY # ok
else
error "invalid platform #{platform.inspect}, see Gem::Platform"
end
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 27b70222c9..ba9b6435f4 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -1024,7 +1024,7 @@ Also, a list:
spec_fetcher = Gem::SpecFetcher.fetcher
- prerelease, all = all_specs.partition { |spec| spec.version.prerelease? }
+ prerelease, all = all_specs.partition { |spec| spec.version.prerelease? }
latest = Gem::Specification._latest_specs all_specs
spec_fetcher.specs[@uri] = []
diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb
index 6ae3c0e986..0edf3d6a61 100644
--- a/lib/rubygems/test_utilities.rb
+++ b/lib/rubygems/test_utilities.rb
@@ -134,7 +134,7 @@ class Gem::FakeFetcher
def download(spec, source_uri, install_dir = Gem.dir)
name = File.basename spec.cache_file
- path = if Dir.pwd == install_dir # see fetch_command
+ path = if Dir.pwd == install_dir # see fetch_command
install_dir
else
File.join install_dir, "cache"
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
index b1faedcda2..d216647e0b 100644
--- a/lib/rubygems/version.rb
+++ b/lib/rubygems/version.rb
@@ -187,7 +187,7 @@ class Gem::Version
# ver3 = Version.create(nil) # -> nil
def self.create(input)
- if self === input # check yourself before you wreck yourself
+ if self === input # check yourself before you wreck yourself
input
elsif input.nil?
nil