Sha256: 12f3d8f0fc4dfd9eb12aef7a16fce29effe90354f6327c3f81e235da87e90e2b

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

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 server
  set :server, %w[thin webrick]

  # Set core application file
  set :app_file, __FILE__

  # Set application root directory
  set :root, Eucalypt.root

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

  # Allow static files to be served
  set :static, true
  ::Static = Eucalypt::Static.new(settings.public_folder, symbolize: true).freeze

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

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

  # Toggle maintenance mode
  disable :maintenance
  require 'eucalypt/core/helpers/maintenance'

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

Eucalypt.require 'config', '*.rb'
Eucalypt.require 'config', 'initializers', '*.rb'
Eucalypt.require 'app', 'helpers', '{application_helper.rb}'
Eucalypt.require 'app', 'controllers', 'application_controller.rb'
Eucalypt.require 'app', '{models,policies,helpers,controllers}', '*.rb'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eucalypt-0.4.2 lib/eucalypt/core/templates/eucalypt/app.rb