Sha256: cb50bb2a7fdf5605c4b032daa0162e2d9d897b18bfb42385c98b6b6bc555b329

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

class <%= @name.camelcase %>::Application
  before do
    content_type 'text/html'
  end

  set :sessions, true
  <%- unless @no_views -%>
  set :views, Proc.new { File.join(root, "/app/views") }
  <%- end -%>

  configure do
    enable :logging
    <%- unless @no_views -%>
    enable :static_cache_control
    <%- end -%>
    file = File.new("#{root}/log/#{environment.to_s}.log", 'a+')

    <%- unless @no_database || @database == 'mongodb' || @database == 'mongo' -%>
    ActiveRecord::Base.logger = Logger.new(file)
    <%- end -%>

    file.sync = true
    use Rack::CommonLogger, file

    # set CSRF
    # use Rack::Session::Cookie, secret: $app_settings["csrf_token"]
    # use Rack::Csrf, :raise => true

    <%- unless @no_views -%>
    # set layouts
    set :erb, :layout => :'layouts/application', :escape_html => true
    <%- end -%>
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aetherg-0.2.7 lib/templates/config/initializers/environment.rb
aetherg-0.2.5 lib/templates/config/initializers/environment.rb