Sha256: 2db7cc93f1f233cc0dcd007444a396c6e73321ea928047f4bf22fd33f348a6da

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

require 'bundler/setup'
require 'hanami/setup'
require 'hanami/model'
require_relative '../lib/<%= config[:project_name] %>'

Hanami.configure do

  model do
    ##
    # Database adapter
    #
    # Available options:
    #
    #  * SQL adapter
    #    adapter :sql, 'sqlite://db/<%= config[:project_name] %>_development.sqlite3'
    #    adapter :sql, 'postgresql://localhost/<%= config[:project_name] %>_development'
    #    adapter :sql, 'mysql://localhost/<%= config[:project_name] %>_development'
    #
    adapter :<%= config[:database_config][:type] %>, ENV['DATABASE_URL']

    <%- if config[:database_config][:type] == :sql -%>
    ##
    # Migrations
    #
    migrations 'db/migrations'
    schema     'db/schema.sql'
    <%- end -%>
  end

  mailer do
    root 'lib/<%= config[:project_name] %>/mailers'

    # See http://hanamirb.org/guides/mailers/delivery
    delivery :test
  end

  environment :development do
    # See: http://hanamirb.org/guides/projects/logging
    logger level: :debug
  end

  environment :production do
    logger level: :info, formatter: :json

    mailer do
      delivery :smtp, address: ENV['SMTP_HOST'], port: ENV['SMTP_PORT']
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-1.0.0 lib/hanami/generators/application/container/config/environment.rb.tt
hanami-1.0.0.rc1 lib/hanami/generators/application/container/config/environment.rb.tt
hanami-1.0.0.beta3 lib/hanami/generators/application/container/config/environment.rb.tt
hanami-1.0.0.beta2 lib/hanami/generators/application/container/config/environment.rb.tt
hanami-1.0.0.beta1 lib/hanami/generators/application/container/config/environment.rb.tt