Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rakefile: Allow gem requirements (so we'd have something like bundler…

… working, just for installing gems anyway).
  • Loading branch information...
commit 6bcde978cc10ad3e52db6679ebbd6a832db6a0ef 1 parent 34bccca
Wael M. Nasreddine eMxyzptlk authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 Rakefile
9 Rakefile
View
@@ -11,16 +11,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
Please sign in to comment.
Something went wrong with that request. Please try again.