From b72b167161a35fbb00f369167ce9560b555cfbbc Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Thu, 27 Apr 2017 10:18:28 +0200 Subject: [PATCH] ignore .Gemfile.jruby-1.9.lock, .lock and Gemfile Fixes #6985 --- .gitignore | 3 +++ Gemfile => Gemfile.template | 0 lib/bootstrap/bundler.rb | 10 +++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) rename Gemfile => Gemfile.template (100%) diff --git a/.gitignore b/.gitignore index 6135b64d7..5ffd629ec 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,9 @@ qa/.vm_ssh_config qa/.vagrant qa/acceptance/.vagrant qa/Gemfile.lock +Gemfile.jruby-1.9.lock +.lock +Gemfile *.ipr *.iws *.iml diff --git a/Gemfile b/Gemfile.template similarity index 100% rename from Gemfile rename to Gemfile.template diff --git a/lib/bootstrap/bundler.rb b/lib/bootstrap/bundler.rb index 2fc69e310..177944e74 100644 --- a/lib/bootstrap/bundler.rb +++ b/lib/bootstrap/bundler.rb @@ -13,7 +13,7 @@ module LogStash end end - # Patch to prevent Bundler to save a .bundle/config file in the root + # Patch to prevent Bundler to save a .bundle/config file in the root # of the application ::Bundler::Settings.module_exec do def set_key(key, value, hash, file) @@ -95,6 +95,14 @@ module LogStash require "bundler" require "bundler/cli" + + # create Gemfile from template iff it does not exist + unless ::File.exists?(Environment::GEMFILE_PATH) + ::FileUtils.copy( + ::File.join(ENV["LOGSTASH_HOME"], "Gemfile.template"), Environment::GEMFILE_PATH + ) + end + LogStash::Bundler.patch! # force Rubygems sources to our Gemfile sources