Module: Comatose

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

Defined Under Namespace

Classes: ComatoseDrop, Configuration, PageWrapper, ProcessingContext

Constant Summary

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

Class Method Summary (collapse)

Class Method Details

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

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

+ (Object) config



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

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

+ (Object) configure {|config| ... }

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

+ (Object) define_drop(name, &block)

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

+ (Object) load_extensions

DEPRECATED Loads extensions from Rails.root/lib/comatose/*.rb



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

def self.load_extensions
  Dir[File.join(Rails.root.to_s, 'lib', 'comatose', '*.rb')].each do |path|
    require "comatose/#{File.basename(path)}"
  end
end

+ (Object) mount_points

All of the 'mount' points for Comatose



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

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

+ (Object) register_filter(module_name)

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

+ (Object) registered_drops

Returns/initializes a hash for storing ComatoseDrops



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

def registered_drops
  @registered_drops ||= {}
end