-
-
Save capitalist/199802 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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