Module: Comatose

Defined in:
lib/comatose/version.rb,
lib/comatose/comatose_drop.rb,
lib/comatose/configuration.rb

Defined Under Namespace

Classes: ComatoseDrop, Configuration, PageWrapper, ProcessingContext

Constant Summary collapse

VERSION =
"2.0.5"
VERSION_STRING =
"#{VERSION}  (beta)"

Class Method Summary collapse

Class Method Details

.add_mount_point(path, info = {:index=>''}) ⇒ Object

Adds a ‘mount’ point to the list of known roots…



19
20
21
22
23
# File 'lib/comatose/configuration.rb', line 19

def self.add_mount_point(path, info={:index=>''})
  path = "/#{path}" unless path.starts_with? '/'
  info[:root]=path
  mount_points << info
end

.configObject



3
4
5
# File 'lib/comatose/configuration.rb', line 3

def self.config
  @@config ||= Configuration.new
end

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

Yields:



7
8
9
10
11
# File 'lib/comatose/configuration.rb', line 7

def self.configure(&block)
  raise "#configure must be sent a block" unless block_given?
  yield config
  config.validate!
end

.define_drop(name, &block) ⇒ Object

Simple wrapper around the ProcessingContext.define method I think Comatose.define_drop is probably simpler to remember too



35
36
37
# File 'lib/comatose/comatose_drop.rb', line 35

def define_drop(name, &block)
  ComatoseDrop.define(name, &block)
end

.mount_pointsObject

All of the ‘mount’ points for Comatose



14
15
16
# File 'lib/comatose/configuration.rb', line 14

def self.mount_points
  @@mount_points ||= []
end

.register_filter(module_name) ⇒ Object

Registers a ‘filter’ for Liquid use



40
41
42
# File 'lib/comatose/comatose_drop.rb', line 40

def register_filter(module_name)
  Liquid::Template.register_filter(module_name)
end

.registered_dropsObject

Returns/initializes a hash for storing ComatoseDrops



29
30
31
# File 'lib/comatose/comatose_drop.rb', line 29

def registered_drops
  @registered_drops ||= {}
end