From 2ce32baf54348ab926811f91bb6cddcdbc7829dd Mon Sep 17 00:00:00 2001 From: Eric O'Connell Date: Sun, 6 Oct 2013 10:05:57 -0700 Subject: [PATCH] rename values to items --- README.md | 2 +- src/config.coffee | 4 ++-- test/config.test.coffee | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2404ce2..222743e 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ The callback receives `(err, actor)`. The callback receives `(err, date)`. ## Config -### `Config#values` +### `Config#items` `Object` - The keys are dotted precisely as the console output from `git config`. E.g., `{'user.name': 'John Doe'}` ## Status diff --git a/src/config.coffee b/src/config.coffee index e726709..04b5dd6 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -9,9 +9,9 @@ C.Config = class Config # Internal: Parse the config from stdout of a `git config` command parse: (text)-> - @values = {} + @items = {} for line in text.split("\n") if line.length == 0 continue [key, value] = line.split('=') - @values[key] = value + @items[key] = value diff --git a/test/config.test.coffee b/test/config.test.coffee index f67f198..0c9c647 100644 --- a/test/config.test.coffee +++ b/test/config.test.coffee @@ -22,15 +22,15 @@ describe "Config", -> config.parse GIT_CONFIG it "read the keys and values", -> - config.values['user.name'].should.equal 'John Doe' - config.values['user.email'].should.equal 'john.doe@git-scm.com' - config.values['core.editor'].should.equal 'pico' + config.items['user.name'].should.equal 'John Doe' + config.items['user.email'].should.equal 'john.doe@git-scm.com' + config.items['core.editor'].should.equal 'pico' describe "with overlapping keys", -> config = new Config.Config 'mock repo' config.parse GIT_CONFIG_DUPLICATE_KEYS it "read the keys and values", -> - config.values['user.name'].should.equal 'John Doe' - config.values['user.email'].should.equal 'john.doe@github.com' - config.values['core.editor'].should.equal 'emacs' + config.items['user.name'].should.equal 'John Doe' + config.items['user.email'].should.equal 'john.doe@github.com' + config.items['core.editor'].should.equal 'emacs'