Module: Ykutils::DebugUtils

Included in:
FileOpUtils, SpecFileOp, StructuredText, StructuredTextForX, XLines, YamlXOp
Defined in:
lib/ykutils/debugutils.rb

Defined Under Namespace

Classes: DebugMes

Instance Method Summary collapse

Instance Method Details

#clear_dObject



34
35
36
# File 'lib/ykutils/debugutils.rb', line 34

def clear_d
  Ykutils::DebugUtils::DebugMes..clear
end

#dObject



43
44
45
# File 'lib/ykutils/debugutils.rb', line 43

def d
  self.class.get
end

#d_caller(_num) ⇒ Object



99
100
101
# File 'lib/ykutils/debugutils.rb', line 99

def d_caller(_num)
  pp caller(0) if get_debug
end

#d_exit(num) ⇒ Object

def warn

Ykutils::DebugUtils::DebugMes..get_warn

end



81
82
83
# File 'lib/ykutils/debugutils.rb', line 81

def d_exit(num)
  exit(num) if get_debug
end

#d_p(mes) ⇒ Object



111
112
113
# File 'lib/ykutils/debugutils.rb', line 111

def d_p(mes)
  p mes if get_debug
end

#d_pp(mes) ⇒ Object



115
116
117
118
119
120
121
122
# File 'lib/ykutils/debugutils.rb', line 115

def d_pp(mes)
  if debug
    pp "debug=#{debug}"
    pp caller(0)
    exit
  end
  pp mes if get_debug
end

#d_puts(str) ⇒ Object



85
86
87
# File 'lib/ykutils/debugutils.rb', line 85

def d_puts(str)
  puts(str) if get_debug
end

#d_puts_no_empty(mes) ⇒ Object



107
108
109
# File 'lib/ykutils/debugutils.rb', line 107

def d_puts_no_empty(mes)
  puts mes if (mes != "") && get_debug
end

#debug_utils_initObject



57
58
59
60
61
62
# File 'lib/ykutils/debugutils.rb', line 57

def debug_utils_init
  debug(false)
  set_warn(0)

  Ykutils::DebugUtils::DebugMes.init(false)
end

#error_exit(num) ⇒ Object



51
52
53
54
55
# File 'lib/ykutils/debugutils.rb', line 51

def error_exit(num)
  puts "error(#{num})"
  pp caller(0)
  exit(n)
end

#puts_current_methodObject



47
48
49
# File 'lib/ykutils/debugutils.rb', line 47

def puts_current_method
  d_puts caller(1)[0].split[-1]
end

#puts_d(mes) ⇒ Object



38
39
40
41
# File 'lib/ykutils/debugutils.rb', line 38

def puts_d(mes)
  Ykutils::DebugUtils::DebugMes..puts_x(mes)
  #    puts mes
end

#puts_no_empty(mes) ⇒ Object



103
104
105
# File 'lib/ykutils/debugutils.rb', line 103

def puts_no_empty(mes)
  puts mes if mes != ""
end

#w1_puts(str) ⇒ Object



89
90
91
92
# File 'lib/ykutils/debugutils.rb', line 89

def w1_puts(str)
  set_warn(0) unless get_warn
  puts(str) if get_debug || (get_warn >= 1)
end

#w2_puts(str) ⇒ Object



94
95
96
97
# File 'lib/ykutils/debugutils.rb', line 94

def w2_puts(str)
  set_warn(0) unless get_warn
  puts(str) if get_debug || (get_warn >= 2)
end