Sha256: 6df2db7f27efe2db7beb55116faaa7bdd431e21f14b0457a5a68316a4325743d

Contents?: true

Size: 879 Bytes

Versions: 8

Compression:

Stored size: 879 Bytes

Contents

require 'bundler'
require 'active_support/core_ext/hash'
require 'sinatra'
Bundler.require :default, settings.environment
Eucalypt.set_root __dir__

class ApplicationController < Sinatra::Base
  # Set core application file
  set :app_file, __FILE__

  # Set public folder for static files
  set :public_folder, Eucalypt.path('app', 'static', 'public')

  # Set static data accessor
  ::Static = Eucalypt::Static.new(Eucalypt.path('app', 'static'), symbolize: true).freeze

  # Set views directory
  set :views, Eucalypt.path('app', 'views')

  # Set default ERB template
  set :erb, layout: :'layouts/main'

  # Set Hanami HTML and asset helpers
  helpers Hanami::Helpers, Hanami::Assets::Helpers

  # Load controllers and other application files
  require 'eucalypt/load'

  # Set maintenance route
  maintenance enabled: false do
    render_static '/maintenance.html'
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eucalypt-0.9.0 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.8.0 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.7.2 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.7.1 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.7.0 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.6.2 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.6.1 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.6.0 lib/eucalypt/core/templates/eucalypt/app.rb