2016-09-24 03:00:46 +00:00
|
|
|
# frozen_string_literal: true
|
2017-11-06 16:15:18 +00:00
|
|
|
|
2016-01-07 10:34:24 +00:00
|
|
|
require 'dotenv/tasks'
|
|
|
|
|
2012-09-23 02:50:25 +00:00
|
|
|
namespace :heroku do
|
2016-07-26 00:14:23 +00:00
|
|
|
desc 'Generate the Heroku gems manifest from gem dependencies'
|
|
|
|
task gems: :dotenv do
|
2016-09-24 03:00:46 +00:00
|
|
|
RAILS_ENV = 'production'
|
2012-09-23 02:50:25 +00:00
|
|
|
Rake::Task[:environment].invoke
|
2016-07-26 00:14:23 +00:00
|
|
|
list = Rails.configuration.gems.collect do |g|
|
|
|
|
_command, *options = g.send(:install_command)
|
|
|
|
options.join(' ') + "\n"
|
2012-09-23 02:50:25 +00:00
|
|
|
end
|
2016-07-26 00:14:23 +00:00
|
|
|
|
2012-09-23 02:50:25 +00:00
|
|
|
File.open(File.join(RAILS_ROOT, '.gems'), 'w') do |f|
|
|
|
|
f.write(list)
|
|
|
|
end
|
|
|
|
end
|
2016-01-07 10:34:24 +00:00
|
|
|
end
|