Class: Ekylibre::Extension

Inherits:
Object
  • Object
show all
Defined in:
lib/ekylibre/extension.rb

Class Method Summary collapse

Class Method Details

.insert_css_file(extension_name) ⇒ Object

Insert the css file to the plugins.scss tmp file. The plugins.scss file is inserted to all.scss.


6
7
8
9
10
11
12
13
14
# File 'lib/ekylibre/extension.rb', line 6

def insert_css_file(extension_name)
  Ekylibre.themes.each do |theme|
    stylesheet = "// This files contains #{theme} theme addons from plugins\n\n"
    stylesheet << "@import \"#{extension_name}\";\n"

    file_path = "themes/#{theme}/plugins.scss"
    write_asset_tmp_file('theme-addons', file_path, stylesheet)
  end
end

.insert_js_file(extension_name) ⇒ Object

Insert the js file to the plugins.js.coffee tmp file. The plugins.js.coffee file is inserted to application.js.


18
19
20
21
22
23
24
# File 'lib/ekylibre/extension.rb', line 18

def insert_js_file(extension_name)
  script = "# This files contains JS addons from plugins\n"
  script << "#= require #{extension_name}\n"

  file_path = 'plugins.js.coffee'
  write_asset_tmp_file('javascript-addons', file_path, script)
end