{"action":"created","comment":{"url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/comments/259341285","pull_request_review_id":206817724,"id":259341285,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1OTM0MTI4NQ==","diff_hunk":"@@ -20,38 +20,33 @@ def write_history(image_name)\n     end\n   end\n \n-  def should_adopt?(image_name, filename_list)\n+  def should_adopt?(image_name, dropbox_files)\n     create_history_file_if_needed\n \n-    json_data = open(HISTORY_JSON_FILE_PATH) do |io|\n+    counts_by_filename = open(HISTORY_JSON_FILE_PATH) do |io|\n       JSON.load(io)\n     end\n \n-    # NOTE: nil.to_i => 0\n-    count = json_data[image_name].to_i\n-    min_count = calculate_min_count(json_data, filename_list)\n+    count = counts_by_filename[image_name] || 0","path":"lib/history.rb","position":16,"original_position":16,"commit_id":"2c86b45f409d697bf16c380ae67524655a029b7e","original_commit_id":"2c86b45f409d697bf16c380ae67524655a029b7e","user":{"login":"blue0513","id":8979468,"node_id":"MDQ6VXNlcjg5Nzk0Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/8979468?v=4","gravatar_id":"","url":"https://api.github.com/users/blue0513","html_url":"https://github.com/blue0513","followers_url":"https://api.github.com/users/blue0513/followers","following_url":"https://api.github.com/users/blue0513/following{/other_user}","gists_url":"https://api.github.com/users/blue0513/gists{/gist_id}","starred_url":"https://api.github.com/users/blue0513/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blue0513/subscriptions","organizations_url":"https://api.github.com/users/blue0513/orgs","repos_url":"https://api.github.com/users/blue0513/repos","events_url":"https://api.github.com/users/blue0513/events{/privacy}","received_events_url":"https://api.github.com/users/blue0513/received_events","type":"User","site_admin":false},"body":"yeah.... this way is so simple but readable 👍 ","created_at":"2019-02-22T13:29:09Z","updated_at":"2019-02-22T13:29:09Z","html_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16#discussion_r259341285","pull_request_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/comments/259341285"},"html":{"href":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16#discussion_r259341285"},"pull_request":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16","id":254295153,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU0Mjk1MTUz","html_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16","diff_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16.diff","patch_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16.patch","issue_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/16","number":16,"state":"open","locked":false,"title":"Ignore history of deleted files","user":{"login":"typewriter","id":1283492,"node_id":"MDQ6VXNlcjEyODM0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1283492?v=4","gravatar_id":"","url":"https://api.github.com/users/typewriter","html_url":"https://github.com/typewriter","followers_url":"https://api.github.com/users/typewriter/followers","following_url":"https://api.github.com/users/typewriter/following{/other_user}","gists_url":"https://api.github.com/users/typewriter/gists{/gist_id}","starred_url":"https://api.github.com/users/typewriter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typewriter/subscriptions","organizations_url":"https://api.github.com/users/typewriter/orgs","repos_url":"https://api.github.com/users/typewriter/repos","events_url":"https://api.github.com/users/typewriter/events{/privacy}","received_events_url":"https://api.github.com/users/typewriter/received_events","type":"User","site_admin":false},"body":"Fix an infinite loop when there is a history of files that do not exist in Dropbox.","created_at":"2019-02-19T15:21:22Z","updated_at":"2019-02-22T13:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"540345cc30cf70f2530cdab0abba572faeb23f2f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16/commits","review_comments_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16/comments","review_comment_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/16/comments","statuses_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/statuses/2c86b45f409d697bf16c380ae67524655a029b7e","head":{"label":"typewriter:fix/treat-deleted-files","ref":"fix/treat-deleted-files","sha":"2c86b45f409d697bf16c380ae67524655a029b7e","user":{"login":"typewriter","id":1283492,"node_id":"MDQ6VXNlcjEyODM0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1283492?v=4","gravatar_id":"","url":"https://api.github.com/users/typewriter","html_url":"https://github.com/typewriter","followers_url":"https://api.github.com/users/typewriter/followers","following_url":"https://api.github.com/users/typewriter/following{/other_user}","gists_url":"https://api.github.com/users/typewriter/gists{/gist_id}","starred_url":"https://api.github.com/users/typewriter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typewriter/subscriptions","organizations_url":"https://api.github.com/users/typewriter/orgs","repos_url":"https://api.github.com/users/typewriter/repos","events_url":"https://api.github.com/users/typewriter/events{/privacy}","received_events_url":"https://api.github.com/users/typewriter/received_events","type":"User","site_admin":false},"repo":{"id":159166054,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkxNjYwNTQ=","name":"LGTM-Generator-from-Dropbox","full_name":"typewriter/LGTM-Generator-from-Dropbox","private":false,"owner":{"login":"typewriter","id":1283492,"node_id":"MDQ6VXNlcjEyODM0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1283492?v=4","gravatar_id":"","url":"https://api.github.com/users/typewriter","html_url":"https://github.com/typewriter","followers_url":"https://api.github.com/users/typewriter/followers","following_url":"https://api.github.com/users/typewriter/following{/other_user}","gists_url":"https://api.github.com/users/typewriter/gists{/gist_id}","starred_url":"https://api.github.com/users/typewriter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typewriter/subscriptions","organizations_url":"https://api.github.com/users/typewriter/orgs","repos_url":"https://api.github.com/users/typewriter/repos","events_url":"https://api.github.com/users/typewriter/events{/privacy}","received_events_url":"https://api.github.com/users/typewriter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/typewriter/LGTM-Generator-from-Dropbox","description":"Generate LGTM image from your favorite images on Dropbox !","fork":true,"url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox","forks_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/forks","keys_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/teams","hooks_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/hooks","issue_events_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/issues/events{/number}","events_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/events","assignees_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/assignees{/user}","branches_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/branches{/branch}","tags_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/tags","blobs_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/statuses/{sha}","languages_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/languages","stargazers_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/stargazers","contributors_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/contributors","subscribers_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/subscribers","subscription_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/subscription","commits_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/contents/{+path}","compare_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/merges","archive_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/downloads","issues_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/issues{/number}","pulls_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/pulls{/number}","milestones_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/milestones{/number}","notifications_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/labels{/name}","releases_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/releases{/id}","deployments_url":"https://api.github.com/repos/typewriter/LGTM-Generator-from-Dropbox/deployments","created_at":"2018-11-26T12:28:49Z","updated_at":"2019-02-19T15:13:58Z","pushed_at":"2019-02-19T15:17:53Z","git_url":"git://github.com/typewriter/LGTM-Generator-from-Dropbox.git","ssh_url":"git@github.com:typewriter/LGTM-Generator-from-Dropbox.git","clone_url":"https://github.com/typewriter/LGTM-Generator-from-Dropbox.git","svn_url":"https://github.com/typewriter/LGTM-Generator-from-Dropbox","homepage":"","size":31,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"blue0513:master","ref":"master","sha":"9fedfb399544539fa6a459793f82a7638a0eb797","user":{"login":"blue0513","id":8979468,"node_id":"MDQ6VXNlcjg5Nzk0Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/8979468?v=4","gravatar_id":"","url":"https://api.github.com/users/blue0513","html_url":"https://github.com/blue0513","followers_url":"https://api.github.com/users/blue0513/followers","following_url":"https://api.github.com/users/blue0513/following{/other_user}","gists_url":"https://api.github.com/users/blue0513/gists{/gist_id}","starred_url":"https://api.github.com/users/blue0513/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blue0513/subscriptions","organizations_url":"https://api.github.com/users/blue0513/orgs","repos_url":"https://api.github.com/users/blue0513/repos","events_url":"https://api.github.com/users/blue0513/events{/privacy}","received_events_url":"https://api.github.com/users/blue0513/received_events","type":"User","site_admin":false},"repo":{"id":156086652,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYwODY2NTI=","name":"LGTM-Generator-from-Dropbox","full_name":"blue0513/LGTM-Generator-from-Dropbox","private":false,"owner":{"login":"blue0513","id":8979468,"node_id":"MDQ6VXNlcjg5Nzk0Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/8979468?v=4","gravatar_id":"","url":"https://api.github.com/users/blue0513","html_url":"https://github.com/blue0513","followers_url":"https://api.github.com/users/blue0513/followers","following_url":"https://api.github.com/users/blue0513/following{/other_user}","gists_url":"https://api.github.com/users/blue0513/gists{/gist_id}","starred_url":"https://api.github.com/users/blue0513/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blue0513/subscriptions","organizations_url":"https://api.github.com/users/blue0513/orgs","repos_url":"https://api.github.com/users/blue0513/repos","events_url":"https://api.github.com/users/blue0513/events{/privacy}","received_events_url":"https://api.github.com/users/blue0513/received_events","type":"User","site_admin":false},"html_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox","description":"Generate LGTM image from your favorite images on Dropbox !","fork":false,"url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox","forks_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/forks","keys_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/teams","hooks_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/hooks","issue_events_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/events{/number}","events_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/events","assignees_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/assignees{/user}","branches_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/branches{/branch}","tags_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/tags","blobs_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/statuses/{sha}","languages_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/languages","stargazers_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/stargazers","contributors_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/contributors","subscribers_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/subscribers","subscription_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/subscription","commits_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/contents/{+path}","compare_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/merges","archive_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/downloads","issues_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues{/number}","pulls_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls{/number}","milestones_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/milestones{/number}","notifications_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/labels{/name}","releases_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/releases{/id}","deployments_url":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/deployments","created_at":"2018-11-04T13:46:11Z","updated_at":"2019-02-16T15:48:02Z","pushed_at":"2019-02-19T15:21:23Z","git_url":"git://github.com/blue0513/LGTM-Generator-from-Dropbox.git","ssh_url":"git@github.com:blue0513/LGTM-Generator-from-Dropbox.git","clone_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox.git","svn_url":"https://github.com/blue0513/LGTM-Generator-from-Dropbox","homepage":"","size":33,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16"},"html":{"href":"https://github.com/blue0513/LGTM-Generator-from-Dropbox/pull/16"},"issue":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/16"},"comments":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/blue0513/LGTM-Generator-from-Dropbox/statuses/2c86b45f409d697bf16c380ae67524655a029b7e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"blue0513"}}