watson-ruby
watson-ruby copied to clipboard
Not sure if explicit file close is required here [lib/watson/config.rb]
filename : lib/watson/config.rb line # : 239 tag : review md5 : ae184abbc1e4155a7575a3adb8c2c1b8
# [review] - Not sure if explicit file close is required here
_rc = File.open(@rc_file, 'r').read
debug_print "\n\n"
# Create temp section var to keep track of what we are populating in config
_section = ""
# Keep index to print what line we are on
# Could fool around with Enumerable + each_with_index but oh well
_i = 0;
# Fix line endings so we can support Windows/Linux edited rc files
_rc.gsub!(/\r\n?/, "\n")
_rc.each_line do | _line |
debug_print "#{ _i }: #{ _line }" if (_line != "\n")
_i = _i + 1