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 #!/usr/bin/env node
// Dependencies // Dependencies
var GitStats = new (require("../lib"))() var GitStatsLib = require("../lib")
, GitStats = new GitStatsLib()
, Ul = require("ul") , Ul = require("ul")
, Moment = require("moment") , Moment = require("moment")
, Logger = require("bug-killer") , Logger = require("bug-killer")
@ -13,33 +14,8 @@ var GitStats = new (require("../lib"))()
; ;
// Constants // Constants
const CONFIG_PATH = Abs("~/.git-stats-config.json") const CONFIG_PATH = GitStatsLib.CONFIG_PATH
, DEFAULT_CONFIG = { , DEFAULT_CONFIG = GitStatsLib.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
}
; ;
// Configurations // Configurations

View File

@ -22,6 +22,7 @@ const DATE_FORMAT = "MMM D, YYYY"
, DEFAULT_DATA = { , DEFAULT_DATA = {
commits: {} commits: {}
} }
, CONFIG_PATH = Abs("~/.git-stats-config.json")
; ;
/** /**
@ -36,6 +37,35 @@ function GitStats(dataPath) {
this.path = Abs(Deffy(dataPath, DEFAULT_STORE)); 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 * record
* Records a new commit. * Records a new commit.