Class: Ext::JsHelpers::Controllers::JoinScripts
- Defined in:
- lib/ext/js_helpers.rb
Class Attribute Summary collapse
-
.root ⇒ Object
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
Class Method Details
.urls ⇒ Object
27 |
# File 'lib/ext/js_helpers.rb', line 27 def urls; ['/scripts/(.*).js'] end |
Instance Method Details
#get(scripts) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ext/js_helpers.rb', line 32 def get(scripts) scripts = scripts.split(';').uniq data = "" scripts.each do |script| path = File.join(self.class.root, "#{script}.js") begin data << File.open(path).read rescue Errno::ENOENT => ex data << "// ERROR : #{ex}\n" end end data end |