Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module VitaminedGems

  class VitaminedGem
    def initialize(config)
      @config = config
    end   

    def github(name, options = {})

      options.reverse_merge! \
        :lib => name.split('-', 2).last,
        :source => 'http://gems.github.com' 

      @config.gem(name, options)
    end    
  end

  def gem_with_vitamins(*args)
    args.empty? ? VitaminedGem.new(self) : gem_without_vitamins(*args)
  end

  def self.included(base)
    base.alias_method_chain :gem, :vitamins
  end
end


Rails::Configuration.class_eval do 
  include VitaminedGems
end