GitHub PullRequestReviewCommentEvent at 2014-10-16 13:54:09
Repository: p5-app-duckpan
Actor: moollaza
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/comments/18956097","id":18956097,"diff_hunk":"@@ -19,98 +18,108 @@ use IO::All;\n sub run {\n \tmy ( $self, @args ) = @_;\n \n+\t# Check which IA repo we're in...\n+\tmy $type = \"\";\n+\tif (-d \"./lib/DDG/Goodie\") {\n+\t\t$type = \"Goodie\";\n+\t} elsif (-d \"./lib/DDG/Spice\") {\n+\t\t$type = \"Spice\";\n+\t} elsif (-d \"./lib/DDG/Fathead\") {\n+\t\t$type = \"Fathead\";\n+\t\t$self->app->print_text(\"[ERROR] Sorry, DuckPAN does not support Fatheads yet!\");\n+\t\texit -1;\n+\t} elsif (-d \"./lib/DDG/Longtail\") {\n+\t\t$type = \"Longtail\";\n+\t\t$self->app->print_text(\"[ERROR] Sorry, DuckPAN does not support Longtails yet!\");\n+\t\texit -1;\n+\t} else {\n+\t\t$self->app->print_text(\"[ERROR] No lib/DDG/Goodie, lib/DDG/Spice, lib/DDG/Fathead or lib/DDG/Longtail found\");\n+\t\texit -1;\n+\t}\n+\n \t# Instant Answer name as parameter\n \tmy $entered_name = (@args) ? join(' ', @args) : $self->app->get_reply('Please enter a name for your Instant Answer');\n+\t$entered_name =~ s/\\//::/g; #change \"/\" to \"::\" for easier handling\n \tmy $name = $self->app->phrase_to_camel($entered_name);\n+\tmy ($path, $lc_path) = (\"\", \"\");\n+\tmy $package_name = $name;\n+\tmy $separated_name = $package_name;\n+\t$separated_name =~ s/::/ /g;\n+\n+\tif ($entered_name =~ m/::/) {\n+\t\tmy @path_parts = split(/::/, $entered_name);\n+\t\t$name = pop @path_parts;\n+\t\t$path = join(\"/\", @path_parts);\n+\t\t$lc_path = join(\"/\", map { $self->app->camel_to_underscore($_) } @path_parts);\n+\t}\n+\n \tmy $lc_name = $self->app->camel_to_underscore($name);\n \n \t# %templates forms the spine data structure which is used\n \t# as a guide to discovering content which is moved around\n \tmy %templates = (\n-\t\tgoodie => {\n-\t\t\tlib_dir => \"./lib/DDG/Goodie\",\n+\t\tGoodie => {\n+\t\t\tdirs => [\n+\t\t\t\t\"./lib/DDG/Goodie/$path\",\n+\t\t\t\t\"./t/$path\",","path":"lib/App/DuckPAN/Cmd/New.pm","position":57,"original_position":57,"commit_id":"83aae1d1dfc966adcb60630505099afb1518f53d","original_commit_id":"83aae1d1dfc966adcb60630505099afb1518f53d","user":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=2","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"body":"Whoops! I was so busy testing more complex cases, I forgot to double check the simplest case. I knew there was a reason I didn't do it this way first. Thanks for catching this!","created_at":"2014-10-16T13:54:09Z","updated_at":"2014-10-16T13:54:09Z","html_url":"https://github.com/duckduckgo/p5-app-duckpan/pull/133#discussion_r18956097","pull_request_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/comments/18956097"},"html":{"href":"https://github.com/duckduckgo/p5-app-duckpan/pull/133#discussion_r18956097"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133","id":22828358,"html_url":"https://github.com/duckduckgo/p5-app-duckpan/pull/133","diff_url":"https://github.com/duckduckgo/p5-app-duckpan/pull/133.diff","patch_url":"https://github.com/duckduckgo/p5-app-duckpan/pull/133.patch","issue_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/133","number":133,"state":"closed","locked":false,"title":"duckpan new update","user":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=2","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"body":"- These changes were necessary for the new quick start tutorial to work.\r\n- Now the \"name\" can be a proper package name or filepath (\"MyFirstSpice::Moollaza\", or \"MyFirstSpice/Moollaza\") -- this is important so you can create a new Spice under a new or exists namespace, e.g. `Transit::GoTransit`\r\n- If the directories don't exist, they will be created\r\n- Big code cleanup and de-duplication\r\n - reordered the code, so that if the user is in Longtail or Fathead we stop executing before asking them for input\r\n- Also if you run it in the Fathead or Longtail repo it will gracefully die with an error message explaining they aren't supported\r\n\r\ncc// @mwmiller please prioritize this if possible. If it's OKAY, would like to merge and then I'll make any necessary improvements after. This is needed for the new tutorial. Sorry about the rush!\r\n\r\nWould love to write some tests for this, but I'm not sure about the best approach. I think I'd need to make a temporary directory and then populate it during the tests? Any thoughts on a testing approach would be helpful!\r\n","created_at":"2014-10-16T02:05:59Z","updated_at":"2014-10-16T13:54:09Z","closed_at":"2014-10-16T06:25:03Z","merged_at":"2014-10-16T06:25:03Z","merge_commit_sha":"e03d6f5ae43808a32d034399e26a73bb9fe3bb1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/comments/{number}","comments_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/133/comments","statuses_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/statuses/83aae1d1dfc966adcb60630505099afb1518f53d","head":{"label":"duckduckgo:zaahir/duckpan-new-update","ref":"zaahir/duckpan-new-update","sha":"83aae1d1dfc966adcb60630505099afb1518f53d","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=2","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":3342052,"name":"p5-app-duckpan","full_name":"duckduckgo/p5-app-duckpan","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=2","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/p5-app-duckpan","description":"DuckPAN and DuckDuckGo OpenSource Development Application","fork":false,"url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan","forks_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/forks","keys_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/teams","hooks_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/events","assignees_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/tags","blobs_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/subscription","commits_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/comments/{number}","contents_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/merges","archive_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/downloads","issues_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/releases{/id}","created_at":"2012-02-03T05:50:28Z","updated_at":"2014-09-04T17:28:03Z","pushed_at":"2014-10-16T06:32:16Z","git_url":"git://github.com/duckduckgo/p5-app-duckpan.git","ssh_url":"git@github.com:duckduckgo/p5-app-duckpan.git","clone_url":"https://github.com/duckduckgo/p5-app-duckpan.git","svn_url":"https://github.com/duckduckgo/p5-app-duckpan","homepage":"http://metacpan.org/module/App::DuckPAN","size":3637,"stargazers_count":23,"watchers_count":23,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":19,"forks":22,"open_issues":19,"watchers":23,"default_branch":"master"}},"base":{"label":"duckduckgo:master","ref":"master","sha":"a0cffadcfdc77cfc1bd052aca12e3f0c6d676138","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=2","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":3342052,"name":"p5-app-duckpan","full_name":"duckduckgo/p5-app-duckpan","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=2","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/p5-app-duckpan","description":"DuckPAN and DuckDuckGo OpenSource Development Application","fork":false,"url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan","forks_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/forks","keys_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/teams","hooks_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/events","assignees_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/tags","blobs_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/subscription","commits_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/comments/{number}","contents_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/merges","archive_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/downloads","issues_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/releases{/id}","created_at":"2012-02-03T05:50:28Z","updated_at":"2014-09-04T17:28:03Z","pushed_at":"2014-10-16T06:32:16Z","git_url":"git://github.com/duckduckgo/p5-app-duckpan.git","ssh_url":"git@github.com:duckduckgo/p5-app-duckpan.git","clone_url":"https://github.com/duckduckgo/p5-app-duckpan.git","svn_url":"https://github.com/duckduckgo/p5-app-duckpan","homepage":"http://metacpan.org/module/App::DuckPAN","size":3637,"stargazers_count":23,"watchers_count":23,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":19,"forks":22,"open_issues":19,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133"},"html":{"href":"https://github.com/duckduckgo/p5-app-duckpan/pull/133"},"issue":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/133"},"comments":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/p5-app-duckpan/statuses/83aae1d1dfc966adcb60630505099afb1518f53d"}}}}