Sha256: 2ce02ab24821857f1e3cc7904af57ac8ac8f1a1b082cbf81117e7ca41c126a43

Contents?: true

Size: 741 Bytes

Versions: 3

Compression:

Stored size: 741 Bytes

Contents

require 'integrity'
require 'prowl'

module Integrity
  class Notifier
    class Prowl < Notifier::Base
      attr_reader :config

      def self.to_haml
        File.read(File.dirname(__FILE__) + '/config.haml')
      end

      def deliver!
        return unless config[commit.status.to_s] == '1'

        if api_keys = config['api_keys']
          api_keys.split(',').each do |key|
            prowl_params = {}
            prowl_params[:application]  = 'Integrity'
            prowl_params[:event]        = short_message
            prowl_params[:description]  = full_message

            ::Prowl.add(key, prowl_params)
          end
        end
      end

      def to_s
        'Prowl'
      end
    end

    register Prowl
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
integrity-prowl-0.3.2 lib/integrity/notifier/prowl.rb
integrity-prowl-0.3.1 lib/integrity/notifier/prowl.rb
integrity-prowl-0.3.0 lib/integrity/notifier/prowl.rb