7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/webui/helper.rb', line 7
def webui_modules_paths(path, relative_path, arr_name='modules')
files = Dir.glob(path.join(*%w( ** *.js)))
files += Dir.glob(path.join(*%w( ** *.js.erb)))
code = ''
files.each do |file|
module_name = file[0, file.index('.')]
module_filename = javascript_path(module_name.sub(Rails.root.to_s + '/' + relative_path + '/', ''))
code += arr_name + "['" + module_name.sub(path.to_s + '/', '') + "'] = '" + module_filename.sub('.js', '') + "'\n"
end
code
end
|