Sha256: 9eaaae85cc66ea3a3f17147d7ff89ac5ff75c1c3127ec3bcaccf23d44e6579b9

Contents?: true

Size: 407 Bytes

Versions: 44

Compression:

Stored size: 407 Bytes

Contents

module Itamae
  module Handler
    class Json < Base
      def initialize(*)
        super
        require 'time'
        open_file
      end

      def event(type, payload = {})
        super
        @f.puts({'time' => Time.now.iso8601, 'event' => type, 'payload' => payload}.to_json)
      end

      private

      def open_file
        @f = open(@options.fetch('path'), 'a')
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
itamae-1.10.4 lib/itamae/handler/json.rb
itamae-1.10.3 lib/itamae/handler/json.rb
itamae-1.10.2 lib/itamae/handler/json.rb
itamae-1.10.1 lib/itamae/handler/json.rb
itamae-1.10.0 lib/itamae/handler/json.rb
itamae-1.9.13 lib/itamae/handler/json.rb
itamae-1.9.12 lib/itamae/handler/json.rb
itamae-1.9.11 lib/itamae/handler/json.rb
itamae-1.9.10 lib/itamae/handler/json.rb
itamae-1.9.9 lib/itamae/handler/json.rb
itamae-1.9.8 lib/itamae/handler/json.rb
itamae-1.9.7.pre lib/itamae/handler/json.rb
itamae-1.9.6 lib/itamae/handler/json.rb
itamae-1.9.6.pre lib/itamae/handler/json.rb
itamae-1.9.5 lib/itamae/handler/json.rb
itamae-1.9.4 lib/itamae/handler/json.rb
itamae-mitsurin-0.4 lib/itamae/handler/json.rb
itamae-mitsurin-0.3 lib/itamae/handler/json.rb
itamae-mitsurin-0.2 lib/itamae/handler/json.rb
itamae-mitsurin-0.1 lib/itamae/handler/json.rb