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 GitHubbyGems

  def gem(name, options = {})
    if options[:github]
      default_options = { :source => 'http://gems.github.com' }

      if options[:github] == true
        default_options[:lib] = name.split('-', 2).last
      else
        default_options[:lib] = options[:github].to_s + '-' + name
      end

      options = default_options.merge(options)
    end
    super(name, options)
  end

end

Rails::Initializer.run do |config|

  # ...
  config.extend GitHubbyGems
  config.gem 'haml'
  config.gem 'right_aws'
  config.gem 'paperclip', :github => 'thoughtbot'
  config.gem 'god', :github => 'mojombo'
  # ...

end