Flowdock
method

find_spec_for_exe

Importance_0
v2_4_6 - Show latest stable - 0 notes - Class: Gem
find_spec_for_exe(name, exec_name, requirements) private

No documentation

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

Hide source
# File lib/rubygems.rb, line 262
  def self.find_spec_for_exe name, exec_name, requirements
    dep = Gem::Dependency.new name, requirements

    loaded = Gem.loaded_specs[name]

    return loaded if loaded && dep.matches_spec?(loaded)

    specs = dep.matching_specs(true)

    raise Gem::GemNotFoundException,
          "can't find gem #{dep}" if specs.empty?

    specs = specs.find_all { |spec|
      spec.executables.include? exec_name
    } if exec_name

    unless spec = specs.first
      msg = "can't find gem #{name} (#{requirements}) with executable #{exec_name}"
      raise Gem::GemNotFoundException, msg
    end

    spec
  end
Register or log in to add new notes.