forked from tmm1/rbtrace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.rb
More file actions
47 lines (39 loc) · 686 Bytes
/
server.rb
File metadata and controls
47 lines (39 loc) · 686 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'ext/rbtrace'
require 'tmpdir'
class String
def multiply_vowels(num)
@test = 123
gsub(/[aeiou]/){ |m| m*num }
end
end
def fib(n)
curr = 0
succ = 1
n.times{ curr, succ = succ, curr + succ }
curr
end
(reload_test = proc{
Object.send(:remove_const, :Test) if defined? Test
Test = Class.new do
def self.run
:abc
end
end
}).call
while true
proc {
Dir.mktmpdir do |tmp|
Dir.chdir(tmp) do
Dir.pwd
Process.pid
'hello'.multiply_vowels(3){ :ohai }
sleep rand*0.5
ENV['blah']
GC.start
reload_test.call
Test.run
#fib(1024*100)
end
end
}.call
end