RESOLVED FIXED Bug 33554
run-webkit-tests fails on Ruby 1.9
https://bugs.webkit.org/show_bug.cgi?id=33554
Summary run-webkit-tests fails on Ruby 1.9
Janusz Lewandowski
Reported 2010-01-12 14:59:52 PST
inject does not work with strings any more, so BugsSite/PrettyPatch/PrettyPatch.rb prints lots of errors.
Attachments
Bugfix (1.72 KB, patch)
2010-01-12 15:13 PST, Janusz Lewandowski
hamaji: review-
Corrected fix (2.06 KB, patch)
2010-01-13 13:09 PST, Janusz Lewandowski
no flags
Revised patch (1.65 KB, patch)
2010-01-21 19:02 PST, Shinichiro Hamaji
no flags
Janusz Lewandowski
Comment 1 2010-01-12 15:13:24 PST
Shinichiro Hamaji
Comment 2 2010-01-12 23:52:57 PST
Comment on attachment 46402 [details] Bugfix > def self.parse(string) > haveSeenDiffHeader = false > - linesForDiffs = string.inject([]) do |diffChunks, line| > + diffChunks = linesForDiffs = [] > + string.each_line do |line| > if (PrettyPatch.diff_header?(line)) > diffChunks << [] > haveSeenDiffHeader = true I think the local variable diffChunks isn't necessary anymore?
Janusz Lewandowski
Comment 3 2010-01-13 13:09:10 PST
Created attachment 46496 [details] Corrected fix
Janusz Lewandowski
Comment 4 2010-01-13 13:30:08 PST
Comment on attachment 46496 [details] Corrected fix Patch regressed... I'll try to do something with it.
Shinichiro Hamaji
Comment 5 2010-01-21 19:02:21 PST
Created attachment 47171 [details] Revised patch
Shinichiro Hamaji
Comment 6 2010-01-21 19:03:13 PST
I meant the use of diffChunks can be replaced by linesForDiffs. Sorry for confusing you. I revised the patch based on Janusz's patch. I confirmed my patch works with both ruby 1.8 and 1.9. I used this file as the example input: https://bug-31395-attachments.webkit.org/attachment.cgi?id=43039 Thanks Janusz for finding this issue and submitting patches!
Maciej Stachowiak
Comment 7 2010-01-22 01:57:50 PST
Comment on attachment 47171 [details] Revised patch r=me
Shinichiro Hamaji
Comment 8 2010-01-22 06:13:40 PST
Comment on attachment 47171 [details] Revised patch Clearing flags on attachment: 47171 Committed r53700: <http://trac.webkit.org/changeset/53700>
Shinichiro Hamaji
Comment 9 2010-01-22 06:13:48 PST
All reviewed patches have been landed. Closing bug.
Janusz Lewandowski
Comment 10 2010-01-22 10:23:33 PST
Thanks Shinichiro, I've got lost in Ruby's syntax...
Note You need to log in before you can comment on or make changes to this bug.