Module: Assets::Compiler::Plugin::Rails

Defined in:
lib/assets/compiler/plugin/rails.rb

Class Method Summary collapse

Class Method Details

.extend!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/assets/compiler/plugin/rails.rb', line 7

def self.extend!
  # Rails >= 3.0
  if defined?(ActionController::Metal)
    require 'assets/compiler/plugin/rack'
    ::Rails::Application.config.middleware.use(Assets::Compiler::Plugin::Rack)

  # Rails >= 2.3
  elsif defined?(ActionController::Dispatcher) && defined?(ActionController::Dispatcher.middleware)
    require 'assets/compiler/plugin/rack'
    ActionController::Dispatcher.middleware.use(Assets::Compiler::Plugin::Rack)

  else
    raise StandardError, 'This version of rails is not supported'
  end
end