Sha256: 92df8632ac7ffbca80c8f612de856b5273ce5a81eebc646b66b5532e5448a122

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

module Firehose
  # Deal with bundling Sprocket assets into environments (like Rails or Sprockets)
  module Assets
    def self.path(*segs)
      File.join File.expand_path('../../assets', __FILE__), segs
    end

    # Integrate Firehose ./lib/assets files into a sprocket-enabled environment.
    module Sprockets
      # Drop flash and javascript paths to Firehose assets into a sprockets environment.
      def self.configure(env)
        env.append_path Firehose::Assets.path('flash')
        env.append_path Firehose::Assets.path('javascripts')
        env
      end

      # Try to automatically configure Sprockets if its detected in the project.
      def self.auto_detect
        if defined? ::Sprockets and ::Sprockets.respond_to? :append_path
          Firehose::Assets::Sprockets.configure ::Sprockets
        end
      end

      def self.manifest
        paths = []
        paths << Firehose::Assets.path('/flash/firehose/WebSocketMainInsecure.swf')
        paths << File.basename(Firehose::Assets.path('/javascripts/firehose/firehose.js.coffee'), '.coffee')
        paths
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
firehose-1.2.1 lib/firehose/assets.rb
firehose-1.2.0 lib/firehose/assets.rb