Class: Balrog::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/balrog/generators/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/balrog/generators/install_generator.rb', line 6

def create_initializer_file
  password_hash = PasswordHasher.encrypt_password
  contents = <<~EOF
    Balrog::Middleware.setup do |config|
      config.set_password_hash '#{password_hash}'
      config.set_session_expiry 30.minutes
    end
  EOF
  create_file "config/initializers/balrog.rb", contents
end