summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-04-03 15:04:05 +0000
committerRémy Coutable <remy@rymai.me>2018-04-03 15:04:05 +0000
commit4131c39a0bc41dbddabb2e110316e5048c907aa4 (patch)
treecdde3b1ec5a5233e50c159160d702b516c846dc5
parente3e461fbe1642fdbe787152369a573ef48ceffd9 (diff)
parent126b7c0f7387daabc97d7ed49ed85a45eb933ac9 (diff)
downloadgitlab-ce-4131c39a0bc41dbddabb2e110316e5048c907aa4.tar.gz
Merge branch 'blackst0ne-rails5-update-bin-rspec' into 'master'
[Rails5] Allow using `RAILS5` env with rspec See merge request gitlab-org/gitlab-ce!18140
-rwxr-xr-xbin/rspec6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/rspec b/bin/rspec
index 6e6709219af..26583242051 100755
--- a/bin/rspec
+++ b/bin/rspec
@@ -1,4 +1,10 @@
#!/usr/bin/env ruby
+
+# Remove these two lines below when upgraded to rails 5.0.
+# Allow run `rspec` command as `RAILS5=1 rspec ...` instead of `BUNDLE_GEMFILE=Gemfile.rails5 rspec ...`
+gemfile = %w[1 true].include?(ENV["RAILS5"]) ? "Gemfile.rails5" : "Gemfile"
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
+
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e