{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/brew/pulls/comments/66896070","id":66896070,"diff_hunk":"@@ -51,32 +51,37 @@ def bump_formula_pr\n       safe_system \"brew\", \"update\"\n     end\n \n-    Utils::Inreplace.inreplace(formula.path) do |s|\n-      if new_url_hash\n-        old_url = formula_spec.url\n-        if ARGV.dry_run?\n-          ohai \"replace '#{old_url}' with '#{new_url}'\"\n-          ohai \"replace '#{old_hash}' with '#{new_hash}'\"\n-        else\n-          s.gsub!(old_url, new_url)\n-          s.gsub!(old_hash, new_hash)\n-        end\n-      else\n-        resource_specs = formula_spec.specs\n-        old_tag = resource_specs[:tag]\n-        old_revision = resource_specs[:revision]\n-        if ARGV.dry_run?\n-          ohai \"replace '#{old_tag}' with '#{new_tag}'\"\n-          ohai \"replace '#{old_revision}' with '#{new_revision}'\"\n-        else\n-          s.gsub!(/['\"]#{old_tag}['\"]/, \"\\\"#{new_tag}\\\"\")\n-          s.gsub!(old_revision, new_revision)\n-        end\n-      end\n+    s = (formula.path.open(\"r\") { |f| Formulary.set_encoding(f).read }).extend(StringInreplaceExtension)","path":"Library/Homebrew/dev-cmd/bump-formula-pr.rb","position":26,"original_position":26,"commit_id":"25d87b0f39914e7633d961e26b7ce41b2c0da5a2","original_commit_id":"25d87b0f39914e7633d961e26b7ce41b2c0da5a2","user":{"login":"UniqMartin","id":11892150,"avatar_url":"https://avatars.githubusercontent.com/u/11892150?v=3","gravatar_id":"","url":"https://api.github.com/users/UniqMartin","html_url":"https://github.com/UniqMartin","followers_url":"https://api.github.com/users/UniqMartin/followers","following_url":"https://api.github.com/users/UniqMartin/following{/other_user}","gists_url":"https://api.github.com/users/UniqMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/UniqMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniqMartin/subscriptions","organizations_url":"https://api.github.com/users/UniqMartin/orgs","repos_url":"https://api.github.com/users/UniqMartin/repos","events_url":"https://api.github.com/users/UniqMartin/events{/privacy}","received_events_url":"https://api.github.com/users/UniqMartin/received_events","type":"User","site_admin":false},"body":"Consider splitting this into two lines for readability. Repeating the `s` doesn't feel like a burden and avoiding the awkward parentheses seems like a win to me.\r\n\r\n```\r\ns = formula.path.open(\"r\") { |f| Formulary.set_encoding(f).read }\r\ns.extend(StringInreplaceExtension)\r\n```","created_at":"2016-06-14T01:18:42Z","updated_at":"2016-06-14T01:18:42Z","html_url":"https://github.com/Homebrew/brew/pull/318#discussion_r66896070","pull_request_url":"https://api.github.com/repos/Homebrew/brew/pulls/318","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/comments/66896070"},"html":{"href":"https://github.com/Homebrew/brew/pull/318#discussion_r66896070"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/318"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/brew/pulls/318","id":72623802,"html_url":"https://github.com/Homebrew/brew/pull/318","diff_url":"https://github.com/Homebrew/brew/pull/318.diff","patch_url":"https://github.com/Homebrew/brew/pull/318.patch","issue_url":"https://api.github.com/repos/Homebrew/brew/issues/318","number":318,"state":"open","locked":false,"title":"bump-formula-pr dry-run should reflect new version","user":{"login":"ilovezfs","id":5268928,"avatar_url":"https://avatars.githubusercontent.com/u/5268928?v=3","gravatar_id":"","url":"https://api.github.com/users/ilovezfs","html_url":"https://github.com/ilovezfs","followers_url":"https://api.github.com/users/ilovezfs/followers","following_url":"https://api.github.com/users/ilovezfs/following{/other_user}","gists_url":"https://api.github.com/users/ilovezfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ilovezfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilovezfs/subscriptions","organizations_url":"https://api.github.com/users/ilovezfs/orgs","repos_url":"https://api.github.com/users/ilovezfs/repos","events_url":"https://api.github.com/users/ilovezfs/events{/privacy}","received_events_url":"https://api.github.com/users/ilovezfs/received_events","type":"User","site_admin":false},"body":"- simulate version change for dry-run\n- make sure we're using :devel version if called with --devel","created_at":"2016-06-05T08:28:45Z","updated_at":"2016-06-14T01:18:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"deb45ac923ab41e08023ccc362164c56182ef4ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/brew/pulls/318/commits","review_comments_url":"https://api.github.com/repos/Homebrew/brew/pulls/318/comments","review_comment_url":"https://api.github.com/repos/Homebrew/brew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/318/comments","statuses_url":"https://api.github.com/repos/Homebrew/brew/statuses/25d87b0f39914e7633d961e26b7ce41b2c0da5a2","head":{"label":"ilovezfs:bump-formula-pr-dry-run-version","ref":"bump-formula-pr-dry-run-version","sha":"25d87b0f39914e7633d961e26b7ce41b2c0da5a2","user":{"login":"ilovezfs","id":5268928,"avatar_url":"https://avatars.githubusercontent.com/u/5268928?v=3","gravatar_id":"","url":"https://api.github.com/users/ilovezfs","html_url":"https://github.com/ilovezfs","followers_url":"https://api.github.com/users/ilovezfs/followers","following_url":"https://api.github.com/users/ilovezfs/following{/other_user}","gists_url":"https://api.github.com/users/ilovezfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ilovezfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilovezfs/subscriptions","organizations_url":"https://api.github.com/users/ilovezfs/orgs","repos_url":"https://api.github.com/users/ilovezfs/repos","events_url":"https://api.github.com/users/ilovezfs/events{/privacy}","received_events_url":"https://api.github.com/users/ilovezfs/received_events","type":"User","site_admin":false},"repo":{"id":55388553,"name":"brew","full_name":"ilovezfs/brew","owner":{"login":"ilovezfs","id":5268928,"avatar_url":"https://avatars.githubusercontent.com/u/5268928?v=3","gravatar_id":"","url":"https://api.github.com/users/ilovezfs","html_url":"https://github.com/ilovezfs","followers_url":"https://api.github.com/users/ilovezfs/followers","following_url":"https://api.github.com/users/ilovezfs/following{/other_user}","gists_url":"https://api.github.com/users/ilovezfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ilovezfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilovezfs/subscriptions","organizations_url":"https://api.github.com/users/ilovezfs/orgs","repos_url":"https://api.github.com/users/ilovezfs/repos","events_url":"https://api.github.com/users/ilovezfs/events{/privacy}","received_events_url":"https://api.github.com/users/ilovezfs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilovezfs/brew","description":":beer: The missing package manager for OS X","fork":true,"url":"https://api.github.com/repos/ilovezfs/brew","forks_url":"https://api.github.com/repos/ilovezfs/brew/forks","keys_url":"https://api.github.com/repos/ilovezfs/brew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilovezfs/brew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilovezfs/brew/teams","hooks_url":"https://api.github.com/repos/ilovezfs/brew/hooks","issue_events_url":"https://api.github.com/repos/ilovezfs/brew/issues/events{/number}","events_url":"https://api.github.com/repos/ilovezfs/brew/events","assignees_url":"https://api.github.com/repos/ilovezfs/brew/assignees{/user}","branches_url":"https://api.github.com/repos/ilovezfs/brew/branches{/branch}","tags_url":"https://api.github.com/repos/ilovezfs/brew/tags","blobs_url":"https://api.github.com/repos/ilovezfs/brew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilovezfs/brew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilovezfs/brew/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilovezfs/brew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilovezfs/brew/statuses/{sha}","languages_url":"https://api.github.com/repos/ilovezfs/brew/languages","stargazers_url":"https://api.github.com/repos/ilovezfs/brew/stargazers","contributors_url":"https://api.github.com/repos/ilovezfs/brew/contributors","subscribers_url":"https://api.github.com/repos/ilovezfs/brew/subscribers","subscription_url":"https://api.github.com/repos/ilovezfs/brew/subscription","commits_url":"https://api.github.com/repos/ilovezfs/brew/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilovezfs/brew/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilovezfs/brew/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilovezfs/brew/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilovezfs/brew/contents/{+path}","compare_url":"https://api.github.com/repos/ilovezfs/brew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilovezfs/brew/merges","archive_url":"https://api.github.com/repos/ilovezfs/brew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilovezfs/brew/downloads","issues_url":"https://api.github.com/repos/ilovezfs/brew/issues{/number}","pulls_url":"https://api.github.com/repos/ilovezfs/brew/pulls{/number}","milestones_url":"https://api.github.com/repos/ilovezfs/brew/milestones{/number}","notifications_url":"https://api.github.com/repos/ilovezfs/brew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilovezfs/brew/labels{/name}","releases_url":"https://api.github.com/repos/ilovezfs/brew/releases{/id}","deployments_url":"https://api.github.com/repos/ilovezfs/brew/deployments","created_at":"2016-04-04T06:01:34Z","updated_at":"2016-04-04T06:01:35Z","pushed_at":"2016-06-09T12:44:20Z","git_url":"git://github.com/ilovezfs/brew.git","ssh_url":"git@github.com:ilovezfs/brew.git","clone_url":"https://github.com/ilovezfs/brew.git","svn_url":"https://github.com/ilovezfs/brew","homepage":"http://brew.sh","size":10019,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"Homebrew:master","ref":"master","sha":"11d47e8325f50ab7993f3fca0432876da0ea1c11","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":53238813,"name":"brew","full_name":"Homebrew/brew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/brew","description":":beer: The missing package manager for OS X","fork":false,"url":"https://api.github.com/repos/Homebrew/brew","forks_url":"https://api.github.com/repos/Homebrew/brew/forks","keys_url":"https://api.github.com/repos/Homebrew/brew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/brew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/brew/teams","hooks_url":"https://api.github.com/repos/Homebrew/brew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/brew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/brew/events","assignees_url":"https://api.github.com/repos/Homebrew/brew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/brew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/brew/tags","blobs_url":"https://api.github.com/repos/Homebrew/brew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/brew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/brew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/brew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/brew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/brew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/brew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/brew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/brew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/brew/subscription","commits_url":"https://api.github.com/repos/Homebrew/brew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/brew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/brew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/brew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/brew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/brew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/brew/merges","archive_url":"https://api.github.com/repos/Homebrew/brew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/brew/downloads","issues_url":"https://api.github.com/repos/Homebrew/brew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/brew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/brew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/brew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/brew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/brew/releases{/id}","deployments_url":"https://api.github.com/repos/Homebrew/brew/deployments","created_at":"2016-03-06T05:08:38Z","updated_at":"2016-06-13T22:31:17Z","pushed_at":"2016-06-14T01:17:01Z","git_url":"git://github.com/Homebrew/brew.git","ssh_url":"git@github.com:Homebrew/brew.git","clone_url":"https://github.com/Homebrew/brew.git","svn_url":"https://github.com/Homebrew/brew","homepage":"http://brew.sh","size":10311,"stargazers_count":1513,"watchers_count":1513,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":426,"mirror_url":null,"open_issues_count":45,"forks":426,"open_issues":45,"watchers":1513,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/318"},"html":{"href":"https://github.com/Homebrew/brew/pull/318"},"issue":{"href":"https://api.github.com/repos/Homebrew/brew/issues/318"},"comments":{"href":"https://api.github.com/repos/Homebrew/brew/issues/318/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/318/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/318/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/brew/statuses/25d87b0f39914e7633d961e26b7ce41b2c0da5a2"}}}}
{"actor":{"display_login":"UniqMartin"}}