Sha256: 94525b054eb307eb6601ad8661bde70141eb468bafd77273b0283916a0b565e9

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

require 'tent-status/sprockets/helpers'

module Tent
  class Status
    module SprocketsEnvironment
      def self.assets
        return @assets if defined?(@assets)
        puts 'SprocketsEnvironment loaded'
        @assets = Sprockets::Environment.new do |env|
          env.logger = Logger.new(STDOUT)
          env.context_class.class_eval do
            include SprocketsHelpers
          end
        end
        @assets.register_engine('.slim', ::Slim::Template)

        paths = %w{ javascripts stylesheets images }
        paths.each do |path|
          @assets.append_path(File.join(File.expand_path('../../../../', __FILE__), "assets/#{path}"))
        end
        @assets
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tent-status-0.0.1 lib/tent-status/sprockets/environment.rb