Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Commands::WhichCommand#execute
execute
lib/rubygems/commands/which_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/commands/which_command.rb, line 39
def execute
found = true
options[:args].each do |arg|
arg = arg.sub(/#{Regexp.union(*Gem.suffixes)}$/, "")
dirs = $LOAD_PATH
spec = Gem::Specification.find_by_path arg
if spec
if options[:search_gems_first]
dirs = spec.full_require_paths + $LOAD_PATH
else
dirs = $LOAD_PATH + spec.full_require_paths
end
end
paths = find_paths arg, dirs
if paths.empty?
alert_error "Can't find Ruby library file or shared library #{arg}"
found = false
else
say paths
end
end
terminate_interaction 1 unless found
end
No documentation available