Class: Paste::Glue

Inherits:
Object
  • Object
show all
Extended by:
Resolver
Includes:
ActiveSupport::Configurable, Cache, ERBRenderer, Resolver
Defined in:
lib/paste/glue.rb

Instance Method Summary collapse

Methods included from Resolver

find, load_path, resolve

Methods included from Cache

#parser, #rebuild

Methods included from ERBRenderer

#render_all_erb, #render_erb

Constructor Details

#initializeGlue

Returns a new instance of Glue.



12
13
14
# File 'lib/paste/glue.rb', line 12

def initialize
  config.js_load_path << erb_path
end

Instance Method Details

#paste(*sources) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/paste/glue.rb', line 16

def paste *sources
  js_dependencies  = []
  css_dependencies = []

  sources.each do |source|
    in_order_traversal parser(source), js_dependencies, css_dependencies
  end

  {
    :javascripts => js_dependencies,
    :stylesheets => css_dependencies
  }
end