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