[Groonga-commit] groonga/packages.groonga.org at d4c8af5 [master] Support work on Bundler

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Sep 27 18:48:15 JST 2014


Kouhei Sutou	2014-09-27 18:48:15 +0900 (Sat, 27 Sep 2014)

  New Revision: d4c8af5d0c02fc759660dc60221918ce0c24591c
  https://github.com/groonga/packages.groonga.org/commit/d4c8af5d0c02fc759660dc60221918ce0c24591c

  Message:
    Support work on Bundler

  Modified files:
    spec/spec_helper.rb

  Modified: spec/spec_helper.rb (+26 -3)
===================================================================
--- spec/spec_helper.rb    2014-09-27 18:11:48 +0900 (3adbf5c)
+++ spec/spec_helper.rb    2014-09-27 18:48:15 +0900 (ac9fd5f)
@@ -5,6 +5,26 @@ require "net/ssh"
 include SpecInfra::Helper::Ssh
 include SpecInfra::Helper::DetectOS
 
+def without_bundler
+  bundler_environment_variable_names = [
+    "BUNDLE_BIN_PATH",
+    "BUNDLE_GEMFILE",
+    "RUBYOPT",
+  ]
+  variables = {}
+  bundler_environment_variable_names.each do |name|
+    variables[name] = ENV[name]
+    ENV.delete(name)
+  end
+  begin
+    yield
+  ensure
+    bundler_environment_variable_names.each do |name|
+      ENV[name] = variables[name]
+    end
+  end
+end
+
 RSpec.configure do |c|
   if ENV["ASK_SUDO_PASSWORD"]
     require "highline/import"
@@ -21,9 +41,12 @@ RSpec.configure do |c|
       c.host  = host
       options = Net::SSH::Config.for(c.host)
       user    = options[:user] || Etc.getlogin
-      system("vagrant", "up", host)
-      system("vagrant", "provision", host)
-      config = `vagrant ssh-config #{host}`
+      config = nil
+      without_bundler do
+        system("vagrant", "up", host)
+        system("vagrant", "provision", host)
+        config = `vagrant ssh-config #{host}`
+      end
       if config != ""
         config.each_line do |line|
           if match = /HostName (.*)/.match(line)
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index