Skip to content

Instantly share code, notes, and snippets.

@eric1234
Created January 16, 2010 03:45
Show Gist options
  • Select an option

  • Save eric1234/278631 to your computer and use it in GitHub Desktop.

Select an option

Save eric1234/278631 to your computer and use it in GitHub Desktop.
Will generate a heroku gem manifest from the rails app itself. Ideal as a sake task.
desc "Generate Heroku gems manifest from environment.rb"
task 'heroku:gems:manifest' do
manifest = nil
IO.popen('-') do |io|
if io
manifest = io.read
else
system 'script/runner', %q{
out = Rails.configuration.gems.collect do |gem|
gem.send(:install_command)[1..-1] * " "
end * "\n"
puts out
}
end
end
File.open('.gems', 'w') {|f| f << manifest}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment