Bug 33554 - run-webkit-tests fails on Ruby 1.9
Summary: run-webkit-tests fails on Ruby 1.9
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 14:59 PST by Janusz Lewandowski
Modified: 2010-01-22 10:23 PST (History)
1 user (show)

See Also:


Attachments
Bugfix (1.72 KB, patch)
2010-01-12 15:13 PST, Janusz Lewandowski
hamaji: review-
Details | Formatted Diff | Diff
Corrected fix (2.06 KB, patch)
2010-01-13 13:09 PST, Janusz Lewandowski
no flags Details | Formatted Diff | Diff
Revised patch (1.65 KB, patch)
2010-01-21 19:02 PST, Shinichiro Hamaji
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Lewandowski 2010-01-12 14:59:52 PST
inject does not work with strings any more, so BugsSite/PrettyPatch/PrettyPatch.rb prints lots of errors.
Comment 1 Janusz Lewandowski 2010-01-12 15:13:24 PST
Created attachment 46402 [details]
Bugfix
Comment 2 Shinichiro Hamaji 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?
Comment 3 Janusz Lewandowski 2010-01-13 13:09:10 PST
Created attachment 46496 [details]
Corrected fix
Comment 4 Janusz Lewandowski 2010-01-13 13:30:08 PST
Comment on attachment 46496 [details]
Corrected fix

Patch regressed... I'll try to do something with it.
Comment 5 Shinichiro Hamaji 2010-01-21 19:02:21 PST
Created attachment 47171 [details]
Revised patch
Comment 6 Shinichiro Hamaji 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!
Comment 7 Maciej Stachowiak 2010-01-22 01:57:50 PST
Comment on attachment 47171 [details]
Revised patch

r=me
Comment 8 Shinichiro Hamaji 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>
Comment 9 Shinichiro Hamaji 2010-01-22 06:13:48 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Janusz Lewandowski 2010-01-22 10:23:33 PST
Thanks Shinichiro, I've got lost in Ruby's syntax...