module Firehose::Assets::Sprockets

Integrate Firehose ./lib/assets files into a sprocket-enabled environment.

Constants

JAVASCRIPT

Entry-point Javascript for Sprockets project.

Public Class Methods

auto_detect() click to toggle source

Try to automatically configure Sprockets if it’s detected in the project.

# File lib/firehose/assets.rb, line 40
def self.auto_detect
  if defined? ::Sprockets and ::Sprockets.respond_to? :append_path
    Firehose::Assets::Sprockets.configure ::Sprockets
  end
end
configure(env) click to toggle source

Drop flash and javascript paths to Firehose assets into a sprockets environment.

# File lib/firehose/assets.rb, line 16
def self.configure(env)
  env.append_path Firehose::Assets.path('javascripts')
  env
end
environment() click to toggle source

Return a new sprockets environment configured with Firehose.

# File lib/firehose/assets.rb, line 28
def self.environment
  configure ::Sprockets::Environment.new
end
javascript() click to toggle source

The “main” javascript that folks should compile and use in their web applications.

# File lib/firehose/assets.rb, line 23
def self.javascript
  Firehose::Assets::Sprockets.environment[JAVASCRIPT].source
end
manifest(directory) click to toggle source

Quick and dirty way for folks to compile the Firehose assets to a path from the CLI and use. These are usualy non-ruby (or non-sprockets) folks who want to run the firehose process and use the JS in a web app.

# File lib/firehose/assets.rb, line 35
def self.manifest(directory)
  ::Sprockets::Manifest.new(environment, directory)
end
manifest_paths() click to toggle source
# File lib/firehose/assets.rb, line 46
def self.manifest_paths
  paths = []
  paths << File.basename(Firehose::Assets.path('/javascripts/firehose/firehose.js.coffee'), '.coffee')
  paths
end