Class: Pixiurge::TemplateView
- Inherits:
-
Object
- Object
- Pixiurge::TemplateView
- Defined in:
- lib/pixiurge/template_view.rb
Overview
Instance Method Summary collapse
-
#pixiurge_scripts ⇒ Object
HTML to include JavaScript for the appropriate Pixiurge scripts.
Instance Method Details
#pixiurge_scripts ⇒ Object
HTML to include JavaScript for the appropriate Pixiurge scripts.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pixiurge/template_view.rb', line 4 def pixiurge_scripts out_html = "" pix_dir = File.join(__dir__, "..", "..", "pixiurge") Dir[File.join(pix_dir, "*.js")].sort.each do |js_file| filebase = File.basename(js_file) next if filebase == "webpack.config.js" out_html += "<script src=\"/pixiurge/#{filebase}\"></script>\n" end vendor_dir = File.join(__dir__, "..", "..", "vendor", "dev") Dir[File.join(vendor_dir, "*.js")].sort.each do |js_file| filebase = File.basename(js_file) out_html += "<script src=\"/vendor/#{filebase}\"></script>\n" end out_html end |