rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob c0801277273c21450008aafaa892347b225143a1 579 bytes (raw)
$ git show HEAD:t/test_isolate_cramp.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
require 'rubygems'
require 'isolate'
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'

path = "tmp/isolate/#{engine}-#{RUBY_VERSION}/cramp"
opts = {
  :system => false,
  # we want "ruby-1.8.7" and not "ruby-1.8", so disable multiruby
  :multiruby => false,
  :path => path,
}

old_out = $stdout.dup
$stdout.reopen($stderr)

lock = File.open(__FILE__, "rb")
lock.flock(File::LOCK_EX)
Isolate.now!(opts) do
  if engine == "ruby"
    gem 'cramp', '0.15'
  end
end

$stdout.reopen(old_out)
dirs = Dir["#{path}/gems/*-*/lib"]
puts dirs.map { |x| File.expand_path(x) }.join(':')

git clone https://yhbt.net/rainbows.git