class Emcee::Resolver
Public Class Methods
new(context)
click to toggle source
# File lib/emcee/resolver.rb, line 4 def initialize(context) @context = context @directory = File.dirname(context.pathname) end
Public Instance Methods
absolute_path(path)
click to toggle source
# File lib/emcee/resolver.rb, line 32 def absolute_path(path) File.absolute_path(path, @directory) end
depend_on_asset(path)
click to toggle source
Allows to state an asset dependency without including it
# File lib/emcee/resolver.rb, line 16 def depend_on_asset(path) @context.depend_on_asset(path) end
evaluate(path)
click to toggle source
Return the contents of a file. Does any required processing, such as SCSS or CoffeeScript.
# File lib/emcee/resolver.rb, line 22 def evaluate(path) @context.evaluate(path) end
require_asset(path)
click to toggle source
Declare a file as a dependency to Sprockets
. The dependency will be included in the application’s html bundle.
# File lib/emcee/resolver.rb, line 11 def require_asset(path) @context.require_asset(path) end
should_inline?(path)
click to toggle source
Indicate if an asset should be inlined or not. References to files at an external web address, for example, should not be inlined.
# File lib/emcee/resolver.rb, line 28 def should_inline?(path) path !~ /\A\/\// end