Module: Brochure

Defined in:
lib/brochure.rb,
lib/brochure/errors.rb,
lib/brochure/static.rb,
lib/brochure/context.rb,
lib/brochure/failsafe.rb,
lib/brochure/template.rb,
lib/brochure/application.rb

Defined Under Namespace

Classes: Application, Context, Failsafe, Static, Template, TemplateNotFound

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.app(root, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/brochure.rb', line 15

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

.development?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/brochure.rb', line 28

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