Module: Kernel

Defined in:
lib/jello/core_ext/kernel.rb

Instance Method Summary collapse

Instance Method Details

#__forever__Object



6
7
8
9
10
11
12
13
14
# File 'lib/jello/core_ext/kernel.rb', line 6

def __forever__
  begin
    while true
      yield
    end
  rescue Interrupt
    exit
  end
end

#forever(&block) ⇒ Object



2
3
4
# File 'lib/jello/core_ext/kernel.rb', line 2

def forever &block
  __forever__(&block ||= lambda {})
end

#silentlyObject

Execute some code without any warnings



17
18
19
20
21
22
# File 'lib/jello/core_ext/kernel.rb', line 17

def silently
  old_verbose, $VERBOSE = $VERBOSE, nil
  yield
ensure
  $VERBOSE = old_verbose
end