Top Level Namespace

Includes:
FFI::Clang

Defined Under Namespace

Modules: LibDetect Classes: Docurium

Instance Method Summary collapse

Instance Method Details

#debug(str = nil) ⇒ Object



7
8
9
# File 'lib/docurium/debug.rb', line 7

def debug(str = nil)
  puts str if debug_enabled
end

#debug_enableObject



11
12
13
# File 'lib/docurium/debug.rb', line 11

def debug_enable
  $debug_stack.push true
end

#debug_enabledObject



3
4
5
# File 'lib/docurium/debug.rb', line 3

def debug_enabled
  $debug_stack[-1]
end

#debug_passObject



23
24
25
# File 'lib/docurium/debug.rb', line 23

def debug_pass
  $debug_stack.push debug_enabled
end

#debug_restoreObject



27
28
29
# File 'lib/docurium/debug.rb', line 27

def debug_restore
  $debug_stack.pop
end

#debug_set(val) ⇒ Object



19
20
21
# File 'lib/docurium/debug.rb', line 19

def debug_set val
  $debug_stack.push val
end

#debug_silenceObject



15
16
17
# File 'lib/docurium/debug.rb', line 15

def debug_silence
  $debug_stack.push false
end

#with_debug(&block) ⇒ Object



31
32
33
34
35
# File 'lib/docurium/debug.rb', line 31

def with_debug(&block)
  debug_enable
  block.call
  debug_restore
end

#without_debug(&block) ⇒ Object



37
38
39
40
41
# File 'lib/docurium/debug.rb', line 37

def without_debug(&block)
  debug_silence
  block.call
  debug_restore
end