{"action":"created","comment":{"url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/comments/36791861","id":36791861,"diff_hunk":"@@ -86,6 +86,46 @@ export default Ember.Controller.extend({\n     }\n   },\n \n+  createFile(filePath, fileProperties) {\n+    if (filePath) {\n+      if(this.get('model.files').findBy('filePath', filePath)) {\n+        alert('A file with the name %@ already exists'.fmt(filePath));\n+        return;\n+      }\n+\n+      fileProperties.filePath = filePath;\n+      let file = this.store.createRecord('gistFile', fileProperties);\n+\n+      this.get('model.files').pushObject(file);\n+      this.notify.info('File %@ was added'.fmt(file.get('filePath')));\n+      this.set('col1File', file);\n+      this.set('activeEditorCol', '1');\n+      this.send('contentsChanged');\n+    }\n+  },\n+  /*\n+   *  Test path is valid.  Presently only tests components are hyphenated.\n+   */\n+  hasInvalidPath(type, path){\n+    let errorMsg = null;\n+    if (type === 'component'){\n+      let file = path.split('/').slice(-1)[0];\n+      if (file.indexOf('.') > -1) {\n+        errorMsg = \"What part of WITHOUT FILE EXTENSION did you not understand ;-) ?\";","path":"app/gist/controller.js","position":29,"original_position":29,"commit_id":"3e40a9fe3760b64f53b4ee1efb0d04c0d0125db6","original_commit_id":"3e40a9fe3760b64f53b4ee1efb0d04c0d0125db6","user":{"login":"Gaurav0","id":313960,"avatar_url":"https://avatars.githubusercontent.com/u/313960?v=3","gravatar_id":"","url":"https://api.github.com/users/Gaurav0","html_url":"https://github.com/Gaurav0","followers_url":"https://api.github.com/users/Gaurav0/followers","following_url":"https://api.github.com/users/Gaurav0/following{/other_user}","gists_url":"https://api.github.com/users/Gaurav0/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaurav0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaurav0/subscriptions","organizations_url":"https://api.github.com/users/Gaurav0/orgs","repos_url":"https://api.github.com/users/Gaurav0/repos","events_url":"https://api.github.com/users/Gaurav0/events{/privacy}","received_events_url":"https://api.github.com/users/Gaurav0/received_events","type":"User","site_admin":false},"body":"Sounds good.","created_at":"2015-08-11T20:05:47Z","updated_at":"2015-08-11T20:05:47Z","html_url":"https://github.com/ember-cli/ember-twiddle/pull/148#discussion_r36791861","pull_request_url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/comments/36791861"},"html":{"href":"https://github.com/ember-cli/ember-twiddle/pull/148#discussion_r36791861"},"pull_request":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148","id":42089080,"html_url":"https://github.com/ember-cli/ember-twiddle/pull/148","diff_url":"https://github.com/ember-cli/ember-twiddle/pull/148.diff","patch_url":"https://github.com/ember-cli/ember-twiddle/pull/148.patch","issue_url":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/148","number":148,"state":"open","locked":false,"title":"add component (both js and hbs) Add File choice","user":{"login":"kagemusha","id":26988,"avatar_url":"https://avatars.githubusercontent.com/u/26988?v=3","gravatar_id":"","url":"https://api.github.com/users/kagemusha","html_url":"https://github.com/kagemusha","followers_url":"https://api.github.com/users/kagemusha/followers","following_url":"https://api.github.com/users/kagemusha/following{/other_user}","gists_url":"https://api.github.com/users/kagemusha/gists{/gist_id}","starred_url":"https://api.github.com/users/kagemusha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kagemusha/subscriptions","organizations_url":"https://api.github.com/users/kagemusha/orgs","repos_url":"https://api.github.com/users/kagemusha/repos","events_url":"https://api.github.com/users/kagemusha/events{/privacy}","received_events_url":"https://api.github.com/users/kagemusha/received_events","type":"User","site_admin":false},"body":"Takes care of issue #35.\r\n\r\nOne difference from discussions there is that if user enters file extension, get snarky error msg instead of stripping it off :-), but this can be changed if the latter felt better.\r\n\r\nTests to come.","created_at":"2015-08-11T03:17:50Z","updated_at":"2015-08-11T20:05:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bea7241e4ea0ff55bb88facafc9b7e29abe787e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148/commits","review_comments_url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148/comments","review_comment_url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/148/comments","statuses_url":"https://api.github.com/repos/ember-cli/ember-twiddle/statuses/3e40a9fe3760b64f53b4ee1efb0d04c0d0125db6","head":{"label":"kagemusha:master","ref":"master","sha":"3e40a9fe3760b64f53b4ee1efb0d04c0d0125db6","user":{"login":"kagemusha","id":26988,"avatar_url":"https://avatars.githubusercontent.com/u/26988?v=3","gravatar_id":"","url":"https://api.github.com/users/kagemusha","html_url":"https://github.com/kagemusha","followers_url":"https://api.github.com/users/kagemusha/followers","following_url":"https://api.github.com/users/kagemusha/following{/other_user}","gists_url":"https://api.github.com/users/kagemusha/gists{/gist_id}","starred_url":"https://api.github.com/users/kagemusha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kagemusha/subscriptions","organizations_url":"https://api.github.com/users/kagemusha/orgs","repos_url":"https://api.github.com/users/kagemusha/repos","events_url":"https://api.github.com/users/kagemusha/events{/privacy}","received_events_url":"https://api.github.com/users/kagemusha/received_events","type":"User","site_admin":false},"repo":{"id":40491571,"name":"ember-twiddle","full_name":"kagemusha/ember-twiddle","owner":{"login":"kagemusha","id":26988,"avatar_url":"https://avatars.githubusercontent.com/u/26988?v=3","gravatar_id":"","url":"https://api.github.com/users/kagemusha","html_url":"https://github.com/kagemusha","followers_url":"https://api.github.com/users/kagemusha/followers","following_url":"https://api.github.com/users/kagemusha/following{/other_user}","gists_url":"https://api.github.com/users/kagemusha/gists{/gist_id}","starred_url":"https://api.github.com/users/kagemusha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kagemusha/subscriptions","organizations_url":"https://api.github.com/users/kagemusha/orgs","repos_url":"https://api.github.com/users/kagemusha/repos","events_url":"https://api.github.com/users/kagemusha/events{/privacy}","received_events_url":"https://api.github.com/users/kagemusha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kagemusha/ember-twiddle","description":"JSFiddle type thing for ember-cli style code","fork":true,"url":"https://api.github.com/repos/kagemusha/ember-twiddle","forks_url":"https://api.github.com/repos/kagemusha/ember-twiddle/forks","keys_url":"https://api.github.com/repos/kagemusha/ember-twiddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kagemusha/ember-twiddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kagemusha/ember-twiddle/teams","hooks_url":"https://api.github.com/repos/kagemusha/ember-twiddle/hooks","issue_events_url":"https://api.github.com/repos/kagemusha/ember-twiddle/issues/events{/number}","events_url":"https://api.github.com/repos/kagemusha/ember-twiddle/events","assignees_url":"https://api.github.com/repos/kagemusha/ember-twiddle/assignees{/user}","branches_url":"https://api.github.com/repos/kagemusha/ember-twiddle/branches{/branch}","tags_url":"https://api.github.com/repos/kagemusha/ember-twiddle/tags","blobs_url":"https://api.github.com/repos/kagemusha/ember-twiddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kagemusha/ember-twiddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kagemusha/ember-twiddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/kagemusha/ember-twiddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kagemusha/ember-twiddle/statuses/{sha}","languages_url":"https://api.github.com/repos/kagemusha/ember-twiddle/languages","stargazers_url":"https://api.github.com/repos/kagemusha/ember-twiddle/stargazers","contributors_url":"https://api.github.com/repos/kagemusha/ember-twiddle/contributors","subscribers_url":"https://api.github.com/repos/kagemusha/ember-twiddle/subscribers","subscription_url":"https://api.github.com/repos/kagemusha/ember-twiddle/subscription","commits_url":"https://api.github.com/repos/kagemusha/ember-twiddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/kagemusha/ember-twiddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/kagemusha/ember-twiddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/kagemusha/ember-twiddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/kagemusha/ember-twiddle/contents/{+path}","compare_url":"https://api.github.com/repos/kagemusha/ember-twiddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kagemusha/ember-twiddle/merges","archive_url":"https://api.github.com/repos/kagemusha/ember-twiddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kagemusha/ember-twiddle/downloads","issues_url":"https://api.github.com/repos/kagemusha/ember-twiddle/issues{/number}","pulls_url":"https://api.github.com/repos/kagemusha/ember-twiddle/pulls{/number}","milestones_url":"https://api.github.com/repos/kagemusha/ember-twiddle/milestones{/number}","notifications_url":"https://api.github.com/repos/kagemusha/ember-twiddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kagemusha/ember-twiddle/labels{/name}","releases_url":"https://api.github.com/repos/kagemusha/ember-twiddle/releases{/id}","created_at":"2015-08-10T15:56:54Z","updated_at":"2015-08-10T15:56:55Z","pushed_at":"2015-08-11T03:11:21Z","git_url":"git://github.com/kagemusha/ember-twiddle.git","ssh_url":"git@github.com:kagemusha/ember-twiddle.git","clone_url":"https://github.com/kagemusha/ember-twiddle.git","svn_url":"https://github.com/kagemusha/ember-twiddle","homepage":"http://ember-twiddle.com","size":1176,"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":"ember-cli:master","ref":"master","sha":"f3aeff26dd404a82b50c0172c3ea61b1ac1fc747","user":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars.githubusercontent.com/u/10262982?v=3","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":31795341,"name":"ember-twiddle","full_name":"ember-cli/ember-twiddle","owner":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars.githubusercontent.com/u/10262982?v=3","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ember-cli/ember-twiddle","description":"JSFiddle type thing for ember-cli style code","fork":false,"url":"https://api.github.com/repos/ember-cli/ember-twiddle","forks_url":"https://api.github.com/repos/ember-cli/ember-twiddle/forks","keys_url":"https://api.github.com/repos/ember-cli/ember-twiddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ember-cli/ember-twiddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ember-cli/ember-twiddle/teams","hooks_url":"https://api.github.com/repos/ember-cli/ember-twiddle/hooks","issue_events_url":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/events{/number}","events_url":"https://api.github.com/repos/ember-cli/ember-twiddle/events","assignees_url":"https://api.github.com/repos/ember-cli/ember-twiddle/assignees{/user}","branches_url":"https://api.github.com/repos/ember-cli/ember-twiddle/branches{/branch}","tags_url":"https://api.github.com/repos/ember-cli/ember-twiddle/tags","blobs_url":"https://api.github.com/repos/ember-cli/ember-twiddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ember-cli/ember-twiddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ember-cli/ember-twiddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ember-cli/ember-twiddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ember-cli/ember-twiddle/statuses/{sha}","languages_url":"https://api.github.com/repos/ember-cli/ember-twiddle/languages","stargazers_url":"https://api.github.com/repos/ember-cli/ember-twiddle/stargazers","contributors_url":"https://api.github.com/repos/ember-cli/ember-twiddle/contributors","subscribers_url":"https://api.github.com/repos/ember-cli/ember-twiddle/subscribers","subscription_url":"https://api.github.com/repos/ember-cli/ember-twiddle/subscription","commits_url":"https://api.github.com/repos/ember-cli/ember-twiddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ember-cli/ember-twiddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ember-cli/ember-twiddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ember-cli/ember-twiddle/contents/{+path}","compare_url":"https://api.github.com/repos/ember-cli/ember-twiddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ember-cli/ember-twiddle/merges","archive_url":"https://api.github.com/repos/ember-cli/ember-twiddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ember-cli/ember-twiddle/downloads","issues_url":"https://api.github.com/repos/ember-cli/ember-twiddle/issues{/number}","pulls_url":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls{/number}","milestones_url":"https://api.github.com/repos/ember-cli/ember-twiddle/milestones{/number}","notifications_url":"https://api.github.com/repos/ember-cli/ember-twiddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ember-cli/ember-twiddle/labels{/name}","releases_url":"https://api.github.com/repos/ember-cli/ember-twiddle/releases{/id}","created_at":"2015-03-07T00:29:26Z","updated_at":"2015-08-10T04:11:09Z","pushed_at":"2015-08-11T19:02:20Z","git_url":"git://github.com/ember-cli/ember-twiddle.git","ssh_url":"git@github.com:ember-cli/ember-twiddle.git","clone_url":"https://github.com/ember-cli/ember-twiddle.git","svn_url":"https://github.com/ember-cli/ember-twiddle","homepage":"http://ember-twiddle.com","size":1176,"stargazers_count":93,"watchers_count":93,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":40,"forks":25,"open_issues":40,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148"},"html":{"href":"https://github.com/ember-cli/ember-twiddle/pull/148"},"issue":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/148"},"comments":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/ember-cli/ember-twiddle/statuses/3e40a9fe3760b64f53b4ee1efb0d04c0d0125db6"}}}}