Flowdock
method

execute

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: WhichCommand
execute() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/commands/which_command.rb, line 26
  def execute
    found = false

    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 = gem_paths(spec) + $LOAD_PATH
        else
          dirs = $LOAD_PATH + gem_paths(spec)
        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}"
      else
        say paths
        found = true
      end
    end

    terminate_interaction 1 unless found
  end
Register or log in to add new notes.