Module: IssueExporting

Defined in:
lib/issue_exporter/error.rb,
lib/issue_exporter/cli.rb,
lib/issue_exporter/export.rb,
lib/issue_exporter/github.rb,
lib/issue_exporter/import.rb,
lib/issue_exporter/version.rb,
lib/issue_exporter/outputter.rb,
lib/issue_exporter/error_handler.rb,
lib/issue_exporter/directory_importer.rb

Overview

Copyright © 2015 Scott Williams

Defined Under Namespace

Modules: CLI Classes: BaseOutputter, CsvOutputter, DirectoryImporter, ErrorHandler, Exporter, FileOutputter, Importer, UsageError

Constant Summary collapse

VERSION =
"0.3.1"

Class Method Summary collapse

Class Method Details

.api_urlObject



2
3
4
# File 'lib/issue_exporter/github.rb', line 2

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

.make_uri(owner, repo, token) ⇒ Object



12
13
14
# File 'lib/issue_exporter/github.rb', line 12

def self.make_uri(owner, repo, token)
  URI(IssueExporting.make_url(owner, repo, token))
end

.make_url(owner, repo, token) ⇒ Object



6
7
8
9
10
# File 'lib/issue_exporter/github.rb', line 6

def self.make_url(owner, repo, token)
  url_format = IssueExporting.api_url
  root_url = url_format % [owner, repo, token]
  return root_url 
end

.turn_options_into_querystring(options) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/issue_exporter/github.rb', line 16

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