Permalink
Browse files

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...
2 parents e33798d + 6bcde97 commit 3bf380fa901c5e6257260df2ee94667c87adb397 @kalbasit kalbasit committed Nov 2, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 Rakefile
View
@@ -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

0 comments on commit 3bf380f

Please sign in to comment.