Skip to content

Instantly share code, notes, and snippets.

@seamusabshere
Created November 2, 2009 22:49
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 seamusabshere/224569 to your computer and use it in GitHub Desktop.
Save seamusabshere/224569 to your computer and use it in GitHub Desktop.
class Gem::Dependency
def to_bundler
args = []
args << name
args << specification.version.to_s if specification.version.to_s.present?
options = {}
options[:require_as] = lib if lib.present?
str = "gem '#{args.join "', '"}'"
str << ", #{options.inspect.gsub(/[\{\}]/, '')}" if options.present?
str
end
end
Rails.configuration.gems.each { |g| puts g.to_bundler }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment