Sha256: 663d1e0f149dd67fdc3c16d717ce17981e7155a7c4d46fb8da6360b975f84603

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

require 'github'

class Request
  module Payload
    class Github < ::Github::ServiceHook::Payload
      def initialize(data, token)
        super(data)
        self.token = token
      end

      def attributes
        { :source => source, :payload => payload, :commit => last_commit.to_hash, :token => token }
      end

      def reject?
        no_commit? || repository.private? || skipped? || github_pages?
      end

      protected

        def no_commit?
          last_commit.commit.blank?
        end

        def skipped?
          last_commit.message.to_s =~ /\[ci(?: |:)([\w ]*)\]/i && $1.downcase == 'skip'
        end

        def github_pages?
          last_commit.branch =~ /gh[-_]pages/i
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
travis-core-0.0.1 lib/travis/model/request/payload/github.rb