watson-ruby
watson-ruby copied to clipboard
Use if with match so we can call next on the line reading loop [lib/watson/config.rb]
filename : lib/watson/config.rb line # : 266 tag : review md5 : 6642f7af20c07b5ad49b005bb5466c72
# [review] - Use if with match so we can call next on the line reading loop
# Tried using match(){|_mtch|} as well as do |_mtch| but those don't seem to
# register the next call to the outer loop, so this way will do for now
# Regex on line to find out if we are in a new [section] of
# config parameters. If so, store it into section var and move
# to next line
_mtch = _line.match(/^\[(\w+)\]/)
if _mtch
debug_print "Found section #{ _mtch[1] }\n"
_section = _mtch[1]
next
end
case _section
when "context_depth"