module MultiJs

Constants

REQUIREMENT_MAP
VERSION

Public Class Methods

default_adapter() click to toggle source

The default adapter based on what you currently have loaded and installed. First checks to see if any adapters are already loaded, then checks to see which are installed if none are loaded.

# File lib/multi_js.rb, line 25
def default_adapter
  return :closure if defined?(::Closure)
  return :yui_compressor if defined?(::YUI::JavaScriptCompressor)
  return :uglifier if defined?(::Uglifier)

  REQUIREMENT_MAP.each do |(library, adapter)|
    begin
      require library
      return adapter
    rescue LoadError
      next
    end
  end

  :uglifier
end