Class: Nanoc::Int::Compiler::Phases::Abstract
- Inherits:
-
Object
- Object
- Nanoc::Int::Compiler::Phases::Abstract
- Defined in:
- lib/nanoc/base/services/compiler/phases/abstract.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#call(rep, is_outdated:) ⇒ Object
-
#initialize(wrapped:) ⇒ Abstract
constructor
A new instance of Abstract.
-
#run(_rep, is_outdated:) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
Constructor Details
#initialize(wrapped:) ⇒ Abstract
Returns a new instance of Abstract
7 8 9 |
# File 'lib/nanoc/base/services/compiler/phases/abstract.rb', line 7 def initialize(wrapped:) @wrapped = wrapped end |
Instance Method Details
#call(rep, is_outdated:) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/nanoc/base/services/compiler/phases/abstract.rb', line 11 def call(rep, is_outdated:) notify(:phase_started, rep) run(rep, is_outdated: is_outdated) do notify(:phase_yielded, rep) @wrapped.call(rep, is_outdated: is_outdated) notify(:phase_resumed, rep) end notify(:phase_ended, rep) rescue notify(:phase_aborted, rep) raise end |
#run(_rep, is_outdated:) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
25 26 27 |
# File 'lib/nanoc/base/services/compiler/phases/abstract.rb', line 25 def run(_rep, is_outdated:) # rubocop:disable Lint/UnusedMethodArgument raise NotImplementedError end |