Class: Ramaze::Asset::CSS

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

Overview

File group for CSS files, these files are minified using CSSMin.

Author:

  • Yorick Peterse

Since:

  • 0.1

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

#html_tag(gestalt, path) ⇒ Object

Builds a single <link> tag.

Parameters:

  • gestalt (Ramaze::Gestalt)

    An instance of Ramaze::Gestalt used to build the tags.

  • path (String)

    The relative path to the file for the tag.

Author:

  • Yorick Peterse

Since:

  • 0.1



35
36
37
38
39
40
41
# File 'lib/ramaze/asset/css.rb', line 35

def html_tag(gestalt, path)
  gestalt.link(
    :rel  => 'stylesheet',
    :href => path,
    :type => 'text/css'
  )
end

#minify(input) ⇒ String

Minifies the output and returns the result as a string.

Parameters:

  • input (String)

    The input to minify.

Returns:

  • (String)

Author:

  • Yorick Peterse

Since:

  • 0.1



22
23
24
# File 'lib/ramaze/asset/css.rb', line 22

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