Sha256: 835d8a48e84cf54b4f2b9ac47c3c43660a25f89cefcd885a8400cb9d69431444

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 Bytes

Contents

module Appsignal
  class Marker
    attr_reader :marker_data, :config
    ACTION = 'markers'

    def initialize(marker_data, config)
      @marker_data = marker_data
      @config = config
    end

    def transmit
      transmitter = Transmitter.new(ACTION, config)
      puts "Notifying Appsignal of deploy with: "\
        "revision: #{marker_data[:revision]}, user: #{marker_data[:user]}"
      result = transmitter.transmit(marker_data)
      if result == '200'
        puts 'Appsignal has been notified of this deploy!'
      else
        raise "#{result} at #{transmitter.uri}"
      end
    rescue => e
      puts "Something went wrong while trying to notify Appsignal: #{e}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
appsignal-1.4.0.beta.1 lib/appsignal/marker.rb
appsignal-1.3.6 lib/appsignal/marker.rb