Class: Parcels::Fortitude::AlongsideEngine

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/parcels/fortitude/alongside_engine.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean



8
9
10
# File 'lib/parcels/fortitude/alongside_engine.rb', line 8

def self.engine_initialized?
  true
end

Instance Method Details

#evaluate(context, locals, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/parcels/fortitude/alongside_engine.rb', line 19

def evaluate(context, locals, &block)
  parcels_environment = context.environment.parcels
  widget_file = ::Parcels::Utils::PathUtils.widget_class_file_for_alongside_file(context.pathname)

  unless widget_file
    raise Errno::ENOENT, "Somehow, we're being asked to render CSS from #{context.pathname.to_s.inspect}, but we can't find a Fortitude widget class next to that file"
  end

  widget_class = parcels_environment.widget_class_from_file(widget_file)

  if widget_class
    widget_class._parcels_widget_class_alongside_css(parcels_environment, context)
  else
    ""
  end
end

#initialize_engineObject



12
13
14
# File 'lib/parcels/fortitude/alongside_engine.rb', line 12

def initialize_engine
  require_template_library 'fortitude'
end

#prepareObject



16
17
# File 'lib/parcels/fortitude/alongside_engine.rb', line 16

def prepare
end