Module: Transit
- Extended by:
- Transit
- Includes:
- ActiveSupport::Configurable
- Included in:
- Transit
- Defined in:
- lib/transit.rb,
lib/transit/hooks.rb,
lib/transit/error.rb,
lib/transit/engine.rb,
lib/transit/version.rb,
lib/transit/delivery.rb,
lib/transit/extension.rb,
lib/transit/definition.rb,
lib/transit/deliverable.rb,
lib/transit/configuration.rb,
lib/transit/definitions/post.rb,
lib/transit/definitions/page.rb,
lib/transit/definitions/base.rb,
lib/transit/extensions/publishing.rb,
lib/transit/extensions/attachments.rb,
lib/transit/extensions/content_blocks.rb,
lib/generators/transit/setup_generator.rb
Overview
Setup default configuration options
Defined Under Namespace
Modules: Definition, Deliverable, Extension, Generators, Support Classes: Delivery, Engine
Constant Summary
- VERSION =
"0.1.0"
Class Method Summary (collapse)
-
+ (Object) execute_hook(base, options, block)
Executes a definition hook.
-
+ (Object) on_definition(name, options = {}, &block)
Add a hook to be called when a deliverable definition is applied to a class.
-
+ (Object) run_definition_hooks(name, base = Object)
Runs all definition hooks for a particular definition.
Instance Method Summary (collapse)
-
- (Object) configure {|config| ... }
Configure options using a block.
-
- (Object) deliverables
Stores a hash which identifies all registered deliverables within the app.
Class Method Details
+ (Object) execute_hook(base, options, block)
Executes a definition hook
39 40 41 42 43 44 45 |
# File 'lib/transit/hooks.rb', line 39 def self.execute_hook(base, , block) if [:yield] block.call(base) else base.instance_eval(&block) end end |
+ (Object) on_definition(name, options = {}, &block)
Add a hook to be called when a deliverable definition is applied to a class.
28 29 30 31 32 33 34 |
# File 'lib/transit/hooks.rb', line 28 def self.on_definition(name, = {}, &block) if base = @defined[name] execute_hook(base, , block) else @definition_hooks[name] << [block, ] end end |
+ (Object) run_definition_hooks(name, base = Object)
Runs all definition hooks for a particular definition
52 53 54 55 56 57 |
# File 'lib/transit/hooks.rb', line 52 def self.run_definition_hooks(name, base = Object) @defined[name] = base @definition_hooks[name].each do |hook, | execute_hook(base, , hook) end end |
Instance Method Details
- (Object) configure {|config| ... }
Configure options using a block
26 27 28 |
# File 'lib/transit.rb', line 26 def configure yield config end |
- (Object) deliverables
Stores a hash which identifies all registered deliverables within the app.
19 20 21 |
# File 'lib/transit.rb', line 19 def deliverables @deliverables ||= {} end |