Skip to content

Instantly share code, notes, and snippets.

@capitalist
Forked from webmat/environment.rb
Created October 2, 2009 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capitalist/199802 to your computer and use it in GitHub Desktop.
Save capitalist/199802 to your computer and use it in GitHub Desktop.
# Neater Github gem dependencies for Rails
module GithubGem
def github_gem(gem_name, opts={})
lib_name = gem_name.split('-', 2)[1]
self.gem gem_name, {:lib => lib_name, :source => 'http://gems.github.com'}.merge(opts)
end
end
Rails::Initializer.run do |config|
config.extend GithubGem
config.gem 'andand'
config.github_gem 'binarylogic-authlogic', :version => '2.1.1'
if %w(test development).include?(RAILS_ENV)
config.gem "mocha"
config.github_gem "thoughtbot-shoulda", :version => '>=2.10'
config.github_gem "seanhussey-woulda"
end
# ...
end
# Certainly beats the equivalent
=begin
config.gem 'andand'
config.gem 'binarylogic-authlogic', :version => '2.1.1',
:lib => 'authlogic', :source => 'http://gems.github.com'
if %w(test development).include?(RAILS_ENV)
config.gem "mocha"
config.gem "thoughtbot-shoulda", :version => '>=2.10',
:lib => 'shoulda', :source => 'http://gems.github.com'
config.gem "seanhussey-woulda",
:lib => 'woulda', :source => 'http://gems.github.com'
end
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment