Sha256: fb6272833d3813d741eaaecc91b8b54eb8fcadc4e6d798ab870848463e9d87b2

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

require_relative 'deano'
require 'sinatra/base'

module Deano
  class Base < Sinatra::Base

    class << self

      def inherited(klass)
        super
        klass.set :root, Deano.root
        klass.set :views, [File.join(Deano.root, "apps", "views"), File.join(Deano.root, "apps", "views", "shared"), File.join(Deano.root, "apps", "views", klass.name.underscore.gsub(/(_app$)/, ''))]
      end

    end

    def find_template(views, name, engine, &block)
      Array(views).each { |v| super(v, name, engine, &block) }
    end

    before do
      puts "[#{request.request_method}] #{request.url}"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deano-1.1.2 lib/deano/base.rb