Skip to content

Instantly share code, notes, and snippets.

@qrush
Created January 9, 2010 20:18
Show Gist options
  • Save qrush/273075 to your computer and use it in GitHub Desktop.
Save qrush/273075 to your computer and use it in GitHub Desktop.
diff --git a/lib/integrity/builder.rb b/lib/integrity/builder.rb
index 6968d9e..691ff70 100644
--- a/lib/integrity/builder.rb
+++ b/lib/integrity/builder.rb
@@ -46,7 +46,8 @@ module Integrity
end
def run
- cmd = "(cd #{repo.directory} && #{@build.project.command} 2>&1)"
+ cmd = "(cd #{repo.directory} && RUBYOPT=#{pre_bundler_rubyopt} PATH=#{pre_bundler_path} && #{@build.project.command} 2>&1)"
+ Integrity.log cmd
IO.popen(cmd, "r") { |io| @output = io.read }
@status = $?.success?
end
@@ -58,5 +59,14 @@ module Integrity
def commit
@build.commit.identifier
end
+
+ private
+ def pre_bundler_path
+ ENV['PATH'] && ENV["PATH"].split(":").reject { |path| path.include?("vendor") }.join(":")
+ end
+
+ def pre_bundler_rubyopt
+ ENV['RUBYOPT'] && ENV["RUBYOPT"].split.reject { |opt| opt.include?("vendor") }.join(" ")
+ end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment