Sha256: 82e1da265ce0962782e311c94b5cc289d5a9c1ee9776c643da08e7e0e665a563

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

require "open-uri"

module IssueExporting
  def self.api_url
    "https://api.github.com/repos/%s/%s/issues?access_token=%s"
  end

  def self.make_url(owner, repo, token, options = {})
    url_format = IssueExporting.api_url
    root_url = url_format % [owner, repo, token]
    return root_url unless options[:include_closed_issues] == true
    root_url + "&state=all"
  end

  def self.make_uri(owner, repo, token, options = {})
    URI.parse IssueExporting.make_url(owner, repo, token, options)
  end

  def self.turn_options_into_querystring(options)
    querystring = ''
    options.each do |k, v|
      escaped_k, escaped_v = URI::encode(k), URI::encode(v)
      querystring += "#{escaped_k}=#{escaped_v}&"
    end
    querystring.chop
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
github_issue_exporter-0.2.1 lib/issue_exporter/github.rb