Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rbtr/github-stats into ne…
Browse files Browse the repository at this point in the history
…w-version
  • Loading branch information
IonicaBizau committed Oct 29, 2017
2 parents 0e47ba0 + 832ecdf commit 038d4c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bin/github-stats
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var userOption = new Clp.Option(["u", "user"], "The GitHub user to get stats abo
, calOption = new Clp.Option(["c", "calendar"], "Show the calendar.")
, userStatsOption = new Clp.Option(["us", "user-stats"], "Display user stats.")
, repoStatsOption = new Clp.Option(["rs", "repo-stats"], "Display repository stats.")
, altHostOption = new Clp.Option(["ah", "alt-host"], "Alternate Github host.", "host")
, parser = new Clp({
name: "GitHub Stats"
, version: Package.version
Expand All @@ -24,13 +25,13 @@ var userOption = new Clp.Option(["u", "user"], "The GitHub user to get stats abo
, examples: [
"gh-stats -u IonicaBizau -r gh-stats --us --rs -c # Show everything"
, "gh-stats -u IonicaBizau # Show the calendar"
, "gh-stats -r IonicaBizau/git-stats # Repository stats"
, "gh-stats -r IonicaBizau/git-stats --alt-host https://github.myhost.com/api/v3/ # Repository stats from hosted Github"
]
, docs_url: "https://github.com/IonicaBizau/gh-stats"
}, [
userOption, repoOption, noAnsiOption
, lightOption, calOption, userStatsOption
, repoStatsOption, tokenOption
, repoStatsOption, altHostOption, tokenOption
])
, stats = null
;
Expand All @@ -55,6 +56,7 @@ stats = new GitHubStats({
, s_user: userStatsOption.is_provided
, cal: calOption.is_provided
, token: tokenOption.value
, host: altHostOption.value
});


Expand Down
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function GitHubStats(options) {
;

this.theme = options.theme;
this.host = options.host;

this.repo = options.repo;
this.user = options.user;
if (this.repo || this.user) {
Expand Down Expand Up @@ -78,7 +80,7 @@ GitHubStats.prototype.fromUser = function (callback) {
callback(new Error("User is missing."));
return self;
}
var stats = new GitHubPolyglot(self.user, self.token);
var stats = new GitHubPolyglot(self.user, self.token, self.host);
stats.userStats(callback);
return self;
};
Expand All @@ -104,7 +106,7 @@ GitHubStats.prototype.fromRepo = function (callback) {
return self;
}

var stats = new GitHubPolyglot([self.user, self.repo].join("/"), self.token);
var stats = new GitHubPolyglot([self.user, self.repo].join("/"), self.token, self.host);
stats.repoStats(callback);
return self;
};
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"calendar"
],
"author": "Ionică Bizău <[email protected]> (https://ionicabizau.net)",
"contributors": [
"Evan Baker (github.com/rbtr)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/IonicaBizau/github-stats/issues"
Expand Down

0 comments on commit 038d4c2

Please sign in to comment.