Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'add_hammer' into my_pulls
* add_hammer:
  Rakefile: Allow gem requirements (so we'd have something like bundler working, just for installing gems anyway).
  • Loading branch information
kalbasit committed Nov 2, 2011
2 parents e33798d + 6bcde97 commit 3bf380f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Rakefile
Expand Up @@ -32,16 +32,17 @@ end
# Find an installed gem
#
# @param [String] The gem name to search for
# @param [Mixed] The gem requirements
# @return [Array] The found gems
def find_gem(gem_name)
def find_gem(gem_name, *requirements)
begin
require 'rubygems'
if Gem.const_defined?(:Specification)
Gem::Specification.find_all_by_name(gem_name)
Gem::Specification.find_all_by_name(gem_name, *requirements)
elsif Gem.respond_to?(:source_index)
Gem.source_index.find_name(gem_name)
Gem.source_index.find_name(gem_name, *requirements)
else
Gem.cache.find_name(gem_name)
Gem.cache.find_name(gem_name, *requirements)
end
rescue LoadError
raise Janus::RubyGemsNotFoundError
Expand Down

0 comments on commit 3bf380f

Please sign in to comment.