Sha256: f73450b9af79ac251d090973c4582420ffe8aaac6fcb26dff3cbb0cba9de411a

Contents?: true

Size: 566 Bytes

Versions: 6

Compression:

Stored size: 566 Bytes

Contents

puts "Replacing secret token with environment variable...".magenta

in_root do
  append_to_file '.env', "SECRET_TOKEN: #{SecureRandom::hex(60)}\n"

  gsub_file 'config/initializers/secret_token.rb', /config.secret_token = '(.*?)'/, "config.secret_token = ENV['SECRET_TOKEN']"
  gsub_file 'config/initializers/secret_token.rb', /config.secret_key_base = '(.*?)'/, "config.secret_key_base = ENV['SECRET_TOKEN']"
end

git :add => 'config/initializers/secret_token.rb'
git :add => '.env'
git :commit => "-qm 'Replace secret token with environment variable.'"

puts "\n"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pah-0.0.12 lib/pah/partials/_secret_token.rb
pah-0.0.11 lib/pah/partials/_secret_token.rb
pah-0.0.10 lib/pah/partials/_secret_token.rb
pah-0.0.9 lib/pah/partials/_secret_token.rb
pah-0.0.8 lib/pah/partials/_secret_token.rb
pah-0.0.7 lib/pah/partials/_secret_token.rb