summaryrefslogtreecommitdiff
path: root/lib/rubygems/resolver/git_specification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/resolver/git_specification.rb')
-rw-r--r--lib/rubygems/resolver/git_specification.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/rubygems/resolver/git_specification.rb b/lib/rubygems/resolver/git_specification.rb
index 2448797d3f..e587c17d2a 100644
--- a/lib/rubygems/resolver/git_specification.rb
+++ b/lib/rubygems/resolver/git_specification.rb
@@ -1,19 +1,19 @@
# frozen_string_literal: true
+
##
# A GitSpecification represents a gem that is sourced from a git repository
# and is being loaded through a gem dependencies file through the +git:+
# option.
class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
-
- def == other # :nodoc:
- self.class === other and
- @set == other.set and
- @spec == other.spec and
+ def ==(other) # :nodoc:
+ self.class === other &&
+ @set == other.set &&
+ @spec == other.spec &&
@source == other.source
end
- def add_dependency dependency # :nodoc:
+ def add_dependency(dependency) # :nodoc:
spec.dependencies << dependency
end
@@ -21,8 +21,8 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
# Installing a git gem only involves building the extensions and generating
# the executables.
- def install options = {}
- require 'rubygems/installer'
+ def install(options = {})
+ require_relative "../installer"
installer = Gem::Installer.for_spec spec, options
@@ -35,8 +35,8 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
installer.run_post_install_hooks
end
- def pretty_print q # :nodoc:
- q.group 2, '[GitSpecification', ']' do
+ def pretty_print(q) # :nodoc:
+ q.group 2, "[GitSpecification", "]" do
q.breakable
q.text "name: #{name}"
@@ -44,7 +44,7 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
q.text "version: #{version}"
q.breakable
- q.text 'dependencies:'
+ q.text "dependencies:"
q.breakable
q.pp dependencies
@@ -54,6 +54,4 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
q.pp @source
end
end
-
end
-