Module: TrelloImporter
- Defined in:
- lib/importer/error.rb,
lib/importer/cli.rb,
lib/importer/github.rb,
lib/importer/import.rb,
lib/importer/version.rb,
lib/importer/error_handler.rb,
lib/importer/trello_issue_mapper.rb
Overview
Copyright © 2015 Scott Williams
Defined Under Namespace
Modules: CLI
Classes: ErrorHandler, Importer, Mapper, UsageError
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.api_url ⇒ Object
4
5
6
|
# File 'lib/importer/github.rb', line 4
def self.api_url
"https://api.github.com/repos/%s/%s/issues?access_token=%s"
end
|
.make_uri(owner, repo, token, options = {}) ⇒ Object
15
16
17
|
# File 'lib/importer/github.rb', line 15
def self.make_uri(owner, repo, token, options = {})
URI.parse TrelloImporter.make_url(owner, repo, token, options)
end
|
.make_url(owner, repo, token, options = {}) ⇒ Object
8
9
10
11
12
13
|
# File 'lib/importer/github.rb', line 8
def self.make_url(owner, repo, token, options = {})
url_format = TrelloImporter.api_url
root_url = url_format % [owner, repo, token]
return root_url unless options[:include_closed_issues] == true
root_url + "&state=all"
end
|
.turn_options_into_querystring(options) ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/importer/github.rb', line 19
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
|