Module: Rack::Less

Defined in:
lib/rack/less.rb,
lib/rack/less/version.rb,
lib/rack/less/response.rb,
lib/rack/less/request.rb,
lib/rack/less/options.rb,
lib/rack/less/source.rb,
lib/rack/less/config.rb,
lib/rack/less/base.rb

Overview

Usage

Create with default configs:

require 'rack/less'
Rack::Less.new(app, :compress => true)

Within a rackup file (or with Rack::Builder):

require 'rack/less'

use Rack::Less,
  :source   => 'app/less'
  :compress => true

run app

Defined Under Namespace

Modules: Options Classes: Base, Config, Request, Response, Source

Constant Summary collapse

VERSION =
'3.0.2'
MIME_TYPE =
"text/css"
@@config =
Config.new

Class Method Summary collapse

Class Method Details

.cache_bustObject

Cache bust config convenience method



53
54
55
# File 'lib/rack/less.rb', line 53

def cache_bust
  @@config.cache_bust
end

.combinations(key = nil) ⇒ Object

Combinations config convenience method



43
44
45
# File 'lib/rack/less.rb', line 43

def combinations(key=nil)
  @@config.combinations(key)
end

.configObject



35
36
37
# File 'lib/rack/less.rb', line 35

def config
  @@config
end

.config=(value) ⇒ Object



38
39
40
# File 'lib/rack/less.rb', line 38

def config=(value)
  @@config = value
end

.configure {|@@config| ... } ⇒ Object

Configuration accessors for Rack::Less (see config.rb for details)

Yields:



32
33
34
# File 'lib/rack/less.rb', line 32

def configure
  yield @@config if block_given?
end

.new(app, options = {}, &block) ⇒ Object

Create a new Rack::Less middleware component

> the options Hash can be used to specify default configuration values

> (see Rack::Less::Options for possible key/values)



62
63
64
# File 'lib/rack/less.rb', line 62

def self.new(app, options={}, &block)
  Base.new(app, options, &block)
end

.stylesheet(key) ⇒ Object

Stylesheet helper, config convenience method



48
49
50
# File 'lib/rack/less.rb', line 48

def stylesheet(key)
  @@config.stylesheet(key)
end