Sha256: 30e132a3c4f5a679f2e951b353bdd0b5629c64c63c5ed3fa2039b27a0dd0bc63

Contents?: true

Size: 641 Bytes

Versions: 7

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    class Compiler
      class Stage
        def call(*args)
          notify(:stage_started)
          res = Nanoc::Core::Instrumentor.call(:stage_ran, self.class) do
            run(*args)
          end
          notify(:stage_ended)
          res
        rescue
          notify(:stage_aborted)
          raise
        end

        def run(*)
          raise NotImplementedError
        end

        private

        def notify(sym)
          name = self.class.to_s.sub(/^.*::/, '')
          Nanoc::Core::NotificationCenter.post(sym, name)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nanoc-4.11.9 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.8 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.7 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.6 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.5 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.4 lib/nanoc/base/services/compiler/stage.rb
nanoc-4.11.3 lib/nanoc/base/services/compiler/stage.rb