Skip to content

Instantly share code, notes, and snippets.

@acook
Created July 21, 2011 22:16
Show Gist options
  • Save acook/1098370 to your computer and use it in GitHub Desktop.
Save acook/1098370 to your computer and use it in GitHub Desktop.
Only use certain gems in a Gemfile if they are already installed, otherwise ignore them.
# In some development environments, different developers have different needs
# and prefer to use different development gems. Now since Gemfiles are Just Ruby,
# it's pretty easy to work around the different environments.
####################################################################################
# to use:
# 1) put the following code into your Gemfile
# 2) change the `optional_development_gems` array to your custom list
# 3) install none, any, or all of the gems in that list
# 4) export custom_gems=enabled
# 5) bundle install
if ENV['custom_gems'] == 'enabled' then
optional_development_gems = %w{wirble autotest autotest-rails autotest-fsevent autotest-growl term-ansicolor}
optional_development_gems.each do |g|
gem(g) if Gem::Specification.find_by_name(g
end
end
@acook
Copy link
Author

acook commented Aug 19, 2011

Updated for the new version of Gem (1.8.8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment