Sha256: 218841e4320b0ef6b920ad6188cd8c1f85708c7d833672898ef379bc77b3b64a

Contents?: true

Size: 766 Bytes

Versions: 1

Compression:

Stored size: 766 Bytes

Contents

require "hike"
require "rack"
require "tilt"

module Brochure
  VERSION = "0.5.3"

  autoload :Application,         "brochure/application"
  autoload :CaptureNotSupported, "brochure/errors"
  autoload :Context,             "brochure/context"
  autoload :Failsafe,            "brochure/failsafe"
  autoload :Static,              "brochure/static"
  autoload :Template,            "brochure/template"
  autoload :TemplateNotFound,    "brochure/errors"

  def self.app(root, options = {})
    app = Application.new(root, options)
    app = Static.new(app, app.asset_root)

    if development?
      app = Rack::ShowExceptions.new(app)
    else
      app = Failsafe.new(app)
    end

    app
  end

  def self.development?
    ENV["RACK_ENV"] == "development"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brochure-0.5.3 lib/brochure.rb