Class
The local source finds gems in the current directory for fulfilling dependencies.
Instance Methods
lib/rubygems/source/local.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/lib/rubygems/source/local.rb, line 17
def <=>(other)
case other
when Gem::Source::Installed,
Gem::Source::Lock then
-1
when Gem::Source::Local then
0
when Gem::Source then
1
else
nil
end
end
Local
sorts before Gem::Source
and after Gem::Source::Installed
lib/rubygems/source/local.rb
View on GitHub
# File tmp/rubies/ruby-3.0.5/lib/rubygems/source/local.rb, line 80
def find_gem(gem_name, version = Gem::Requirement.default, # :nodoc:
prerelease = false)
load_specs :complete
found = []
@specs.each do |n, data|
if n.name == gem_name
s = data[1].spec
if version.satisfied_by?(s.version)
if prerelease
found << s
elsif !s.version.prerelease? || version.prerelease?
found << s
end
end
end
end
found.max_by {|s| s.version }
end
No documentation available