{"action":"created","comment":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/comments/110770844","pull_request_review_id":31967657,"id":110770844,"diff_hunk":"@@ -0,0 +1,33 @@\n+# This function will install a version of Ruby onto the\n+# system for the buidlpack to use. It coordinates download\n+# and setting appropriate env vars for execution\n+#\n+# Example:\n+#\n+#   heroku_buildpack_ruby_install_ruby \"$BIN_DIR\" \"$ROOT_DIR\"\n+#\n+# Takes two arguments, the first is the location of the buildpack's\n+# `bin` directory. This is where the `download_ruby` script can be\n+# found. The second argument is the root directory where Ruby\n+# can be installed.\n+#\n+# Returns the directory where ruby was downloaded\n+heroku_buildpack_ruby_install_ruby()\n+{\n+  local bin_dir=$1\n+  local root_dir=$2\n+  heroku_buildpack_ruby_dir=\"$root_dir/vendor/ruby/$STACK\"\n+\n+  if [ ! -d \"$root_dir/vendor/ruby/$STACK\" ]; then","path":"bin/support/bash_functions.sh","position":21,"original_position":21,"commit_id":"d71b2296dd892be15fc30fbc8ee37fbfa27b9b01","original_commit_id":"d71b2296dd892be15fc30fbc8ee37fbfa27b9b01","user":{"login":"hone","id":16457,"avatar_url":"https://avatars1.githubusercontent.com/u/16457?v=3","gravatar_id":"","url":"https://api.github.com/users/hone","html_url":"https://github.com/hone","followers_url":"https://api.github.com/users/hone/followers","following_url":"https://api.github.com/users/hone/following{/other_user}","gists_url":"https://api.github.com/users/hone/gists{/gist_id}","starred_url":"https://api.github.com/users/hone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hone/subscriptions","organizations_url":"https://api.github.com/users/hone/orgs","repos_url":"https://api.github.com/users/hone/repos","events_url":"https://api.github.com/users/hone/events{/privacy}","received_events_url":"https://api.github.com/users/hone/received_events","type":"User","site_admin":false},"body":"can we replace this with `$heroku_buildpack_ruby_dir`?","created_at":"2017-04-10T21:44:50Z","updated_at":"2017-04-10T21:44:50Z","html_url":"https://github.com/heroku/heroku-buildpack-ruby/pull/555#discussion_r110770844","pull_request_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555","_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/comments/110770844"},"html":{"href":"https://github.com/heroku/heroku-buildpack-ruby/pull/555#discussion_r110770844"},"pull_request":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555"}}},"pull_request":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555","id":114217840,"html_url":"https://github.com/heroku/heroku-buildpack-ruby/pull/555","diff_url":"https://github.com/heroku/heroku-buildpack-ruby/pull/555.diff","patch_url":"https://github.com/heroku/heroku-buildpack-ruby/pull/555.patch","issue_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/555","number":555,"state":"open","locked":false,"title":"Fix Double Ruby for CI & DRY","user":{"login":"schneems","id":59744,"avatar_url":"https://avatars1.githubusercontent.com/u/59744?v=3","gravatar_id":"","url":"https://api.github.com/users/schneems","html_url":"https://github.com/schneems","followers_url":"https://api.github.com/users/schneems/followers","following_url":"https://api.github.com/users/schneems/following{/other_user}","gists_url":"https://api.github.com/users/schneems/gists{/gist_id}","starred_url":"https://api.github.com/users/schneems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schneems/subscriptions","organizations_url":"https://api.github.com/users/schneems/orgs","repos_url":"https://api.github.com/users/schneems/repos","events_url":"https://api.github.com/users/schneems/events{/privacy}","received_events_url":"https://api.github.com/users/schneems/received_events","type":"User","site_admin":false},"body":"\r\nWe can DRY up the bash scripts a bit by putting common logic into a function. You get access to this function by sourcing `bin/support/bash_functions.sh`.\r\n\r\nCurrently only one function is offered:\r\n\r\n```\r\nheroku_buildpack_ruby_install_ruby \"$BIN_DIR\" \"$ROOT_DIR\"\r\n```\r\n\r\nThis will download a version of Ruby for the buildpack and set the appropriate env vars so that it can be run.\r\n\r\nNow everywhere we were previously doing this manually we can re-use this bash function:\r\n\r\n```\r\nsource \"$BIN_DIR/support/bash_functions.sh\"\r\nheroku_buildpack_ruby_install_ruby \"$BIN_DIR\" \"$ROOT_DIR\"\r\n```\r\n\r\nThis left us with a problem since `bin/test-compile` is what set's up an app's `PATH` and `GEM_PATH`, however `bin/test` which is called after, also installs a verison of Ruby for the buildpack and to get this working correctly it mutates the `PATH` and unsets the `GEM_PATH`. To get the application code working correctly we can manually set the two values.\r\n\r\n```ruby\r\nLanguagePack::ShellHelpers.user_env_hash[\"PATH\"] = \"#{build_dir}/bin:#{ENV[\"PATH\"]}\"\r\nLanguagePack::ShellHelpers.user_env_hash[\"GEM_PATH\"] = LanguagePack::Ruby.slug_vendor_base\r\n```\r\n\r\nTo get this code to work we have to remove support for Ruby 1.8.7 from the buildpack. This is fine since 1.8.7 is EOL for many years now and not supported on any stacks that Heroku currently maintains.\r\n\r\n--- \r\n\r\nFix tests on Travis and Circle\r\n\r\n---\r\n\r\nSkip running tests on \"merge\" commits by auto exiting 0\r\n","created_at":"2017-04-04T18:48:47Z","updated_at":"2017-04-10T21:44:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22a4cb032f288b2034164d5863633f4c4e5246ae","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555/commits","review_comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555/comments","review_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/555/comments","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/statuses/d71b2296dd892be15fc30fbc8ee37fbfa27b9b01","head":{"label":"heroku:schneems/re-organize-bin","ref":"schneems/re-organize-bin","sha":"d71b2296dd892be15fc30fbc8ee37fbfa27b9b01","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars0.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":1794012,"name":"heroku-buildpack-ruby","full_name":"heroku/heroku-buildpack-ruby","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars0.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/heroku-buildpack-ruby","description":"Heroku's Ruby Buildpack for Cedar","fork":false,"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby","forks_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/forks","keys_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/events","assignees_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/merges","archive_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/deployments","created_at":"2011-05-24T15:14:41Z","updated_at":"2017-04-03T10:47:49Z","pushed_at":"2017-04-06T21:28:47Z","git_url":"git://github.com/heroku/heroku-buildpack-ruby.git","ssh_url":"git@github.com:heroku/heroku-buildpack-ruby.git","clone_url":"https://github.com/heroku/heroku-buildpack-ruby.git","svn_url":"https://github.com/heroku/heroku-buildpack-ruby","homepage":"","size":7447,"stargazers_count":514,"watchers_count":514,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1417,"mirror_url":null,"open_issues_count":32,"forks":1417,"open_issues":32,"watchers":514,"default_branch":"master"}},"base":{"label":"heroku:master","ref":"master","sha":"850d4c0b2decc76d6102799a8ffc04601958a223","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars0.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":1794012,"name":"heroku-buildpack-ruby","full_name":"heroku/heroku-buildpack-ruby","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars0.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/heroku-buildpack-ruby","description":"Heroku's Ruby Buildpack for Cedar","fork":false,"url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby","forks_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/forks","keys_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/events","assignees_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/merges","archive_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/deployments","created_at":"2011-05-24T15:14:41Z","updated_at":"2017-04-03T10:47:49Z","pushed_at":"2017-04-06T21:28:47Z","git_url":"git://github.com/heroku/heroku-buildpack-ruby.git","ssh_url":"git@github.com:heroku/heroku-buildpack-ruby.git","clone_url":"https://github.com/heroku/heroku-buildpack-ruby.git","svn_url":"https://github.com/heroku/heroku-buildpack-ruby","homepage":"","size":7447,"stargazers_count":514,"watchers_count":514,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1417,"mirror_url":null,"open_issues_count":32,"forks":1417,"open_issues":32,"watchers":514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555"},"html":{"href":"https://github.com/heroku/heroku-buildpack-ruby/pull/555"},"issue":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/555"},"comments":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/issues/555/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/pulls/555/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-ruby/statuses/d71b2296dd892be15fc30fbc8ee37fbfa27b9b01"}}}}
{"actor":{"display_login":"hone"}}