Class: PBSimply::Hooks
- Inherits:
-
Object
- Object
- PBSimply::Hooks
- Defined in:
- lib/pbsimply/hooks.rb
Overview
Hooks is new in PureBuilder Simply 2.2. Hooks object has instance variables for each timing.
Defined Under Namespace
Classes: HooksHolder, HooksHolderPre
Instance Attribute Summary collapse
-
#accs ⇒ Object
readonly
Returns the value of attribute accs.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#delete ⇒ Object
readonly
Returns the value of attribute delete.
-
#post ⇒ Object
readonly
Returns the value of attribute post.
-
#pre ⇒ Object
readonly
Returns the value of attribute pre.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
Instance Method Summary collapse
-
#initialize(pbsimply, config) ⇒ Hooks
constructor
A new instance of Hooks.
- #load ⇒ Object
Constructor Details
#initialize(pbsimply, config) ⇒ Hooks
Returns a new instance of Hooks.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/pbsimply/hooks.rb', line 62 def initialize(pbsimply, config) @pbsimply = pbsimply @config = config @hooks_loaded = false # Called first phase before generate. This hooks called before blessing. # # Argument: frontmatter, procdoc. # procdoc is processing source document path. @pre = HooksHolderPre.new "pre" # Called after document was generated. # # Argument: outpath, frontmatter, procdoc. # outpath is generated final document path. You can read output result. # procdoc is source document path before generate. @process = HooksHolder.new "process" # Called each deleted document on ACCS final phase, before deletion. # # Argument: target_file_path, source_file_path. # target_file_path is output file path (existing or non-existing.) @delete = HooksHolder.new "delete" # Called after all document were generated. # # Argument: this_time_processed([{source, dest, frontmatter}...]) # this_time_processed has actually processed documents. # source is source file path, dest is generated file path. @post = HooksHolder.new "post" # Called before generating ACCS index. # # Argument: index, indexes. # # index is @index (frontmatter for ACCS index), # indexes is @indexes. @accs = HooksHolder.new "accs" end |
Instance Attribute Details
#accs ⇒ Object (readonly)
Returns the value of attribute accs.
114 115 116 |
# File 'lib/pbsimply/hooks.rb', line 114 def accs @accs end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
116 117 118 |
# File 'lib/pbsimply/hooks.rb', line 116 def config @config end |
#delete ⇒ Object (readonly)
Returns the value of attribute delete.
112 113 114 |
# File 'lib/pbsimply/hooks.rb', line 112 def delete @delete end |
#post ⇒ Object (readonly)
Returns the value of attribute post.
113 114 115 |
# File 'lib/pbsimply/hooks.rb', line 113 def post @post end |
#pre ⇒ Object (readonly)
Returns the value of attribute pre.
110 111 112 |
# File 'lib/pbsimply/hooks.rb', line 110 def pre @pre end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
111 112 113 |
# File 'lib/pbsimply/hooks.rb', line 111 def process @process end |