Module Jammit
In: lib/jammit/command_line.rb
lib/jammit/compressor.rb
lib/jammit/controller.rb
lib/jammit/helper.rb
lib/jammit/packager.rb
lib/jammit/railtie.rb
lib/jammit/routes.rb
lib/jammit.rb

@Jammit@ is the central namespace for all Jammit classes, and provides access to all of the configuration options.

Methods

Classes and Modules

Module Jammit::Helper
Module Jammit::Routes
Class Jammit::CommandLine
Class Jammit::Compressor
Class Jammit::Controller
Class Jammit::DeprecationError
Class Jammit::MissingConfiguration
Class Jammit::OutputNotWritable
Class Jammit::PackageNotFound
Class Jammit::Packager
Class Jammit::Railtie
Class Jammit::Uglifier

Constants

VERSION = "0.6.5"
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ENV['RAILS_ROOT'] || ".") unless defined?(ASSET_ROOT)
DEFAULT_PUBLIC_ROOT = (defined?(Rails) && Rails.public_path.to_s.length > 0) ? Rails.public_path : File.join(ASSET_ROOT, 'public') unless defined?(PUBLIC_ROOT)
DEFAULT_CONFIG_PATH = File.join(ASSET_ROOT, 'config', 'assets.yml')
DEFAULT_PACKAGE_PATH = "assets"
DEFAULT_JST_SCRIPT = File.join(ROOT, 'lib/jammit/jst.js')
DEFAULT_JST_COMPILER = "template"
DEFAULT_JST_NAMESPACE = "window.JST"
COMPRESSORS = [:yui, :closure, :uglifier]
DEFAULT_COMPRESSOR = :yui
JS_EXTENSION = /\.js\Z/   Extension matchers for JavaScript and JST, which need to be disambiguated.
DEFAULT_JST_EXTENSION = "jst"

Attributes

allow_debugging  [R] 
compress_assets  [R] 
compressor_options  [R] 
compressors  [RW] 
config_path  [R] 
configuration  [R] 
css_compressor_options  [R] 
embed_assets  [R] 
gzip_assets  [R] 
include_jst_script  [R] 
javascript_compressor  [R] 
mhtml_enabled  [R] 
package_assets  [R] 
package_path  [R] 
public_root  [R] 
template_extension  [R] 
template_extension_matcher  [R] 
template_function  [R] 
template_namespace  [R] 

Public Class methods

Generates the server-absolute URL to an asset package.

Generate the base filename for a version of a given package.

Load the complete asset configuration from the specified @config_path@. If we‘re loading softly, don‘t let missing configuration error out.

Convenience method for packaging up Jammit, using the default options.

Keep a global (thread-local) reference to a @Jammit::Packager@, to avoid recomputing asset lists unnecessarily.

Force a reload by resetting the Packager and reloading the configuration. In development, this will be called as a before_filter before every request.

Private Class methods

Jammit 0.5+ no longer supports separate template packages.

The YUI Compressor requires Java > 1.4, and Closure requires Java > 1.6.

If we don‘t have a working Java VM, then disable asset compression and complain loudly.

Ensure that the JavaScript compressor is a valid choice.

Turn asset packaging on or off, depending on configuration and environment.

Allows command-line definition of `PUBLIC_ROOT`, for those using Jammit outside of Rails.

Set the extension for JS templates.

Assign the JST template function, unless explicitly turned off.

Set the root JS object in which to stash all compiled JST.

Clone of active_support‘s symbolize_keys, so that we don‘t have to depend on active_support in any fashion. Converts a hash‘s keys to all symbols.

[Validate]