Sha256: ab58e9341521edc1f7a2b637db6a8b2d2ad4243dd5ebba2a2e0429842bc8749a

Contents?: true

Size: 654 Bytes

Versions: 43

Compression:

Stored size: 654 Bytes

Contents

module HubHelper
  def self.get_pull_number(comment)
    if comment[:pull_request]
      return comment[:pull_request][:number]
    elsif comment[:issue_url]
      return comment[:issue_url].split('/')[-1]
    elsif comment[:pull_request_url]
      return comment[:pull_request_url].split('/')[-1]
    else
      return nil
    end
  end

  def self.comment_setup(comment, repo_id, kind)
    comment[:repo_id] = repo_id
    comment[:pull_number] = get_pull_number(comment)
    comment[:kind] = kind
    return comment
  end

  def self.pull_setup(pull_request)
    pull_request[:repository] = pull_request[:base][:repo]
    return pull_request
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
hubstats-0.3.17 lib/hub_helper.rb
hubstats-0.3.16 lib/hub_helper.rb
hubstats-0.3.15 lib/hub_helper.rb
hubstats-0.3.14 lib/hub_helper.rb
hubstats-0.3.13 lib/hub_helper.rb
hubstats-0.3.12 lib/hub_helper.rb
hubstats-0.3.11 lib/hub_helper.rb
hubstats-0.3.10 lib/hub_helper.rb
hubstats-0.3.9 lib/hub_helper.rb
hubstats-0.3.8 lib/hub_helper.rb
hubstats-0.3.7 lib/hub_helper.rb
hubstats-0.3.6 lib/hub_helper.rb
hubstats-0.3.5 lib/hub_helper.rb
hubstats-0.3.4 lib/hub_helper.rb
hubstats-0.3.3 lib/hub_helper.rb
hubstats-0.3.2 lib/hub_helper.rb
hubstats-0.3.1 lib/hub_helper.rb
hubstats-0.3.0 lib/hub_helper.rb
hubstats-0.2.3 lib/hub_helper.rb
hubstats-0.2.2 lib/hub_helper.rb