{"action":"created","comment":{"url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/comments/52855249","id":52855249,"diff_hunk":"@@ -25,16 +25,27 @@ var GruntfileEditor = module.exports = function (gruntfileContent) {\n  * Insert a configuration section inside the `Gruntfile.js` initConfig() block\n  * @param  {String} name   - Key name of the configuration block\n  * @param  {String} config - Configuration content code as a string.\n+ * @param  {String} options - additional options\n+ *                  {Boolean} keyPath: support child field.\n  * @return {this}\n  */\n \n-GruntfileEditor.prototype.insertConfig = function (name, config) {\n+GruntfileEditor.prototype.insertConfig = function (name, config, options) {\n   name = _.isString(name) && name.trim() || false;\n   config = _.isString(config) && config.trim() || false;\n   assert(name, 'You must provide a task name');\n   assert(config, 'You must provide a task configuration body as a String');\n-  this.gruntfile.callExpression('grunt.initConfig').arguments.at(0)\n-    .key(name).value(config);\n+  var gConfig = this.gruntfile.callExpression('grunt.initConfig').arguments.at(0)\n+  if(options && options.keyPath){\n+    // support set config for compress:src2 when already exists config for compress:src1\n+    name.split('.').forEach(function(k){","path":"index.js","position":20,"original_position":20,"commit_id":"8cbba7b8b3cee2c6cabc737e6a73922c91577f30","original_commit_id":"8cbba7b8b3cee2c6cabc737e6a73922c91577f30","user":{"login":"SBoudrias","id":923865,"avatar_url":"https://avatars.githubusercontent.com/u/923865?v=3","gravatar_id":"","url":"https://api.github.com/users/SBoudrias","html_url":"https://github.com/SBoudrias","followers_url":"https://api.github.com/users/SBoudrias/followers","following_url":"https://api.github.com/users/SBoudrias/following{/other_user}","gists_url":"https://api.github.com/users/SBoudrias/gists{/gist_id}","starred_url":"https://api.github.com/users/SBoudrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SBoudrias/subscriptions","organizations_url":"https://api.github.com/users/SBoudrias/orgs","repos_url":"https://api.github.com/users/SBoudrias/repos","events_url":"https://api.github.com/users/SBoudrias/events{/privacy}","received_events_url":"https://api.github.com/users/SBoudrias/received_events","type":"User","site_admin":false},"body":"Why split on the `.`?","created_at":"2016-02-15T02:43:42Z","updated_at":"2016-02-15T02:43:42Z","html_url":"https://github.com/SBoudrias/gruntfile-editor/pull/39#discussion_r52855249","pull_request_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/comments/52855249"},"html":{"href":"https://github.com/SBoudrias/gruntfile-editor/pull/39#discussion_r52855249"},"pull_request":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39","id":58916162,"html_url":"https://github.com/SBoudrias/gruntfile-editor/pull/39","diff_url":"https://github.com/SBoudrias/gruntfile-editor/pull/39.diff","patch_url":"https://github.com/SBoudrias/gruntfile-editor/pull/39.patch","issue_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/39","number":39,"state":"open","locked":false,"title":"support set sub field config","user":{"login":"qiuzuhui","id":5380790,"avatar_url":"https://avatars.githubusercontent.com/u/5380790?v=3","gravatar_id":"","url":"https://api.github.com/users/qiuzuhui","html_url":"https://github.com/qiuzuhui","followers_url":"https://api.github.com/users/qiuzuhui/followers","following_url":"https://api.github.com/users/qiuzuhui/following{/other_user}","gists_url":"https://api.github.com/users/qiuzuhui/gists{/gist_id}","starred_url":"https://api.github.com/users/qiuzuhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiuzuhui/subscriptions","organizations_url":"https://api.github.com/users/qiuzuhui/orgs","repos_url":"https://api.github.com/users/qiuzuhui/repos","events_url":"https://api.github.com/users/qiuzuhui/events{/privacy}","received_events_url":"https://api.github.com/users/qiuzuhui/received_events","type":"User","site_admin":false},"body":"support case like : add config for compress:src2 when already exists config for compress:src1","created_at":"2016-02-10T16:34:08Z","updated_at":"2016-02-15T02:43:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9054c355458dbb0243d44d33a32014a175255a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39/commits","review_comments_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39/comments","review_comment_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/39/comments","statuses_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/statuses/8cbba7b8b3cee2c6cabc737e6a73922c91577f30","head":{"label":"qiuzuhui:patch-1","ref":"patch-1","sha":"8cbba7b8b3cee2c6cabc737e6a73922c91577f30","user":{"login":"qiuzuhui","id":5380790,"avatar_url":"https://avatars.githubusercontent.com/u/5380790?v=3","gravatar_id":"","url":"https://api.github.com/users/qiuzuhui","html_url":"https://github.com/qiuzuhui","followers_url":"https://api.github.com/users/qiuzuhui/followers","following_url":"https://api.github.com/users/qiuzuhui/following{/other_user}","gists_url":"https://api.github.com/users/qiuzuhui/gists{/gist_id}","starred_url":"https://api.github.com/users/qiuzuhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiuzuhui/subscriptions","organizations_url":"https://api.github.com/users/qiuzuhui/orgs","repos_url":"https://api.github.com/users/qiuzuhui/repos","events_url":"https://api.github.com/users/qiuzuhui/events{/privacy}","received_events_url":"https://api.github.com/users/qiuzuhui/received_events","type":"User","site_admin":false},"repo":{"id":51453941,"name":"gruntfile-editor","full_name":"qiuzuhui/gruntfile-editor","owner":{"login":"qiuzuhui","id":5380790,"avatar_url":"https://avatars.githubusercontent.com/u/5380790?v=3","gravatar_id":"","url":"https://api.github.com/users/qiuzuhui","html_url":"https://github.com/qiuzuhui","followers_url":"https://api.github.com/users/qiuzuhui/followers","following_url":"https://api.github.com/users/qiuzuhui/following{/other_user}","gists_url":"https://api.github.com/users/qiuzuhui/gists{/gist_id}","starred_url":"https://api.github.com/users/qiuzuhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiuzuhui/subscriptions","organizations_url":"https://api.github.com/users/qiuzuhui/orgs","repos_url":"https://api.github.com/users/qiuzuhui/repos","events_url":"https://api.github.com/users/qiuzuhui/events{/privacy}","received_events_url":"https://api.github.com/users/qiuzuhui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qiuzuhui/gruntfile-editor","description":"An API to modify a Gruntfile.js content","fork":true,"url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor","forks_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/forks","keys_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/teams","hooks_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/hooks","issue_events_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/issues/events{/number}","events_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/events","assignees_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/assignees{/user}","branches_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/branches{/branch}","tags_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/tags","blobs_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/languages","stargazers_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/stargazers","contributors_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/contributors","subscribers_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/subscribers","subscription_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/subscription","commits_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/contents/{+path}","compare_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/merges","archive_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/downloads","issues_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/issues{/number}","pulls_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/labels{/name}","releases_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/releases{/id}","deployments_url":"https://api.github.com/repos/qiuzuhui/gruntfile-editor/deployments","created_at":"2016-02-10T16:29:46Z","updated_at":"2016-02-10T16:29:47Z","pushed_at":"2016-02-11T03:52:47Z","git_url":"git://github.com/qiuzuhui/gruntfile-editor.git","ssh_url":"git@github.com:qiuzuhui/gruntfile-editor.git","clone_url":"https://github.com/qiuzuhui/gruntfile-editor.git","svn_url":"https://github.com/qiuzuhui/gruntfile-editor","homepage":null,"size":32,"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":"SBoudrias:master","ref":"master","sha":"4fbc4b5c5545cc8e0376475cfa1692cebc594b47","user":{"login":"SBoudrias","id":923865,"avatar_url":"https://avatars.githubusercontent.com/u/923865?v=3","gravatar_id":"","url":"https://api.github.com/users/SBoudrias","html_url":"https://github.com/SBoudrias","followers_url":"https://api.github.com/users/SBoudrias/followers","following_url":"https://api.github.com/users/SBoudrias/following{/other_user}","gists_url":"https://api.github.com/users/SBoudrias/gists{/gist_id}","starred_url":"https://api.github.com/users/SBoudrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SBoudrias/subscriptions","organizations_url":"https://api.github.com/users/SBoudrias/orgs","repos_url":"https://api.github.com/users/SBoudrias/repos","events_url":"https://api.github.com/users/SBoudrias/events{/privacy}","received_events_url":"https://api.github.com/users/SBoudrias/received_events","type":"User","site_admin":false},"repo":{"id":18503461,"name":"gruntfile-editor","full_name":"SBoudrias/gruntfile-editor","owner":{"login":"SBoudrias","id":923865,"avatar_url":"https://avatars.githubusercontent.com/u/923865?v=3","gravatar_id":"","url":"https://api.github.com/users/SBoudrias","html_url":"https://github.com/SBoudrias","followers_url":"https://api.github.com/users/SBoudrias/followers","following_url":"https://api.github.com/users/SBoudrias/following{/other_user}","gists_url":"https://api.github.com/users/SBoudrias/gists{/gist_id}","starred_url":"https://api.github.com/users/SBoudrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SBoudrias/subscriptions","organizations_url":"https://api.github.com/users/SBoudrias/orgs","repos_url":"https://api.github.com/users/SBoudrias/repos","events_url":"https://api.github.com/users/SBoudrias/events{/privacy}","received_events_url":"https://api.github.com/users/SBoudrias/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SBoudrias/gruntfile-editor","description":"An API to modify a Gruntfile.js content","fork":false,"url":"https://api.github.com/repos/SBoudrias/gruntfile-editor","forks_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/forks","keys_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/teams","hooks_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/hooks","issue_events_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/events{/number}","events_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/events","assignees_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/assignees{/user}","branches_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/branches{/branch}","tags_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/tags","blobs_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/languages","stargazers_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/stargazers","contributors_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/contributors","subscribers_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/subscribers","subscription_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/subscription","commits_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/contents/{+path}","compare_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/merges","archive_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/downloads","issues_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues{/number}","pulls_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/labels{/name}","releases_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/releases{/id}","deployments_url":"https://api.github.com/repos/SBoudrias/gruntfile-editor/deployments","created_at":"2014-04-07T01:21:31Z","updated_at":"2016-02-10T15:42:56Z","pushed_at":"2016-02-11T03:52:47Z","git_url":"git://github.com/SBoudrias/gruntfile-editor.git","ssh_url":"git@github.com:SBoudrias/gruntfile-editor.git","clone_url":"https://github.com/SBoudrias/gruntfile-editor.git","svn_url":"https://github.com/SBoudrias/gruntfile-editor","homepage":null,"size":300,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":13,"forks":9,"open_issues":13,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39"},"html":{"href":"https://github.com/SBoudrias/gruntfile-editor/pull/39"},"issue":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/39"},"comments":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/SBoudrias/gruntfile-editor/statuses/8cbba7b8b3cee2c6cabc737e6a73922c91577f30"}}}}