Renamed `github_api` module into `github_curl` (needed the namespace for further work)
Also created the group `github` and added `github_curl` to it.
Finally, added a small nitunit.
Pull-Request: #970
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
# Curl extention to access the Github API
# See https://developer.github.com/v3/ for details
- module github_api
+ module github_curl
import curl
import json::static
super Curl
# Headers to use on all requests
- var header: HeaderMap
+ var header: HeaderMap is noinit
# OAuth token
var auth: String
# Eg. "Awesome-Octocat-App"
var user_agent: String
- init(auth: String, user_agent: String)
- do
- super
- self.auth = auth
- self.user_agent = user_agent
-
+ init do
header = new HeaderMap
header["Authorization"] = "token {auth}"
end
p.close
return token.trim
end
-