Sha256: ca529d756bae8439074f0ce0d1d8936fc68a0b21617878c5af5c4ec2729a5110

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 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')

  # 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'

  # Set IP whitelist
  set :whitelist, Eucalypt::Whitelist.new(Eucalypt.path 'config', 'whitelist')

  # Toggle maintenance mode
  disable :maintenance

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

  require 'eucalypt/load'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eucalypt-0.5.1 lib/eucalypt/core/templates/eucalypt/app.rb
eucalypt-0.5.0 lib/eucalypt/core/templates/eucalypt/app.rb