method
execute
v2_5_5 -
Show latest stable
-
0 notes -
Class: WhichCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
execute()
public
Hide source
# File lib/rubygems/commands/which_command.rb, line 38 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 then if options[:search_gems_first] then dirs = spec.full_require_paths + $LOAD_PATH else dirs = $LOAD_PATH + spec.full_require_paths end end # TODO: this is totally redundant and stupid paths = find_paths arg, dirs if paths.empty? then 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