{"action":"created","comment":{"url":"https://api.github.com/repos/jozefizso/generator-license/pulls/comments/29553914","id":29553914,"diff_hunk":"@@ -1,81 +1,112 @@\n 'use strict';\n-var ini = require('ini');\n-var util = require('util');\n-var path = require('path');\n-var yeoman = require('yeoman-generator');\n+var _ = require('lodash');\n+var generators = require('yeoman-generator');\n+var gitConfig = require('git-config');\n \n+module.exports = generators.Base.extend({\n+  constructor: function () {\n+    generators.Base.apply(this, arguments);\n \n-var LicenseGenerator = module.exports = function LicenseGenerator(args, options, config) {\n-  yeoman.generators.Base.apply(this, arguments);\n+    this.option('name', {\n+      description: 'Name of the license owner',\n+      required: false\n+    });\n \n-  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));\n+    this.option('email', {\n+      description: 'Email of the license owner',\n+      required: false\n+    });\n \n-  try {\n-    // fs.exists is being deprecated\n-    this.gitc = ini.parse(this.readFileAsString(path.join(this.getUserHome(), '.gitconfig')));\n-  } catch (e) {\n-    this.gitc = {};\n-  }\n-  this.gitc.user = this.gitc.user || {};\n-};\n+    this.option('website', {\n+      description: 'Website of the license owner',\n+      required: false\n+    });\n+  },\n+\n+  initializing: function () {\n+    this.gitc = gitConfig.sync();\n+    this.gitc.user = this.gitc.user || {};\n+  },\n+\n+  prompting: function () {\n+    var done = this.async();\n \n-util.inherits(LicenseGenerator, yeoman.generators.Base);\n+    var choices = [\n+      { name: 'Apache 2.0', value: 'Apache-2.0' },\n+      { name: 'MIT', value: 'MIT' },\n+      { name: 'Unlicense', value: 'Unlicense' },\n+      { name: 'FreeBSD', value: 'BSD-2-Clause-FreeBSD' },\n+      { name: 'NewBSD', value: 'BSD-3-Clause' },\n+      { name: 'Internet Systems Consortium (ISC)', value: 'ISC' },\n+      { name: 'No License (Copyrighted)', value: 'nolicense' }\n+    ];\n \n-LicenseGenerator.prototype.askFor = function askFor() {\n-  var cb = this.async();\n+    var prompts = [\n+        {","path":"app/index.js","position":63,"original_position":63,"commit_id":"c2965632d8634c97c02b8a1c0ca85b017b14da66","original_commit_id":"c2965632d8634c97c02b8a1c0ca85b017b14da66","user":{"login":"arthurvr","id":6025224,"avatar_url":"https://avatars.githubusercontent.com/u/6025224?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurvr","html_url":"https://github.com/arthurvr","followers_url":"https://api.github.com/users/arthurvr/followers","following_url":"https://api.github.com/users/arthurvr/following{/other_user}","gists_url":"https://api.github.com/users/arthurvr/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurvr/subscriptions","organizations_url":"https://api.github.com/users/arthurvr/orgs","repos_url":"https://api.github.com/users/arthurvr/repos","events_url":"https://api.github.com/users/arthurvr/events{/privacy}","received_events_url":"https://api.github.com/users/arthurvr/received_events","type":"User","site_admin":false},"body":"indentation ;)","created_at":"2015-05-03T08:12:50Z","updated_at":"2015-05-03T08:12:50Z","html_url":"https://github.com/jozefizso/generator-license/pull/7#discussion_r29553914","pull_request_url":"https://api.github.com/repos/jozefizso/generator-license/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/comments/29553914"},"html":{"href":"https://github.com/jozefizso/generator-license/pull/7#discussion_r29553914"},"pull_request":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/jozefizso/generator-license/pulls/7","id":34596314,"html_url":"https://github.com/jozefizso/generator-license/pull/7","diff_url":"https://github.com/jozefizso/generator-license/pull/7.diff","patch_url":"https://github.com/jozefizso/generator-license/pull/7.patch","issue_url":"https://api.github.com/repos/jozefizso/generator-license/issues/7","number":7,"state":"open","locked":false,"title":"Update generator to be composable","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":"Hopefully that also greatly simplified the generator code.","created_at":"2015-05-03T04:41:44Z","updated_at":"2015-05-03T08:12:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f491fe03b01bd971a16cca6692ccaadbca6cf4b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jozefizso/generator-license/pulls/7/commits","review_comments_url":"https://api.github.com/repos/jozefizso/generator-license/pulls/7/comments","review_comment_url":"https://api.github.com/repos/jozefizso/generator-license/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jozefizso/generator-license/issues/7/comments","statuses_url":"https://api.github.com/repos/jozefizso/generator-license/statuses/c2965632d8634c97c02b8a1c0ca85b017b14da66","head":{"label":"SBoudrias:master","ref":"master","sha":"c2965632d8634c97c02b8a1c0ca85b017b14da66","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":34973186,"name":"generator-license","full_name":"SBoudrias/generator-license","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/generator-license","description":"Yeoman Generator - License","fork":true,"url":"https://api.github.com/repos/SBoudrias/generator-license","forks_url":"https://api.github.com/repos/SBoudrias/generator-license/forks","keys_url":"https://api.github.com/repos/SBoudrias/generator-license/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SBoudrias/generator-license/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SBoudrias/generator-license/teams","hooks_url":"https://api.github.com/repos/SBoudrias/generator-license/hooks","issue_events_url":"https://api.github.com/repos/SBoudrias/generator-license/issues/events{/number}","events_url":"https://api.github.com/repos/SBoudrias/generator-license/events","assignees_url":"https://api.github.com/repos/SBoudrias/generator-license/assignees{/user}","branches_url":"https://api.github.com/repos/SBoudrias/generator-license/branches{/branch}","tags_url":"https://api.github.com/repos/SBoudrias/generator-license/tags","blobs_url":"https://api.github.com/repos/SBoudrias/generator-license/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SBoudrias/generator-license/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SBoudrias/generator-license/git/refs{/sha}","trees_url":"https://api.github.com/repos/SBoudrias/generator-license/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SBoudrias/generator-license/statuses/{sha}","languages_url":"https://api.github.com/repos/SBoudrias/generator-license/languages","stargazers_url":"https://api.github.com/repos/SBoudrias/generator-license/stargazers","contributors_url":"https://api.github.com/repos/SBoudrias/generator-license/contributors","subscribers_url":"https://api.github.com/repos/SBoudrias/generator-license/subscribers","subscription_url":"https://api.github.com/repos/SBoudrias/generator-license/subscription","commits_url":"https://api.github.com/repos/SBoudrias/generator-license/commits{/sha}","git_commits_url":"https://api.github.com/repos/SBoudrias/generator-license/git/commits{/sha}","comments_url":"https://api.github.com/repos/SBoudrias/generator-license/comments{/number}","issue_comment_url":"https://api.github.com/repos/SBoudrias/generator-license/issues/comments{/number}","contents_url":"https://api.github.com/repos/SBoudrias/generator-license/contents/{+path}","compare_url":"https://api.github.com/repos/SBoudrias/generator-license/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SBoudrias/generator-license/merges","archive_url":"https://api.github.com/repos/SBoudrias/generator-license/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SBoudrias/generator-license/downloads","issues_url":"https://api.github.com/repos/SBoudrias/generator-license/issues{/number}","pulls_url":"https://api.github.com/repos/SBoudrias/generator-license/pulls{/number}","milestones_url":"https://api.github.com/repos/SBoudrias/generator-license/milestones{/number}","notifications_url":"https://api.github.com/repos/SBoudrias/generator-license/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SBoudrias/generator-license/labels{/name}","releases_url":"https://api.github.com/repos/SBoudrias/generator-license/releases{/id}","created_at":"2015-05-03T04:03:51Z","updated_at":"2015-05-03T05:09:52Z","pushed_at":"2015-05-03T05:09:51Z","git_url":"git://github.com/SBoudrias/generator-license.git","ssh_url":"git@github.com:SBoudrias/generator-license.git","clone_url":"https://github.com/SBoudrias/generator-license.git","svn_url":"https://github.com/SBoudrias/generator-license","homepage":null,"size":238,"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":"jozefizso:master","ref":"master","sha":"e95ef78ebb3ec4d33485afa8774c2dfc3662a5f4","user":{"login":"jozefizso","id":287778,"avatar_url":"https://avatars.githubusercontent.com/u/287778?v=3","gravatar_id":"","url":"https://api.github.com/users/jozefizso","html_url":"https://github.com/jozefizso","followers_url":"https://api.github.com/users/jozefizso/followers","following_url":"https://api.github.com/users/jozefizso/following{/other_user}","gists_url":"https://api.github.com/users/jozefizso/gists{/gist_id}","starred_url":"https://api.github.com/users/jozefizso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jozefizso/subscriptions","organizations_url":"https://api.github.com/users/jozefizso/orgs","repos_url":"https://api.github.com/users/jozefizso/repos","events_url":"https://api.github.com/users/jozefizso/events{/privacy}","received_events_url":"https://api.github.com/users/jozefizso/received_events","type":"User","site_admin":false},"repo":{"id":11428390,"name":"generator-license","full_name":"jozefizso/generator-license","owner":{"login":"jozefizso","id":287778,"avatar_url":"https://avatars.githubusercontent.com/u/287778?v=3","gravatar_id":"","url":"https://api.github.com/users/jozefizso","html_url":"https://github.com/jozefizso","followers_url":"https://api.github.com/users/jozefizso/followers","following_url":"https://api.github.com/users/jozefizso/following{/other_user}","gists_url":"https://api.github.com/users/jozefizso/gists{/gist_id}","starred_url":"https://api.github.com/users/jozefizso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jozefizso/subscriptions","organizations_url":"https://api.github.com/users/jozefizso/orgs","repos_url":"https://api.github.com/users/jozefizso/repos","events_url":"https://api.github.com/users/jozefizso/events{/privacy}","received_events_url":"https://api.github.com/users/jozefizso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jozefizso/generator-license","description":"Yeoman Generator - License","fork":false,"url":"https://api.github.com/repos/jozefizso/generator-license","forks_url":"https://api.github.com/repos/jozefizso/generator-license/forks","keys_url":"https://api.github.com/repos/jozefizso/generator-license/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jozefizso/generator-license/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jozefizso/generator-license/teams","hooks_url":"https://api.github.com/repos/jozefizso/generator-license/hooks","issue_events_url":"https://api.github.com/repos/jozefizso/generator-license/issues/events{/number}","events_url":"https://api.github.com/repos/jozefizso/generator-license/events","assignees_url":"https://api.github.com/repos/jozefizso/generator-license/assignees{/user}","branches_url":"https://api.github.com/repos/jozefizso/generator-license/branches{/branch}","tags_url":"https://api.github.com/repos/jozefizso/generator-license/tags","blobs_url":"https://api.github.com/repos/jozefizso/generator-license/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jozefizso/generator-license/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jozefizso/generator-license/git/refs{/sha}","trees_url":"https://api.github.com/repos/jozefizso/generator-license/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jozefizso/generator-license/statuses/{sha}","languages_url":"https://api.github.com/repos/jozefizso/generator-license/languages","stargazers_url":"https://api.github.com/repos/jozefizso/generator-license/stargazers","contributors_url":"https://api.github.com/repos/jozefizso/generator-license/contributors","subscribers_url":"https://api.github.com/repos/jozefizso/generator-license/subscribers","subscription_url":"https://api.github.com/repos/jozefizso/generator-license/subscription","commits_url":"https://api.github.com/repos/jozefizso/generator-license/commits{/sha}","git_commits_url":"https://api.github.com/repos/jozefizso/generator-license/git/commits{/sha}","comments_url":"https://api.github.com/repos/jozefizso/generator-license/comments{/number}","issue_comment_url":"https://api.github.com/repos/jozefizso/generator-license/issues/comments{/number}","contents_url":"https://api.github.com/repos/jozefizso/generator-license/contents/{+path}","compare_url":"https://api.github.com/repos/jozefizso/generator-license/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jozefizso/generator-license/merges","archive_url":"https://api.github.com/repos/jozefizso/generator-license/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jozefizso/generator-license/downloads","issues_url":"https://api.github.com/repos/jozefizso/generator-license/issues{/number}","pulls_url":"https://api.github.com/repos/jozefizso/generator-license/pulls{/number}","milestones_url":"https://api.github.com/repos/jozefizso/generator-license/milestones{/number}","notifications_url":"https://api.github.com/repos/jozefizso/generator-license/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jozefizso/generator-license/labels{/name}","releases_url":"https://api.github.com/repos/jozefizso/generator-license/releases{/id}","created_at":"2013-07-15T16:54:33Z","updated_at":"2015-04-29T08:49:51Z","pushed_at":"2015-05-03T05:09:52Z","git_url":"git://github.com/jozefizso/generator-license.git","ssh_url":"git@github.com:jozefizso/generator-license.git","clone_url":"https://github.com/jozefizso/generator-license.git","svn_url":"https://github.com/jozefizso/generator-license","homepage":null,"size":238,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/7"},"html":{"href":"https://github.com/jozefizso/generator-license/pull/7"},"issue":{"href":"https://api.github.com/repos/jozefizso/generator-license/issues/7"},"comments":{"href":"https://api.github.com/repos/jozefizso/generator-license/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jozefizso/generator-license/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/jozefizso/generator-license/statuses/c2965632d8634c97c02b8a1c0ca85b017b14da66"}}}}