Module: Comatose
- Defined in:
- lib/comatose.rb,
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
-
.add_mount_point(path, info = {:index=>''}) ⇒ Object
Adds a ‘mount’ point to the list of known roots…
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
-
.define_drop(name, &block) ⇒ Object
Simple wrapper around the ProcessingContext.define method I think Comatose.define_drop is probably simpler to remember too.
-
.load_extensions ⇒ Object
DEPRECATED Loads extensions from RAILS_ROOT/lib/comatose/*.rb.
-
.mount_points ⇒ Object
All of the ‘mount’ points for Comatose.
-
.register_filter(module_name) ⇒ Object
Registers a ‘filter’ for Liquid use.
-
.registered_drops ⇒ Object
Returns/initializes a hash for storing ComatoseDrops.
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 |
.config ⇒ Object
3 4 5 |
# File 'lib/comatose/configuration.rb', line 3 def self.config @@config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
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 |
.load_extensions ⇒ Object
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, 'lib', 'comatose', '*.rb')].each do |path| require "comatose/#{File.basename(path)}" end end |
.mount_points ⇒ Object
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_drops ⇒ Object
Returns/initializes a hash for storing ComatoseDrops
29 30 31 |
# File 'lib/comatose/comatose_drop.rb', line 29 def registered_drops @registered_drops ||= {} end |