Sha256: 7917328e1c83b21005ddc731f721dab617b6898afe2a5f3c3c16dfcdda7f00be

Contents?: true

Size: 852 Bytes

Versions: 44

Compression:

Stored size: 852 Bytes

Contents

require 'socket'

module Itamae
  module Handler
    class Base
      attr_reader :recipes, :resources, :actions

      def initialize(options)
        @options = options

        @recipes = []
        @resources = []
        @actions = []
      end

      def event(type, payload = {})
        case type
        when :recipe_started
          @recipes << payload
        when :recipe_completed, :recipe_failed
          @recipes.pop
        when :resource_started
          @resources << payload
        when :resource_completed, :resource_failed
          @resources.pop
        when :action_started
          @actions << payload
        when :action_completed, :action_failed
          @actions.pop
        end
      end

      private

      def hostname
        @hostname ||= @options['hostname'] || Socket.gethostname
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
itamae-1.14.1 lib/itamae/handler/base.rb
itamae-1.14.0 lib/itamae/handler/base.rb
itamae-1.13.1 lib/itamae/handler/base.rb
itamae-1.13.0 lib/itamae/handler/base.rb
itamae-1.12.6 lib/itamae/handler/base.rb
itamae-1.12.5 lib/itamae/handler/base.rb
itamae-1.12.4 lib/itamae/handler/base.rb
itamae-1.12.3 lib/itamae/handler/base.rb
itamae-1.12.2 lib/itamae/handler/base.rb
itamae-1.12.1 lib/itamae/handler/base.rb
itamae-1.12.0 lib/itamae/handler/base.rb
itamae-1.11.2 lib/itamae/handler/base.rb
itamae-1.11.1 lib/itamae/handler/base.rb
itamae-1.11.0 lib/itamae/handler/base.rb
itamae-1.10.10 lib/itamae/handler/base.rb
itamae-1.10.9 lib/itamae/handler/base.rb
itamae-1.10.8 lib/itamae/handler/base.rb
itamae-1.10.7 lib/itamae/handler/base.rb
itamae-1.10.6 lib/itamae/handler/base.rb
itamae-1.10.5 lib/itamae/handler/base.rb