Class: Tipsy::Handler::SassHandler::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/tipsy/handler/sass/resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Resolver

Returns a new instance of Resolver.



8
9
10
# File 'lib/tipsy/handler/sass/resolver.rb', line 8

def initialize(context)
  @context = context
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



6
7
8
# File 'lib/tipsy/handler/sass/resolver.rb', line 6

def context
  @context
end

Instance Method Details

#process(path) ⇒ Object



24
25
26
# File 'lib/tipsy/handler/sass/resolver.rb', line 24

def process(path)
  context.environment[path].to_s
end

#public_path(path, scope) ⇒ Object



20
21
22
# File 'lib/tipsy/handler/sass/resolver.rb', line 20

def public_path(path, scope)
  context.asset_paths.compute_public_path(path, scope)
end

#resolve(path, content_type = :self) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/tipsy/handler/sass/resolver.rb', line 12

def resolve(path, content_type = :self)
  options = {}
  options[:content_type] = content_type unless content_type.nil?
  context.resolve(path, options)
rescue Sprockets::FileNotFound, Sprockets::ContentTypeMismatch
  nil
end