Skip to content

Commit

Permalink
remove outdated config option. default to generated secret key
Browse files Browse the repository at this point in the history
rails always runs initializers now. raising on heroku means that asset
compilation fails since asset compilation doesn't have access to env
variables :(
  • Loading branch information
semanticart committed Sep 25, 2013
1 parent b70113f commit 320c6f9
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions template.rb
Expand Up @@ -95,10 +95,6 @@ def git_email
run 'bundle exec guard init rspec'


# for deployment to heroku
application 'config.assets.initialize_on_precompile = false'


# enable simple factory girl syntax (create, build) in rspec and cucumber
create_file 'spec/support/factory_girl.rb', <<-CODE
RSpec.configure do |config|
Expand Down Expand Up @@ -178,13 +174,7 @@ def git_email
# require css assets explicitly instead of `require_tree`
gsub_file 'app/assets/stylesheets/application.css', /require_tree \.$/, 'require screen'

gsub_file 'config/initializers/secret_token.rb', /= '.*?'/, "= ENV['SECRET_TOKEN'] || Rails.env"
append_to_file 'config/initializers/secret_token.rb', <<-CODE
if Rails.env.production? && ENV['SECRET_TOKEN'].blank?
raise "Please specify a secret token, e.g.: SECRET_TOKEN=\#{SecureRandom.hex(20)}"
end
CODE
gsub_file 'config/initializers/secret_token.rb', /= '.*?'/, %(= ENV['SECRET_TOKEN'] || "#{SecureRandom.hex(20)}")

insert_into_file 'app/helpers/application_helper.rb', after: 'module ApplicationHelper\n' do
<<-CODE
Expand Down

0 comments on commit 320c6f9

Please sign in to comment.