GitHub PullRequestEvent at 2014-11-14 01:56:02
Repository: node-config
Actor: markstos
Payload: {"action":"opened","number":164,"pull_request":{"url":"https://api.github.com/repos/lorenwest/node-config/pulls/164","id":24415934,"html_url":"https://github.com/lorenwest/node-config/pull/164","diff_url":"https://github.com/lorenwest/node-config/pull/164.diff","patch_url":"https://github.com/lorenwest/node-config/pull/164.patch","issue_url":"https://api.github.com/repos/lorenwest/node-config/issues/164","number":164,"state":"open","locked":false,"title":"Add support for defered configuration values.","user":{"login":"markstos","id":25829,"avatar_url":"https://avatars.githubusercontent.com/u/25829?v=3","gravatar_id":"","url":"https://api.github.com/users/markstos","html_url":"https://github.com/markstos","followers_url":"https://api.github.com/users/markstos/followers","following_url":"https://api.github.com/users/markstos/following{/other_user}","gists_url":"https://api.github.com/users/markstos/gists{/gist_id}","starred_url":"https://api.github.com/users/markstos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstos/subscriptions","organizations_url":"https://api.github.com/users/markstos/orgs","repos_url":"https://api.github.com/users/markstos/repos","events_url":"https://api.github.com/users/markstos/events{/privacy}","received_events_url":"https://api.github.com/users/markstos/received_events","type":"User","site_admin":false},"body":"As seen in the included tests, a new feature is added to allow you declare a\nconfiguration value as a special kind of function in .js files.\n\nThis is useful to create default configuration values based on other \nconfiguration values when other further configuration files may override the\nvalues being referenced.\n\nYou can think of this as allowing you declare \"templates\" which contain \nvariables referencing other config values in the configuration file, which are\nthen \"rendered\" with the correct values once all the config files have been\nloaded in merged.\n\nOne test shows that the addition is backwards compatible with config files\nthat have been using functions as values. Only functions which are instance of\nthe newly provided DeferredConfig class are handled specially.\n\nFor example use see:\n\n        test/3-deferred-configs.js\n       test/config/default-defer.js\n       test/config/local-defer.js\n\n---\n\nI looked for other names to avoid the name 'defer' and 'deferred', since 'deferred' is used\nby some promise library. Finding nothing that better conveyed what this feature does, I settled\non the name 'deferConfig', which will not conflict with promise libraries name of 'defer' or 'deferred'.\nHowever, people can alias the name to simply 'defer()' in their config files upon import if they\nprefer the shorter name.\n\n---\n\nNote also the use of module un-loading / reloading in the new test file.\n\nI found adding tests to the \"2\" test file to be challenging because it references\nso many configuration files and values with a complex cascading relationship.\n\nBy using the unload/reload pattern, I was able to a small isolated test that is\neasy to review and maintain without intefering with the existing battery of\ntests.","created_at":"2014-11-14T01:56:01Z","updated_at":"2014-11-14T01:56:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d39b1161b081d29008d7b657e67969b1d9c35f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lorenwest/node-config/pulls/164/commits","review_comments_url":"https://api.github.com/repos/lorenwest/node-config/pulls/164/comments","review_comment_url":"https://api.github.com/repos/lorenwest/node-config/pulls/comments/{number}","comments_url":"https://api.github.com/repos/lorenwest/node-config/issues/164/comments","statuses_url":"https://api.github.com/repos/lorenwest/node-config/statuses/a6aac3a5d64f6fffd9896090731d38f0fccca02f","head":{"label":"markstos:deferConfig","ref":"deferConfig","sha":"a6aac3a5d64f6fffd9896090731d38f0fccca02f","user":{"login":"markstos","id":25829,"avatar_url":"https://avatars.githubusercontent.com/u/25829?v=3","gravatar_id":"","url":"https://api.github.com/users/markstos","html_url":"https://github.com/markstos","followers_url":"https://api.github.com/users/markstos/followers","following_url":"https://api.github.com/users/markstos/following{/other_user}","gists_url":"https://api.github.com/users/markstos/gists{/gist_id}","starred_url":"https://api.github.com/users/markstos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstos/subscriptions","organizations_url":"https://api.github.com/users/markstos/orgs","repos_url":"https://api.github.com/users/markstos/repos","events_url":"https://api.github.com/users/markstos/events{/privacy}","received_events_url":"https://api.github.com/users/markstos/received_events","type":"User","site_admin":false},"repo":{"id":21167534,"name":"node-config","full_name":"markstos/node-config","owner":{"login":"markstos","id":25829,"avatar_url":"https://avatars.githubusercontent.com/u/25829?v=3","gravatar_id":"","url":"https://api.github.com/users/markstos","html_url":"https://github.com/markstos","followers_url":"https://api.github.com/users/markstos/followers","following_url":"https://api.github.com/users/markstos/following{/other_user}","gists_url":"https://api.github.com/users/markstos/gists{/gist_id}","starred_url":"https://api.github.com/users/markstos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstos/subscriptions","organizations_url":"https://api.github.com/users/markstos/orgs","repos_url":"https://api.github.com/users/markstos/repos","events_url":"https://api.github.com/users/markstos/events{/privacy}","received_events_url":"https://api.github.com/users/markstos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markstos/node-config","description":"Node.js Application Configuration","fork":true,"url":"https://api.github.com/repos/markstos/node-config","forks_url":"https://api.github.com/repos/markstos/node-config/forks","keys_url":"https://api.github.com/repos/markstos/node-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markstos/node-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markstos/node-config/teams","hooks_url":"https://api.github.com/repos/markstos/node-config/hooks","issue_events_url":"https://api.github.com/repos/markstos/node-config/issues/events{/number}","events_url":"https://api.github.com/repos/markstos/node-config/events","assignees_url":"https://api.github.com/repos/markstos/node-config/assignees{/user}","branches_url":"https://api.github.com/repos/markstos/node-config/branches{/branch}","tags_url":"https://api.github.com/repos/markstos/node-config/tags","blobs_url":"https://api.github.com/repos/markstos/node-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markstos/node-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markstos/node-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/markstos/node-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markstos/node-config/statuses/{sha}","languages_url":"https://api.github.com/repos/markstos/node-config/languages","stargazers_url":"https://api.github.com/repos/markstos/node-config/stargazers","contributors_url":"https://api.github.com/repos/markstos/node-config/contributors","subscribers_url":"https://api.github.com/repos/markstos/node-config/subscribers","subscription_url":"https://api.github.com/repos/markstos/node-config/subscription","commits_url":"https://api.github.com/repos/markstos/node-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/markstos/node-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/markstos/node-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/markstos/node-config/issues/comments/{number}","contents_url":"https://api.github.com/repos/markstos/node-config/contents/{+path}","compare_url":"https://api.github.com/repos/markstos/node-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markstos/node-config/merges","archive_url":"https://api.github.com/repos/markstos/node-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markstos/node-config/downloads","issues_url":"https://api.github.com/repos/markstos/node-config/issues{/number}","pulls_url":"https://api.github.com/repos/markstos/node-config/pulls{/number}","milestones_url":"https://api.github.com/repos/markstos/node-config/milestones{/number}","notifications_url":"https://api.github.com/repos/markstos/node-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markstos/node-config/labels{/name}","releases_url":"https://api.github.com/repos/markstos/node-config/releases{/id}","created_at":"2014-06-24T14:21:25Z","updated_at":"2014-06-24T14:21:26Z","pushed_at":"2014-11-14T01:51:48Z","git_url":"git://github.com/markstos/node-config.git","ssh_url":"git@github.com:markstos/node-config.git","clone_url":"https://github.com/markstos/node-config.git","svn_url":"https://github.com/markstos/node-config","homepage":"","size":2049,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lorenwest:master","ref":"master","sha":"c65e1b464834bcd79a711de6422bdd2f7dd427ed","user":{"login":"lorenwest","id":373538,"avatar_url":"https://avatars.githubusercontent.com/u/373538?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenwest","html_url":"https://github.com/lorenwest","followers_url":"https://api.github.com/users/lorenwest/followers","following_url":"https://api.github.com/users/lorenwest/following{/other_user}","gists_url":"https://api.github.com/users/lorenwest/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenwest/subscriptions","organizations_url":"https://api.github.com/users/lorenwest/orgs","repos_url":"https://api.github.com/users/lorenwest/repos","events_url":"https://api.github.com/users/lorenwest/events{/privacy}","received_events_url":"https://api.github.com/users/lorenwest/received_events","type":"User","site_admin":false},"repo":{"id":1130565,"name":"node-config","full_name":"lorenwest/node-config","owner":{"login":"lorenwest","id":373538,"avatar_url":"https://avatars.githubusercontent.com/u/373538?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenwest","html_url":"https://github.com/lorenwest","followers_url":"https://api.github.com/users/lorenwest/followers","following_url":"https://api.github.com/users/lorenwest/following{/other_user}","gists_url":"https://api.github.com/users/lorenwest/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenwest/subscriptions","organizations_url":"https://api.github.com/users/lorenwest/orgs","repos_url":"https://api.github.com/users/lorenwest/repos","events_url":"https://api.github.com/users/lorenwest/events{/privacy}","received_events_url":"https://api.github.com/users/lorenwest/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lorenwest/node-config","description":"Node.js Application Configuration","fork":false,"url":"https://api.github.com/repos/lorenwest/node-config","forks_url":"https://api.github.com/repos/lorenwest/node-config/forks","keys_url":"https://api.github.com/repos/lorenwest/node-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lorenwest/node-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lorenwest/node-config/teams","hooks_url":"https://api.github.com/repos/lorenwest/node-config/hooks","issue_events_url":"https://api.github.com/repos/lorenwest/node-config/issues/events{/number}","events_url":"https://api.github.com/repos/lorenwest/node-config/events","assignees_url":"https://api.github.com/repos/lorenwest/node-config/assignees{/user}","branches_url":"https://api.github.com/repos/lorenwest/node-config/branches{/branch}","tags_url":"https://api.github.com/repos/lorenwest/node-config/tags","blobs_url":"https://api.github.com/repos/lorenwest/node-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lorenwest/node-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lorenwest/node-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/lorenwest/node-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lorenwest/node-config/statuses/{sha}","languages_url":"https://api.github.com/repos/lorenwest/node-config/languages","stargazers_url":"https://api.github.com/repos/lorenwest/node-config/stargazers","contributors_url":"https://api.github.com/repos/lorenwest/node-config/contributors","subscribers_url":"https://api.github.com/repos/lorenwest/node-config/subscribers","subscription_url":"https://api.github.com/repos/lorenwest/node-config/subscription","commits_url":"https://api.github.com/repos/lorenwest/node-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/lorenwest/node-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/lorenwest/node-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/lorenwest/node-config/issues/comments/{number}","contents_url":"https://api.github.com/repos/lorenwest/node-config/contents/{+path}","compare_url":"https://api.github.com/repos/lorenwest/node-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lorenwest/node-config/merges","archive_url":"https://api.github.com/repos/lorenwest/node-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lorenwest/node-config/downloads","issues_url":"https://api.github.com/repos/lorenwest/node-config/issues{/number}","pulls_url":"https://api.github.com/repos/lorenwest/node-config/pulls{/number}","milestones_url":"https://api.github.com/repos/lorenwest/node-config/milestones{/number}","notifications_url":"https://api.github.com/repos/lorenwest/node-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lorenwest/node-config/labels{/name}","releases_url":"https://api.github.com/repos/lorenwest/node-config/releases{/id}","created_at":"2010-12-02T00:33:11Z","updated_at":"2014-11-13T15:30:13Z","pushed_at":"2014-11-13T17:16:31Z","git_url":"git://github.com/lorenwest/node-config.git","ssh_url":"git@github.com:lorenwest/node-config.git","clone_url":"https://github.com/lorenwest/node-config.git","svn_url":"https://github.com/lorenwest/node-config","homepage":"","size":5599,"stargazers_count":528,"watchers_count":528,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":69,"mirror_url":null,"open_issues_count":7,"forks":69,"open_issues":7,"watchers":528,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lorenwest/node-config/pulls/164"},"html":{"href":"https://github.com/lorenwest/node-config/pull/164"},"issue":{"href":"https://api.github.com/repos/lorenwest/node-config/issues/164"},"comments":{"href":"https://api.github.com/repos/lorenwest/node-config/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/lorenwest/node-config/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/lorenwest/node-config/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/lorenwest/node-config/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/lorenwest/node-config/statuses/a6aac3a5d64f6fffd9896090731d38f0fccca02f"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":124,"deletions":0,"changed_files":5}}