Sha256: 1357176d9bbd7b4f760e4bfb59ced06b59186ff5c4d5a9510ed9462e7ac62be2

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

require 'bundler'
Bundler.require :default

Eucalypt::ROOT = __dir__.freeze

module Eucalypt
  class << self
    def root() ROOT end
    def path(*args) File.join(ROOT, *args) end
    def glob(*args, &block) Dir.glob(self.path(*args), &block) end
  end
end

Eucalypt.glob 'config', 'initializers', '*.rb', &method(:require)

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

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 views directory
  set :views, Eucalypt.path('app', 'views')

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

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

require Eucalypt.path 'config', 'logging'
Eucalypt.glob 'config', '*.rb', &method(:require)
Eucalypt.glob 'app', 'helpers', '{application_helper.rb}', &method(:require)
require Eucalypt.path 'app', 'controllers', 'application_controller'
Eucalypt.glob 'app', '{models,policies,helpers,controllers}', '*.rb', &method(:require)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eucalypt-0.2.0 lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb
eucalypt-0.1.3 lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb
eucalypt-0.1.2 lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb
eucalypt-0.1.1 lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb
eucalypt-0.1.0 lib/eucalypt/eucalypt-core/templates/eucalypt/app.rb