Bug fixes

- The `--verify-ssl` command option did not properly set SSL configuration on
   GitHub API clients.
 - Setting GitHub access tokens with `--access-tokens` command option resulted
   in an error.
This commit is contained in:
Michael Henriksen
2016-03-19 09:19:31 +01:00
parent 93d07164d6
commit f72a2c57b7
5 changed files with 19 additions and 10 deletions

View File

@@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- The `--verify-ssl` command option did not properly set SSL configuration
on GitHub API clients.
- Setting GitHub access tokens with `--access-tokens` command option resulted
in an error.
## [1.0.0]
### Added
- Complete rewrite of Gitrob
- Analyze arbitrary amount of organizations and users

View File

@@ -25,10 +25,10 @@ module Gitrob
:default => 9393,
:desc => "Port to run web server on"
class_option :access_tokens,
:type => :array,
:type => :string,
:banner => "TOKENS",
:desc => "GitHub API tokens to use " \
"instead of what has been configured"
:desc => "Comma-separated list of GitHub API tokens to " \
"use instead of what has been configured"
class_option :color,
:type => :boolean,
:default => true,

View File

@@ -36,7 +36,9 @@ module Gitrob
:oauth_token => access_token,
:endpoint => @config[:endpoint],
:site => @config[:site],
:ssl => @config[:verify_ssl],
:ssl => {
:verify => @config[:verify_ssl]
},
:user_agent => USER_AGENT,
:auto_pagination => true
)

View File

@@ -116,8 +116,8 @@ describe Gitrob::CLI do
expect(subject.name).to eq("access_tokens")
end
it "has a type of array" do
expect(subject.type).to eq(:array)
it "has a type of string" do
expect(subject.type).to eq(:string)
end
it "is optional" do
@@ -130,7 +130,7 @@ describe Gitrob::CLI do
it "has a description" do
expect(subject.description)
.to eq("GitHub API tokens to use " \
.to eq("Comma-separated list of GitHub API tokens to use " \
"instead of what has been configured")
end

View File

@@ -5,7 +5,7 @@ describe Gitrob::Github::ClientManager do
{
:endpoint => "https://api.example.com",
:site => "https://example.com",
:verify_ssl => true,
:verify_ssl => false,
:access_tokens => %w(
deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
deadbabedeadbabedeadbabedeadbabedeadbabe
@@ -51,8 +51,8 @@ describe Gitrob::Github::ClientManager do
it "has SSL verification option given in configuration" do
subject.each do |client|
expect(client.ssl)
.to be true
expect(client.ssl[:verify])
.to be false
end
end