File: isolate.rb

package info (click to toggle)
ruby-zentest 4.11.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: ruby: 3,210; makefile: 13
file content (19 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
##
# Run autotest with isolate support.

module Autotest::Isolate
  @@dir = "tmp/isolate/#{Gem.ruby_engine}-#{RbConfig::CONFIG['ruby_version']}"

  def self.dir= o
    @@dir = o
  end

  Autotest.add_hook :initialize do |at|
    ENV["GEM_HOME"] = @@dir
    ENV["GEM_PATH"] = @@dir
    ENV["PATH"]    += ":#{@@dir}/bin"

    Gem.clear_paths
    false
  end
end