diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-13 13:59:26 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-04-24 16:17:52 -0300 |
commit | 00912ed963a3495d59d8632d8d195515e9686129 (patch) | |
tree | 94490ab7d669e3813efdf9f7a94f2cf58eec4648 /lib/github/client.rb | |
parent | 4a3b895d913191102d0c69a4917a8af76a4f9b67 (diff) | |
download | gitlab-ce-00912ed963a3495d59d8632d8d195515e9686129.tar.gz |
Refactoring Github response
Diffstat (limited to 'lib/github/client.rb')
-rw-r--r-- | lib/github/client.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/github/client.rb b/lib/github/client.rb index 07cf264e8d7..1c24daba1ef 100644 --- a/lib/github/client.rb +++ b/lib/github/client.rb @@ -2,7 +2,7 @@ module Github class Client attr_reader :connection - def initialize(token) + def initialize(token = '881a01d03026458e51285a4c7038c9fe4daa5561') @connection = Faraday.new(url: 'https://api.github.com') do |faraday| faraday.authorization 'token', token faraday.adapter :net_http @@ -13,8 +13,7 @@ module Github rate_limit = RateLimit.new(connection) sleep rate_limit.reset_in if rate_limit.exceed? - response = connection.get(url, query) - Github::Response.new(response.headers, response.body, response.status) + Github::Response.new(connection.get(url, query)) end end end |