{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch/logstash/pulls/comments/24645035","id":24645035,"diff_hunk":"@@ -0,0 +1,125 @@\n+require \"bundler\"\n+require \"bundler/cli\"\n+\n+module Bundler\n+  # Patch bundler to write a .lock file specific to the version of ruby.\n+  # This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates\n+  module SharedHelpers\n+    def default_lockfile\n+      ruby = \"#{LogStash::Environment.ruby_engine}-#{LogStash::Environment.ruby_abi_version}\"\n+      Pathname.new(\"#{default_gemfile}.#{ruby}.lock\")\n+    end\n+  end\n+\n+  # Add the Bundler.reset! method which has been added in master but is not in 1.7.9.\n+  class << self\n+    unless self.method_defined?(\"reset!\")\n+      def reset!\n+        @definition = nil\n+      end\n+    end\n+\n+    def reset_settings\n+      # reset!\n+      # clear_gemspec_cache\n+\n+      # remove_instance_variable(:@setup) if defined?(@setup)\n+      # remove_instance_variable(:@locked_gems) if defined?(@locked_gems)\n+      # remove_instance_variable(:@load) if defined?(@load)\n+      remove_instance_variable(:@settings) if defined?(@settings)\n+    end\n+  end\n+end\n+\n+module LogStash\n+  module Bundler\n+    # capture any $stdout from the passed block. also trap any exception in that block, in which case the trapped exception will be returned\n+    # @param [Proc] the code block to execute\n+    # @return [String, Exception] the captured $stdout string and any trapped exception or nil if none\n+    def self.capture_stdout\n+      begin\n+        old_stdout = $stdout\n+        $stdout = StringIO.new('', 'w')\n+        begin\n+          yield\n+        rescue => e\n+          return [$stdout.string, e]\n+        end\n+\n+        [$stdout.string, nil]\n+      ensure\n+        $stdout = old_stdout\n+      end\n+    end\n+\n+    # execute bundle install and capture any $stdout output. any raised exception in the process will be trapped\n+    # and returned. logs errors to $stdout.\n+    # @param options [Hash] invoke options with default values, :max_tries => 10, :clean => false, :install => false, :update => false\n+    # @param   options[:update] must be either false or a String or an Array of String\n+    # @return [String, Exception] the installation captured output and any raised exception or nil if none\n+    def self.invoke_bundler!(options = {})\n+      options = {:max_tries => 10, :clean => false, :install => false, :update => false, :without => [:development]}.merge(options)\n+      options[:without] = Array(options[:without])\n+      options[:update] = Array(options[:update]) if options[:update]\n+\n+      ENV[\"GEM_PATH\"] = LogStash::Environment.logstash_gem_home\n+      ENV[\"BUNDLE_PATH\"] = LogStash::Environment.logstash_gem_home\n+      ENV[\"BUNDLE_GEMFILE\"] = LogStash::Environment::GEMFILE_PATH\n+      ENV[\"BUNDLE_WITHOUT\"] = options[:without].empty? ? \"\" : options[:without].join(\":\")\n+\n+      try = 0","path":"lib/logstash/bundler.rb","position":70,"original_position":70,"commit_id":"be8b530ff758213c7664547666ff8ba384c4f46a","original_commit_id":"be8b530ff758213c7664547666ff8ba384c4f46a","user":{"login":"jordansissel","id":131818,"avatar_url":"https://avatars.githubusercontent.com/u/131818?v=3","gravatar_id":"","url":"https://api.github.com/users/jordansissel","html_url":"https://github.com/jordansissel","followers_url":"https://api.github.com/users/jordansissel/followers","following_url":"https://api.github.com/users/jordansissel/following{/other_user}","gists_url":"https://api.github.com/users/jordansissel/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansissel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansissel/subscriptions","organizations_url":"https://api.github.com/users/jordansissel/orgs","repos_url":"https://api.github.com/users/jordansissel/repos","events_url":"https://api.github.com/users/jordansissel/events{/privacy}","received_events_url":"https://api.github.com/users/jordansissel/received_events","type":"User","site_admin":false},"body":"Any reason not to use `options[:max_tries].times do .... end` instead of having a `try` variable that we are incrememnting?","created_at":"2015-02-13T05:22:18Z","updated_at":"2015-02-13T05:22:18Z","html_url":"https://github.com/elasticsearch/logstash/pull/2475#discussion_r24645035","pull_request_url":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/comments/24645035"},"html":{"href":"https://github.com/elasticsearch/logstash/pull/2475#discussion_r24645035"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475","id":28232747,"html_url":"https://github.com/elasticsearch/logstash/pull/2475","diff_url":"https://github.com/elasticsearch/logstash/pull/2475.diff","patch_url":"https://github.com/elasticsearch/logstash/pull/2475.patch","issue_url":"https://api.github.com/repos/elasticsearch/logstash/issues/2475","number":2475,"state":"open","locked":false,"title":"plugins/bundler refactor","user":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-28T21:49:28Z","updated_at":"2015-02-13T05:22:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"388f3ce5239c38c8e559fb399a56165cd3c86287","assignee":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/elasticsearch/logstash/milestones/8","labels_url":"https://api.github.com/repos/elasticsearch/logstash/milestones/8/labels","id":953679,"number":8,"title":"v1.5.0 rc1","description":"","creator":{"login":"jordansissel","id":131818,"avatar_url":"https://avatars.githubusercontent.com/u/131818?v=3","gravatar_id":"","url":"https://api.github.com/users/jordansissel","html_url":"https://github.com/jordansissel","followers_url":"https://api.github.com/users/jordansissel/followers","following_url":"https://api.github.com/users/jordansissel/following{/other_user}","gists_url":"https://api.github.com/users/jordansissel/gists{/gist_id}","starred_url":"https://api.github.com/users/jordansissel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordansissel/subscriptions","organizations_url":"https://api.github.com/users/jordansissel/orgs","repos_url":"https://api.github.com/users/jordansissel/repos","events_url":"https://api.github.com/users/jordansissel/events{/privacy}","received_events_url":"https://api.github.com/users/jordansissel/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":16,"state":"open","created_at":"2015-01-27T18:51:07Z","updated_at":"2015-02-13T01:43:54Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475/commits","review_comments_url":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475/comments","review_comment_url":"https://api.github.com/repos/elasticsearch/logstash/pulls/comments/{number}","comments_url":"https://api.github.com/repos/elasticsearch/logstash/issues/2475/comments","statuses_url":"https://api.github.com/repos/elasticsearch/logstash/statuses/be8b530ff758213c7664547666ff8ba384c4f46a","head":{"label":"elasticsearch:wip/bundler-move","ref":"wip/bundler-move","sha":"be8b530ff758213c7664547666ff8ba384c4f46a","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elasticsearch/logstash","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/logstash","description":"logstash - logs/event transport, processing, management, search.","fork":false,"url":"https://api.github.com/repos/elasticsearch/logstash","forks_url":"https://api.github.com/repos/elasticsearch/logstash/forks","keys_url":"https://api.github.com/repos/elasticsearch/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/logstash/teams","hooks_url":"https://api.github.com/repos/elasticsearch/logstash/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/logstash/events","assignees_url":"https://api.github.com/repos/elasticsearch/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/logstash/tags","blobs_url":"https://api.github.com/repos/elasticsearch/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/logstash/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/logstash/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/logstash/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/logstash/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/logstash/subscription","commits_url":"https://api.github.com/repos/elasticsearch/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/logstash/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/logstash/merges","archive_url":"https://api.github.com/repos/elasticsearch/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/logstash/downloads","issues_url":"https://api.github.com/repos/elasticsearch/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/logstash/releases{/id}","created_at":"2010-11-18T01:31:50Z","updated_at":"2015-02-13T00:25:09Z","pushed_at":"2015-02-13T01:41:37Z","git_url":"git://github.com/elasticsearch/logstash.git","ssh_url":"git@github.com:elasticsearch/logstash.git","clone_url":"https://github.com/elasticsearch/logstash.git","svn_url":"https://github.com/elasticsearch/logstash","homepage":"http://logstash.net/","size":87046,"stargazers_count":3668,"watchers_count":3668,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1344,"mirror_url":null,"open_issues_count":530,"forks":1344,"open_issues":530,"watchers":3668,"default_branch":"master"}},"base":{"label":"elasticsearch:master","ref":"master","sha":"f78b74cf9aa326f9647ff95b5838d8a570acf4eb","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elasticsearch/logstash","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/logstash","description":"logstash - logs/event transport, processing, management, search.","fork":false,"url":"https://api.github.com/repos/elasticsearch/logstash","forks_url":"https://api.github.com/repos/elasticsearch/logstash/forks","keys_url":"https://api.github.com/repos/elasticsearch/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/logstash/teams","hooks_url":"https://api.github.com/repos/elasticsearch/logstash/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/logstash/events","assignees_url":"https://api.github.com/repos/elasticsearch/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/logstash/tags","blobs_url":"https://api.github.com/repos/elasticsearch/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/logstash/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/logstash/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/logstash/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/logstash/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/logstash/subscription","commits_url":"https://api.github.com/repos/elasticsearch/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/logstash/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/logstash/merges","archive_url":"https://api.github.com/repos/elasticsearch/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/logstash/downloads","issues_url":"https://api.github.com/repos/elasticsearch/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/logstash/releases{/id}","created_at":"2010-11-18T01:31:50Z","updated_at":"2015-02-13T00:25:09Z","pushed_at":"2015-02-13T01:41:37Z","git_url":"git://github.com/elasticsearch/logstash.git","ssh_url":"git@github.com:elasticsearch/logstash.git","clone_url":"https://github.com/elasticsearch/logstash.git","svn_url":"https://github.com/elasticsearch/logstash","homepage":"http://logstash.net/","size":87046,"stargazers_count":3668,"watchers_count":3668,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1344,"mirror_url":null,"open_issues_count":530,"forks":1344,"open_issues":530,"watchers":3668,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475"},"html":{"href":"https://github.com/elasticsearch/logstash/pull/2475"},"issue":{"href":"https://api.github.com/repos/elasticsearch/logstash/issues/2475"},"comments":{"href":"https://api.github.com/repos/elasticsearch/logstash/issues/2475/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch/logstash/pulls/2475/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch/logstash/statuses/be8b530ff758213c7664547666ff8ba384c4f46a"}}}}