GitHub PullRequestReviewCommentEvent at 2014-06-30 01:06:13
Repository: cargo
Actor: alexcrichton
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/14333181","id":14333181,"diff_hunk":"@@ -0,0 +1,87 @@\n+#![crate_id=\"cargo-init\"]\n+#![feature(phase)]\n+\n+use std::io;\n+use std::os;\n+\n+/// Checks the existance of a file with a given extension.\n+fn already_exists(items: Vec<Path>, quer: &str) -> bool {\n+    items.iter().any(|nms: &Path| -> (bool) {\n+        let extStr = nms.extension_str();\n+        match extStr{\n+            Some(a) => a == quer,\n+            None => false\n+        }\n+    })\n+}\n+\n+/// Prompts the user for command-line input, with a default response.\n+fn ask_default(query: String, default: String) -> String {\n+    print!(\"{}\", query);\n+    let result = io::stdin().read_line().unwrap().to_str();\n+    if result == \"\\n\".to_str() {\n+        default.clone()\n+    }\n+    else {\n+        result.as_slice().slice(0,result.len()-1).to_str().clone()        \n+    }\n+}\n+\n+/// Initalize a Cargo build.\n+fn execute(){\n+    let osArgs = os::args();\n+    let mut args = osArgs.slice(1, osArgs.len()).iter().map(|x| x.as_slice()); // Drop program name\n+\n+    let cwd_contents = io::fs::readdir(&os::getcwd()).unwrap();","path":"src/bin/cargo-init.rs","position":35,"original_position":35,"commit_id":"87b498c56d6280345c717ddf9ebb08416cd37467","original_commit_id":"87b498c56d6280345c717ddf9ebb08416cd37467","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?","gravatar_id":"477e2098d9864b482d28e5ef8e657f43","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"body":"This needs to use the existing infrastructure for the `main` function to avoid all of the calls to `unwrap()`. Instead, `try!` should be used to handle propagation of errors.","created_at":"2014-06-30T01:06:13Z","updated_at":"2014-06-30T01:06:13Z","html_url":"https://github.com/rust-lang/cargo/pull/93#discussion_r14333181","pull_request_url":"https://api.github.com/repos/rust-lang/cargo/pulls/93","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/14333181"},"html":{"href":"https://github.com/rust-lang/cargo/pull/93#discussion_r14333181"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/93","id":17750482,"html_url":"https://github.com/rust-lang/cargo/pull/93","diff_url":"https://github.com/rust-lang/cargo/pull/93.diff","patch_url":"https://github.com/rust-lang/cargo/pull/93.patch","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/93","number":93,"state":"open","title":"Add cargo-init, a cabal-like template generator","user":{"login":"natepisarski","id":5361699,"avatar_url":"https://avatars.githubusercontent.com/u/5361699?","gravatar_id":"8cc491fd79674b657dcf5fc4a14ccf6d","url":"https://api.github.com/users/natepisarski","html_url":"https://github.com/natepisarski","followers_url":"https://api.github.com/users/natepisarski/followers","following_url":"https://api.github.com/users/natepisarski/following{/other_user}","gists_url":"https://api.github.com/users/natepisarski/gists{/gist_id}","starred_url":"https://api.github.com/users/natepisarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natepisarski/subscriptions","organizations_url":"https://api.github.com/users/natepisarski/orgs","repos_url":"https://api.github.com/users/natepisarski/repos","events_url":"https://api.github.com/users/natepisarski/events{/privacy}","received_events_url":"https://api.github.com/users/natepisarski/received_events","type":"User","site_admin":false},"body":"This independent module  initializes cargo repositories, much alike the functionality of \"cabal init\" for Haskell, or \"dub init\" for D. It allows the user to provide a name and license for their project, and have an instantly-buildable cargo package structure built for them.\r\n\r\ncargo-init works both interactively and via command-line arguments.","created_at":"2014-06-29T20:32:58Z","updated_at":"2014-06-30T01:06:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"922be87775b8d722d533a1f472cbdcdc07a0e6c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/cargo/pulls/93/commits","review_comments_url":"https://api.github.com/repos/rust-lang/cargo/pulls/93/comments","review_comment_url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/93/comments","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/87b498c56d6280345c717ddf9ebb08416cd37467","head":{"label":"natepisarski:master","ref":"master","sha":"87b498c56d6280345c717ddf9ebb08416cd37467","user":{"login":"natepisarski","id":5361699,"avatar_url":"https://avatars.githubusercontent.com/u/5361699?","gravatar_id":"8cc491fd79674b657dcf5fc4a14ccf6d","url":"https://api.github.com/users/natepisarski","html_url":"https://github.com/natepisarski","followers_url":"https://api.github.com/users/natepisarski/followers","following_url":"https://api.github.com/users/natepisarski/following{/other_user}","gists_url":"https://api.github.com/users/natepisarski/gists{/gist_id}","starred_url":"https://api.github.com/users/natepisarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natepisarski/subscriptions","organizations_url":"https://api.github.com/users/natepisarski/orgs","repos_url":"https://api.github.com/users/natepisarski/repos","events_url":"https://api.github.com/users/natepisarski/events{/privacy}","received_events_url":"https://api.github.com/users/natepisarski/received_events","type":"User","site_admin":false},"repo":{"id":21331504,"name":"cargo","full_name":"natepisarski/cargo","owner":{"login":"natepisarski","id":5361699,"avatar_url":"https://avatars.githubusercontent.com/u/5361699?","gravatar_id":"8cc491fd79674b657dcf5fc4a14ccf6d","url":"https://api.github.com/users/natepisarski","html_url":"https://github.com/natepisarski","followers_url":"https://api.github.com/users/natepisarski/followers","following_url":"https://api.github.com/users/natepisarski/following{/other_user}","gists_url":"https://api.github.com/users/natepisarski/gists{/gist_id}","starred_url":"https://api.github.com/users/natepisarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natepisarski/subscriptions","organizations_url":"https://api.github.com/users/natepisarski/orgs","repos_url":"https://api.github.com/users/natepisarski/repos","events_url":"https://api.github.com/users/natepisarski/events{/privacy}","received_events_url":"https://api.github.com/users/natepisarski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/natepisarski/cargo","description":"The Rust package manager","fork":true,"url":"https://api.github.com/repos/natepisarski/cargo","forks_url":"https://api.github.com/repos/natepisarski/cargo/forks","keys_url":"https://api.github.com/repos/natepisarski/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natepisarski/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natepisarski/cargo/teams","hooks_url":"https://api.github.com/repos/natepisarski/cargo/hooks","issue_events_url":"https://api.github.com/repos/natepisarski/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/natepisarski/cargo/events","assignees_url":"https://api.github.com/repos/natepisarski/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/natepisarski/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/natepisarski/cargo/tags","blobs_url":"https://api.github.com/repos/natepisarski/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natepisarski/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natepisarski/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/natepisarski/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natepisarski/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/natepisarski/cargo/languages","stargazers_url":"https://api.github.com/repos/natepisarski/cargo/stargazers","contributors_url":"https://api.github.com/repos/natepisarski/cargo/contributors","subscribers_url":"https://api.github.com/repos/natepisarski/cargo/subscribers","subscription_url":"https://api.github.com/repos/natepisarski/cargo/subscription","commits_url":"https://api.github.com/repos/natepisarski/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/natepisarski/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/natepisarski/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/natepisarski/cargo/issues/comments/{number}","contents_url":"https://api.github.com/repos/natepisarski/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/natepisarski/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natepisarski/cargo/merges","archive_url":"https://api.github.com/repos/natepisarski/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natepisarski/cargo/downloads","issues_url":"https://api.github.com/repos/natepisarski/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/natepisarski/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/natepisarski/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/natepisarski/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natepisarski/cargo/labels{/name}","releases_url":"https://api.github.com/repos/natepisarski/cargo/releases{/id}","created_at":"2014-06-29T20:20:55Z","updated_at":"2014-06-29T11:43:51Z","pushed_at":"2014-06-30T00:53:05Z","git_url":"git://github.com/natepisarski/cargo.git","ssh_url":"git@github.com:natepisarski/cargo.git","clone_url":"https://github.com/natepisarski/cargo.git","svn_url":"https://github.com/natepisarski/cargo","homepage":"http://crates.io/","size":10208,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"2e274ebf4d54a175271c38f658cf629063c66933","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?","gravatar_id":"a4268b59e433144466a0f67cbcfd8cdc","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17420913,"name":"cargo","full_name":"rust-lang/cargo","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?","gravatar_id":"a4268b59e433144466a0f67cbcfd8cdc","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/cargo","description":"The Rust package manager","fork":false,"url":"https://api.github.com/repos/rust-lang/cargo","forks_url":"https://api.github.com/repos/rust-lang/cargo/forks","keys_url":"https://api.github.com/repos/rust-lang/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/cargo/teams","hooks_url":"https://api.github.com/repos/rust-lang/cargo/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/cargo/events","assignees_url":"https://api.github.com/repos/rust-lang/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/cargo/tags","blobs_url":"https://api.github.com/repos/rust-lang/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/cargo/languages","stargazers_url":"https://api.github.com/repos/rust-lang/cargo/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/cargo/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/cargo/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/cargo/subscription","commits_url":"https://api.github.com/repos/rust-lang/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/{number}","contents_url":"https://api.github.com/repos/rust-lang/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/cargo/merges","archive_url":"https://api.github.com/repos/rust-lang/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/cargo/downloads","issues_url":"https://api.github.com/repos/rust-lang/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/cargo/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/cargo/releases{/id}","created_at":"2014-03-04T23:20:42Z","updated_at":"2014-06-29T20:48:52Z","pushed_at":"2014-06-30T00:13:08Z","git_url":"git://github.com/rust-lang/cargo.git","ssh_url":"git@github.com:rust-lang/cargo.git","clone_url":"https://github.com/rust-lang/cargo.git","svn_url":"https://github.com/rust-lang/cargo","homepage":"http://crates.io/","size":10208,"stargazers_count":245,"watchers_count":245,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":34,"mirror_url":null,"open_issues_count":28,"forks":34,"open_issues":28,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/93"},"html":{"href":"https://github.com/rust-lang/cargo/pull/93"},"issue":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/93"},"comments":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/cargo/statuses/87b498c56d6280345c717ddf9ebb08416cd37467"}}}}