summaryrefslogtreecommitdiff
path: root/lib/rubygems/source/specific_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/source/specific_file.rb')
-rw-r--r--lib/rubygems/source/specific_file.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/rubygems/source/specific_file.rb b/lib/rubygems/source/specific_file.rb
index 459c803e1a..dde1d48a21 100644
--- a/lib/rubygems/source/specific_file.rb
+++ b/lib/rubygems/source/specific_file.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
+
##
# A source representing a single .gem file. This is used for installation of
# local gems.
class Gem::Source::SpecificFile < Gem::Source
-
##
# The path to the gem for this specific file.
@@ -27,25 +27,26 @@ class Gem::Source::SpecificFile < Gem::Source
attr_reader :spec
- def load_specs *a # :nodoc:
+ def load_specs(*a) # :nodoc:
[@name]
end
- def fetch_spec name # :nodoc:
+ def fetch_spec(name) # :nodoc:
return @spec if name == @name
raise Gem::Exception, "Unable to find '#{name}'"
- @spec
end
- def download spec, dir = nil # :nodoc:
+ def download(spec, dir = nil) # :nodoc:
return @path if spec == @spec
raise Gem::Exception, "Unable to download '#{spec.full_name}'"
end
- def pretty_print q # :nodoc:
- q.group 2, '[SpecificFile:', ']' do
- q.breakable
- q.text @path
+ def pretty_print(q) # :nodoc:
+ q.object_group(self) do
+ q.group 2, "[SpecificFile:", "]" do
+ q.breakable
+ q.text @path
+ end
end
end
@@ -59,7 +60,7 @@ class Gem::Source::SpecificFile < Gem::Source
#
# Otherwise Gem::Source#<=> is used.
- def <=> other
+ def <=>(other)
case other
when Gem::Source::SpecificFile then
return nil if @spec.name != other.spec.name
@@ -69,5 +70,4 @@ class Gem::Source::SpecificFile < Gem::Source
super
end
end
-
end