Sha256: 2c46dd2421cc8282fc4b2cb5813e11303f910fce6c0660c87852d95c5182a13e

Contents?: true

Size: 439 Bytes

Versions: 12

Compression:

Stored size: 439 Bytes

Contents

module Pah
  module Templates
    class SecretToken < Pah::Template
      def call
        append_to_file '.env', "SECRET_KEY_BASE: #{SecureRandom.hex(60)}\n"

        gsub_file 'config/secrets.yml', /secret_key_base: (.*)/, "secret_key_base: <%= ENV[\"SECRET_KEY_BASE\"] %>"

        git add: 'config/secrets.yml'
        git add: '.env'
        git_commit 'Replace secret key base with environment variable.'
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pah-0.0.28 lib/pah/templates/secret_token.rb
pah-0.0.27 lib/pah/templates/secret_token.rb
pah-0.0.26 lib/pah/templates/secret_token.rb
pah-0.0.25 lib/pah/templates/secret_token.rb
pah-0.0.24 lib/pah/templates/secret_token.rb
pah-0.0.23 lib/pah/templates/secret_token.rb
pah-0.0.22 lib/pah/templates/secret_token.rb
pah-0.0.21 lib/pah/templates/secret_token.rb
pah-0.0.20 lib/pah/templates/secret_token.rb
pah-0.0.19 lib/pah/templates/secret_token.rb
pah-0.0.17 lib/pah/templates/secret_token.rb
pah-0.0.16 lib/pah/templates/secret_token.rb