Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2017-10-29 19:23:57 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2017-11-01 02:45:22 +0300
commita14115119c643c00f19366be94251ded1be6ec32 (patch)
treefd9debc61bcfa83273190cb82c2dcad14fabb322 /script
parent63fcc9c1bcfe5a5033344358fff13ab803f724a7 (diff)
Add script/configure_bundler to set correct bundler options
Diffstat (limited to 'script')
-rwxr-xr-xscript/configure_bundler35
1 files changed, 35 insertions, 0 deletions
diff --git a/script/configure_bundler b/script/configure_bundler
new file mode 100755
index 000000000..6c28ae7a0
--- /dev/null
+++ b/script/configure_bundler
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require_relative "../config/bundler_helper"
+
+rails_env = BundlerHelper.rails_env
+database = BundlerHelper.database
+
+puts "Configuring Bundler for #{rails_env} environment and #{database} database."
+
+def config(option)
+ puts "$ bin/bundle config --local #{option}"
+ system("#{File.join(__dir__, '../bin/bundle')} config --local #{option}")
+end
+
+config("jobs #{`nproc`}")
+config("with #{database}")
+
+if rails_env == "production"
+ config("without test:development")
+elsif rails_env == "test"
+ config("without development")
+end
+
+if rails_env != "development"
+ config("path vendor/bundle")
+ config("frozen 1")
+ config("disable_shared_gems true")
+end
+
+if `gcc -dumpversion`.split(".").first.to_i >= 5
+ config("build.sigar \"--with-cppflags='-fgnu89-inline'\"")
+end
+
+puts "Bundler configured! Please run 'bin/bundle install' now."