{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/49298117","id":49298117,"diff_hunk":"@@ -106,14 +108,27 @@ def post_install\n     config_file.write rubygems_config\n \n     # Create the sitedir and vendordir that were skipped during install\n-    mkdir_p `#{bin}/ruby -e 'require \"rbconfig\"; print RbConfig::CONFIG[\"sitearchdir\"]'`\n-    mkdir_p `#{bin}/ruby -e 'require \"rbconfig\"; print RbConfig::CONFIG[\"vendorarchdir\"]'`\n+    ruby=\"#{bin}/ruby#{program_suffix}\"\n+    %w[sitearchdir vendorarchdir].each do |dir|\n+      mkdir_p `#{ruby} -rrbconfig -e 'print RbConfig::CONFIG[\"#{dir}\"]'`\n+    end\n+\n+    # Create the version-specific bindir used by rubygems\n+    mkdir_p \"#{rubygems_bindir}\"\n   end\n \n   def abi_version\n     \"2.3.0\"\n   end\n \n+  def program_suffix\n+    build.with?(\"suffix\") ? \"23\" : \"\"\n+  end","path":"Library/Formula/ruby.rb","position":41,"original_position":41,"commit_id":"989f55c1a4b460f43f29e2dd0a0d02b07ff3cabb","original_commit_id":"989f55c1a4b460f43f29e2dd0a0d02b07ff3cabb","user":{"login":"DomT4","id":6998367,"avatar_url":"https://avatars.githubusercontent.com/u/6998367?v=3","gravatar_id":"","url":"https://api.github.com/users/DomT4","html_url":"https://github.com/DomT4","followers_url":"https://api.github.com/users/DomT4/followers","following_url":"https://api.github.com/users/DomT4/following{/other_user}","gists_url":"https://api.github.com/users/DomT4/gists{/gist_id}","starred_url":"https://api.github.com/users/DomT4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DomT4/subscriptions","organizations_url":"https://api.github.com/users/DomT4/orgs","repos_url":"https://api.github.com/users/DomT4/repos","events_url":"https://api.github.com/users/DomT4/events{/privacy}","received_events_url":"https://api.github.com/users/DomT4/received_events","type":"User","site_admin":false},"body":"Could do something like `version.to_s[0..2].delete(\".\")`. I'm sure there's a much prettier way though :smile_cat: ","created_at":"2016-01-11T08:40:40Z","updated_at":"2016-01-11T08:40:40Z","html_url":"https://github.com/Homebrew/homebrew/pull/47906#discussion_r49298117","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/49298117"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/47906#discussion_r49298117"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906","id":55556803,"html_url":"https://github.com/Homebrew/homebrew/pull/47906","diff_url":"https://github.com/Homebrew/homebrew/pull/47906.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/47906.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/47906","number":47906,"state":"open","locked":false,"title":"ruby: clean up","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":"This PR carries over some changes/improvements that were already applied to the various Ruby formulae in `homebrew/versions`, namely:\r\n\r\n- Gems are kept in a version-specific directory. Once a major version bump happens (like from 2.2.4 to 2.3.0), the binary wrappers for Gems that are placed in `HOMEBREW_PREFIX/bin` stop working, because matching Gems only exist in the old Gem directory (of the old Ruby). Rectify this by placing the wrappers in `HOMEBREW_PREFIX/lib/ruby/gems/ABI_VERSION/bin`.\r\n\r\n- Fix `post_install` and `test` if option `--with-suffix` is specified.\r\n\r\n- Reduce some code duplication by introducing `program_suffix` and `rubygems_bindir`. Also some minor stylistic adjustments and a slightly beefed up test.\r\n\r\nI suspect the first change won't make everyone happy (and might require a `revision` bump, too). Hence, here are pros and cons (all paths relative to the Homebrew prefix):\r\n\r\n- :heavy_plus_sign: Gem binary wrappers are kept in a versioned directory, meaning they are next to the Gems they actually belong to. (If binaries are in `lib/ruby/gems/2.2.0/bin` this will create less of an impression that it makes sense to call them after an update to Ruby 2.3.0.)\r\n\r\n- :heavy_minus_sign: As explained in the added `caveats`, users will need to modify their `PATH` if they want convenient access to these wrappers. Furthermore, they will need to modify their `PATH` again after a major Ruby upgrade.\r\n\r\n- :heavy_minus_sign: (Not really a change, except it's actually easier to wipe old Gems and their wrappers.) After a major upgrade, e.g. from 2.2.4 to 2.3.0, the entire `lib/ruby/gems/2.2.0` directory becomes basically useless. In theory it could be taken over by a `ruby22` formula, but the binary wrappers will be broken because they continue to reference `opt/ruby/bin/ruby` in their shebang line.\r\n\r\ncc @DomT4 for opinions.","created_at":"2016-01-10T03:15:38Z","updated_at":"2016-01-11T08:40:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e45a0b80afb02ee0d9b8029ff5e26d7a98721e85","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/47906/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/989f55c1a4b460f43f29e2dd0a0d02b07ff3cabb","head":{"label":"UniqMartin:ruby-cleanup-lite","ref":"ruby-cleanup-lite","sha":"989f55c1a4b460f43f29e2dd0a0d02b07ff3cabb","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},"repo":{"id":33837479,"name":"homebrew","full_name":"UniqMartin/homebrew","owner":{"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},"private":false,"html_url":"https://github.com/UniqMartin/homebrew","description":":tea: Personal fork of “The missing package manager for OS X”","fork":true,"url":"https://api.github.com/repos/UniqMartin/homebrew","forks_url":"https://api.github.com/repos/UniqMartin/homebrew/forks","keys_url":"https://api.github.com/repos/UniqMartin/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UniqMartin/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UniqMartin/homebrew/teams","hooks_url":"https://api.github.com/repos/UniqMartin/homebrew/hooks","issue_events_url":"https://api.github.com/repos/UniqMartin/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/UniqMartin/homebrew/events","assignees_url":"https://api.github.com/repos/UniqMartin/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/UniqMartin/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/UniqMartin/homebrew/tags","blobs_url":"https://api.github.com/repos/UniqMartin/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UniqMartin/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UniqMartin/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/UniqMartin/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UniqMartin/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/UniqMartin/homebrew/languages","stargazers_url":"https://api.github.com/repos/UniqMartin/homebrew/stargazers","contributors_url":"https://api.github.com/repos/UniqMartin/homebrew/contributors","subscribers_url":"https://api.github.com/repos/UniqMartin/homebrew/subscribers","subscription_url":"https://api.github.com/repos/UniqMartin/homebrew/subscription","commits_url":"https://api.github.com/repos/UniqMartin/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/UniqMartin/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/UniqMartin/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/UniqMartin/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/UniqMartin/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/UniqMartin/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UniqMartin/homebrew/merges","archive_url":"https://api.github.com/repos/UniqMartin/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UniqMartin/homebrew/downloads","issues_url":"https://api.github.com/repos/UniqMartin/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/UniqMartin/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/UniqMartin/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/UniqMartin/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UniqMartin/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/UniqMartin/homebrew/releases{/id}","created_at":"2015-04-12T23:04:38Z","updated_at":"2015-12-20T09:09:49Z","pushed_at":"2016-01-10T02:54:05Z","git_url":"git://github.com/UniqMartin/homebrew.git","ssh_url":"git@github.com:UniqMartin/homebrew.git","clone_url":"https://github.com/UniqMartin/homebrew.git","svn_url":"https://github.com/UniqMartin/homebrew","homepage":"","size":67498,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"44b84d1d9f7c4414c5e412198d0b55e9511b1c02","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":206084,"name":"homebrew","full_name":"Homebrew/homebrew","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/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2016-01-11T08:25:55Z","pushed_at":"2016-01-11T08:29:02Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1407497,"stargazers_count":28391,"watchers_count":28391,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":14020,"mirror_url":null,"open_issues_count":444,"forks":14020,"open_issues":444,"watchers":28391,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/47906"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/47906"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/47906/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/47906/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/989f55c1a4b460f43f29e2dd0a0d02b07ff3cabb"}}}}