method
find_spec_for_exe
![No documentation Importance_0](https://d2vfyqvduarcvs.cloudfront.net/images/importance_0.png?1349367920)
v2_4_6 -
Show latest stable
-
0 notes -
Class: Gem
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
find_spec_for_exe(name, exec_name, requirements)
private
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