Sha256: d71c88c4e4431f018740cb124992e1900edf73e1a68c3cc9723511ea6654868a

Contents?: true

Size: 673 Bytes

Versions: 12

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    class Compiler
      module Phases
        # Provides functionality for notifying start and end of compilation.
        class Notify < Abstract
          include Nanoc::Core::ContractsSupport

          contract Nanoc::Core::ItemRep, C::KeywordArgs[is_outdated: C::Bool], C::Func[C::None => C::Any] => C::Any
          def run(rep, is_outdated:) # rubocop:disable Lint/UnusedMethodArgument
            Nanoc::Core::NotificationCenter.post(:compilation_started, rep)
            yield
            Nanoc::Core::NotificationCenter.post(:compilation_ended, rep)
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
nanoc-4.11.12 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.11 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.10 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.9 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.8 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.7 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.6 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.5 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.4 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.3 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.2 lib/nanoc/base/services/compiler/phases/notify.rb
nanoc-4.11.1 lib/nanoc/base/services/compiler/phases/notify.rb