Module: Gem

Defined in:
lib/standard/facets/gem/search.rb,
lib/standard/facets/gem/specification/current_specs.rb,
lib/standard/facets/gem/specification/find_requireable_file.rb

Defined Under Namespace

Classes: Specification

Class Method Summary collapse

Class Method Details

.search(match, options = {}) ⇒ Object

Search RubyGems for matching paths in current gem versions.



6
7
8
9
10
11
12
13
14
15
# File 'lib/standard/facets/gem/search.rb', line 6

def self.search(match, options={})
  matches = []
  Gem::Specification.current_specs.each do |spec|
    glob = File.join(spec.lib_dirs_glob, match)
    list = Dir[glob] #.map{ |f| f.untaint }
    list = list.map{ |d| d.chomp('/') }
    matches.concat(list)
  end
  matches
end