vrobot4/source/common.rb

24 lines
459 B
Ruby
Raw Normal View History

module Vrobot4
2017-08-11 15:16:16 -07:00
Version = "4.00".freeze
2017-08-06 16:27:36 -07:00
@@debug = 0
def self.debug= set; @@debug = set; end
def self.debug ; @@debug; end
def self.log lv, *text
2017-08-06 16:27:36 -07:00
if (lv != :DEBUG || @@debug >= 1) &&
(lv != :DEBUGV || @@debug >= 2)
puts "[" + lv.to_s.ljust(6) + "] " + text.join(" ")
2017-08-11 15:16:16 -07:00
true
else
false
end
end
2017-08-11 15:16:16 -07:00
def self.is_num? str
/\A[-+]?[0-9]*\.?[0-9]+\Z/ === str
end
end
## EOF