Class: Emcee::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/emcee/resolver.rb

Overview

Resolver is responsible for interfacing with Sprockets.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Resolver

Returns a new instance of Resolver.



6
7
8
9
# File 'lib/emcee/resolver.rb', line 6

def initialize(context)
  @context = context
  @directory = File.dirname(context.pathname)
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



4
5
6
# File 'lib/emcee/resolver.rb', line 4

def directory
  @directory
end

Instance Method Details

#evaluate(path) ⇒ Object



15
16
17
# File 'lib/emcee/resolver.rb', line 15

def evaluate(path)
  @context.evaluate(path)
end

#require_asset(path) ⇒ Object



11
12
13
# File 'lib/emcee/resolver.rb', line 11

def require_asset(path)
  @context.require_asset(path)
end

#should_inline?(path) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/emcee/resolver.rb', line 19

def should_inline?(path)
  path !~ /\A\/\//
end