Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Gem.find_spec_for_exe
find_spec_for_exe(name, exec_name, requirements)
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems.rb, line 249
def self.find_spec_for_exe(name, exec_name, requirements)
raise ArgumentError, "you must supply exec_name" unless exec_name
dep = Gem::Dependency.new name, requirements
loaded = Gem.loaded_specs[name]
return loaded if loaded && dep.matches_spec?(loaded)
specs = dep.matching_specs(true)
specs = specs.find_all do |spec|
spec.executables.include? exec_name
end if exec_name
unless spec = specs.first
msg = "can't find gem #{dep} with executable #{exec_name}"
raise Gem::GemNotFoundException, msg
end
spec
end
No documentation available
See also
.find_latest_files
.find_unresolved_default_spec
.find_home
.finish_resolve
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0