Sha256: 3a71df906a9896bd2f850f57f9736ec0bbdbb4ee1be354e16569af4118bd74a9

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

require 'integrity'
module Integrity
  class Notifier
    class Shell < Notifier::Base
      attr_reader :pass_script, :fail_script
      
      def self.to_haml
        File.read(File.dirname(__FILE__) + "/config.haml")
      end
    
      def initialize(commit, config={})
        @pass_script = config["pass_script"]
        @fail_script = config["fail_script"]
        super(commit, config) # sets @config and @commit
      end
      
      def deliver!
        #we have access to commit and to config
        if @commit.failed?
          `#{fail_script}`
        else
          `#{pass_script}`
        end
      end
    end
    register Shell
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
michaelglass-integrity-shell-0.1.0 lib/integrity/notifier/shell.rb