From: aaron.lasseigne@... Date: 2017-12-28T23:11:16+00:00 Subject: [ruby-core:84552] [Ruby trunk Bug#14257] the chomp option removes newlines in additon to the provided separator for String#each_line and String#lines Issue #14257 has been reported by AaronLasseigne (Aaron Lasseigne). ---------------------------------------- Bug #14257: the chomp option removes newlines in additon to the provided separator for String#each_line and String#lines https://bugs.ruby-lang.org/issues/14257 * Author: AaronLasseigne (Aaron Lasseigne) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- I'm not entirely sure this is a bug but I had a hard time finding anything that indicated that the change was on purpose. The `chomp` option would remove the provided separator from each line. Now it does that and it also removes newlines. 2.4 ~~~ ruby > "a b c d\n".lines(' ', chomp: true) => ["a", "b", "c", "d\n"] ~~~ 2.5 ~~~ ruby > "a b c d\n".lines(' ', chomp: true) => ["a", "b", "c", "d"] ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: