File: server.rb

package info (click to toggle)
ruby-rbtrace 0.4.11-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 704 kB
  • sloc: ruby: 1,060; ansic: 892; sh: 40; makefile: 3
file content (44 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (3)
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
require 'ext/rbtrace'

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.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
  }.call
end