watson-ruby icon indicating copy to clipboard operation
watson-ruby copied to clipboard

Not sure if explicit file close is required here [lib/watson/config.rb]

Open nhmood opened this issue 11 years ago • 0 comments

filename : lib/watson/config.rb line # : 423 tag : review md5 : ae184abbc1e4155a7575a3adb8c2c1b8

        # [review] - Not sure if explicit file close is required here
        _rc = File.open(@rc_file, 'r').read
        _update = File.open(@rc_file, 'w')


        # Keep index to print what line we are on
        # Could fool around with Enumerable + each_with_index but oh well
        _i = 0;
            # Keep track of newlines for prettying up the conf
        _nlc = 0
        _section = ""
            # Fix line endings so we can support Windows/Linux edited rc files
        _rc.gsub!(/\r\n?/, "\n")
        _rc.each_line do | _line |
            # Print line for debug purposes

nhmood avatar Nov 21 '13 16:11 nhmood