Class: Konacha::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/konacha/engine.rb

Class Method Summary collapse

Class Method Details

.application(app) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/konacha/engine.rb', line 9

def self.application(app)
  Rack::Builder.app do
    use Rack::ShowExceptions

    map app.config.assets.prefix do
      if Konacha.sprockets_rails_3?
        run Sprockets::Railtie.build_environment(app)
      else
        run app.assets
      end
    end

    map "/" do
      run Engine
    end
  end
end

.formattersObject


27
28
29
30
31
32
33
34
35
# File 'lib/konacha/engine.rb', line 27

def self.formatters
  if ENV['FORMAT']
    ENV['FORMAT'].split(',').map do |string|
      eval(string).new(STDOUT)
    end
  else
    [Konacha::Formatter.new(STDOUT)]
  end
end