Sha256: 7678175090e89a7ebc0fcd955bad1e141cbfb7e0d3dce18cd7cdb9844431abf8

Contents?: true

Size: 630 Bytes

Versions: 3

Compression:

Stored size: 630 Bytes

Contents

#js
def base_js(file)
  is_base_file = file.include?( "application.js" ) || file.include?("routes.js")
  is_base_file
end

def include_js
  template_path = File.expand_path('../', __FILE__)
  template = ""
  js_files = File.join("js","**", "*.js")
  Dir.glob js_files do |file|
    if ! base_js file
      template += haml_render "#{template_path}/_js_script_tag.haml",  {:js_file_path => file}
    end
  end
  template += haml_render "#{template_path}/_js_script_tag.haml",  {:js_file_path => "js/application.js"}
  template += haml_render "#{template_path}/_js_script_tag.haml",  {:js_file_path => "js/routes.js"}
  template
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jt-partial-1.0.3 lib/jt-partial/js.rb
jt-partial-1.0.2 lib/jt-partial/js.rb
jt-partial-1.0.1 lib/jt-partial/js.rb