lib/smcutil/file_reader.rb in smcutil-0.1.4 vs lib/smcutil/file_reader.rb in smcutil-0.1.5

- old
+ new

@@ -20,10 +20,13 @@ # Zero based indexing is not compatible with how people think about lines in a file index += 1 # Prepare to parse the line line ||= line.strip! - puts "INFO: #{line}" && next if line.nil? or line.start_with? '#' + + puts "INFO: #{line}" if line.start_with?('#') + + next if line.nil? || line.start_with?('#') match = LINE_COMMAND.match(line) raise "LINE #{index}: Does not match format" unless match # Validate Length raise "LINE #{index}: Length mismatch on line; expected #{match[:length]}, got #{match[:data].length / 2}" unless match[:length].to_i == match[:data].length / 2 \ No newline at end of file