Sha256: 93151417da62a9341eb87c9aafcb418f26f7d565a6371f58f22bd6bcfb9fbd92

Contents?: true

Size: 356 Bytes

Versions: 16

Compression:

Stored size: 356 Bytes

Contents

module Danger
  class LocalPullRequest
    attr_reader :pull_request_id, :sha

    def initialize(log_line)
      @log_line = log_line

      @pull_request_id = log_line.match(/#(?<id>[0-9]+)/)[:id]
      @sha = log_line.split(" ".freeze).first
    end

    def valid?
      pull_request_id && sha
    end

    private

    attr_reader :log_line
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
danger-4.2.1 lib/danger/ci_source/support/local_pull_request.rb
danger-4.2.0 lib/danger/ci_source/support/local_pull_request.rb
danger-4.1.1 lib/danger/ci_source/support/local_pull_request.rb
danger-4.1.0 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.5 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.4 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.3 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.2 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.1 lib/danger/ci_source/support/local_pull_request.rb
danger-4.0.0 lib/danger/ci_source/support/local_pull_request.rb
danger-3.6.0 lib/danger/ci_source/support/local_pull_request.rb
danger-3.5.5 lib/danger/ci_source/support/local_pull_request.rb
danger-3.5.4 lib/danger/ci_source/support/local_pull_request.rb
danger-3.5.3 lib/danger/ci_source/support/local_pull_request.rb
danger-3.5.2 lib/danger/ci_source/support/local_pull_request.rb
danger-3.5.1 lib/danger/ci_source/support/local_pull_request.rb