Added the defaults in the library.

This commit is contained in:
Ionică Bizău 2015-08-03 07:40:00 +03:00
parent 5caa387ca3
commit f6399c77a3
2 changed files with 34 additions and 28 deletions

View file

@ -1,7 +1,8 @@
#!/usr/bin/env node
// Dependencies
var GitStats = new (require("../lib"))()
var GitStatsLib = require("../lib")
, GitStats = new GitStatsLib()
, Ul = require("ul")
, Moment = require("moment")
, Logger = require("bug-killer")
@ -13,33 +14,8 @@ var GitStats = new (require("../lib"))()
;
// Constants
const CONFIG_PATH = Abs("~/.git-stats-config.json")
, DEFAULT_CONFIG = {
// Dark theme by default
theme: "DARK"
// This defaults in library
, path: undefined
// This defaults in cli-gh-cal
, first_day: undefined
// This defaults to *one year ago*
, since: undefined
// This defaults to *now*
, until: undefined
// This defaults to "DARK" -- this can be a
// string or an object
, theme: undefined
// Don't show authors by default
, authors: false
// No global activity by default
, global_activity: false
}
const CONFIG_PATH = GitStatsLib.CONFIG_PATH
, DEFAULT_CONFIG = GitStatsLib.DEFAULT_CONFIG
;
// Configurations

View file

@ -22,6 +22,7 @@ const DATE_FORMAT = "MMM D, YYYY"
, DEFAULT_DATA = {
commits: {}
}
, CONFIG_PATH = Abs("~/.git-stats-config.json")
;
/**
@ -36,6 +37,35 @@ function GitStats(dataPath) {
this.path = Abs(Deffy(dataPath, DEFAULT_STORE));
}
// Defaults
GitStats.CONFIG_PATH = CONFIG_PATH
GitStats.DEFAULT_CONFIG = {
// Dark theme by default
theme: "DARK"
// This defaults in library
, path: undefined
// This defaults in cli-gh-cal
, first_day: undefined
// This defaults to *one year ago*
, since: undefined
// This defaults to *now*
, until: undefined
// This defaults to "DARK" -- this can be a
// string or an object
, theme: undefined
// Don't show authors by default
, authors: false
// No global activity by default
, global_activity: false
};
/**
* record
* Records a new commit.