Module: TentD::Admin::SprocketsEnvironment

Included in:
TentD::Admin
Defined in:
lib/tentd-admin/sprockets/environment.rb

Instance Method Summary collapse

Instance Method Details

#assetsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tentd-admin/sprockets/environment.rb', line 6

def assets
  return @assets if defined?(@assets)
  @assets = Sprockets::Environment.new do |env|
    env.logger = Logger.new(STDOUT)
    env.context_class.class_eval do
      include SprocketsHelpers
    end
  end

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