Module: Workarea::Plugin::AssetAppendsHelper

Defined in:
lib/workarea/plugin/asset_appends_helper.rb

Instance Method Summary collapse

Instance Method Details

#append_javascripts(name) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/workarea/plugin/asset_appends_helper.rb', line 20

def append_javascripts(name)
  appends = Plugin.skip_appends(
    Plugin.javascripts_appends[name],
    Workarea.config.skip_javascripts
  )

  return [] if appends.blank?

  appends.inject([]) do |arr, paths|
    Array(paths).each do |path|
      require_asset(path)
    end
  end
end

#append_stylesheets(name) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/workarea/plugin/asset_appends_helper.rb', line 4

def append_stylesheets(name)
  appends = Plugin.skip_appends(
    Plugin.stylesheets_appends[name],
    Workarea.config.skip_stylesheets
  )

  return '' if appends.blank?

  appends.inject([]) do |arr, paths|
    Array(paths).each do |path|
      arr << "@import '#{path}';"
    end
    arr
  end.join("\n")
end