Merge: Github API renaming and group creation
authorJean Privat <jean@pryen.org>
Sat, 13 Dec 2014 07:49:59 +0000 (02:49 -0500)
committerJean Privat <jean@pryen.org>
Sat, 13 Dec 2014 07:49:59 +0000 (02:49 -0500)
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>

1  2 
lib/github/github_curl.nit

@@@ -14,7 -14,7 +14,7 @@@
  
  # 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
@@@ -24,7 -24,7 +24,7 @@@ class GithubCur
        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
@@@ -78,4 -83,3 +78,3 @@@ d
        p.close
        return token.trim
  end