Class: Ramaze::Asset::Javascript

Inherits:
FileGroup show all
Defined in:
lib/ramaze/asset/javascript.rb

Overview

File group for Javascript files. These Javascript files are minified using JSMin.

Author:

Since:

Instance Attribute Summary

Attributes inherited from FileGroup

#files, #options

Instance Method Summary (collapse)

Methods inherited from FileGroup

#build, #build_html, #extension, extension, #initialize

Constructor Details

This class inherits a constructor from Ramaze::Asset::FileGroup

Instance Method Details

- (Object) html_tag(gestalt, path)

Builds a "<script>" tag for a single Javascript file.

Author:

  • Yorick Peterse

Since:

  • 0.1



36
37
38
# File 'lib/ramaze/asset/javascript.rb', line 36

def html_tag(gestalt, path)
  gestalt.script(:src => path, :type => 'text/javascript') {}
end

- (String) minify(input)

Minifies the output and returns the result as a string.

Author:

  • Yorick Peterse

Since:

  • 0.1



23
24
25
# File 'lib/ramaze/asset/javascript.rb', line 23

def minify(input)
  return JSMin.minify(input)
end