🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

Flay is blowing my mind

Published 2008-11-11 @ 19:46

Tagged flay, ruby

No, really. Flay is blowing my mind. It is just getting cooler and cooler. The next version of flay is going to have a verbose mode that will try to show an N-way diff:

  Matches found in :when (mass = 84)
    A: unit/itemconfig.rb:182
    B: unit/itemconfig.rb:192
    C: unit/itemconfig.rb:207
  
  A: when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join("|")})$/ then
  B: when /^(#{__item_listval_optkeys(tagid(tagOrId)).join("|")})$/ then
  C: when /^(#{__item_strval_optkeys(tagid(tagOrId)).join("|")})$/ then
  A:   num_or_str(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
  B:   simplelist(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
  C:   _fromUTF8(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))

And Patrick Ritchie recently submitted additional similarity reporting that I’m going to work on folding in soon. His version allows extra fuzzier matching of copy-pasted code that has been edited!

Soon I will write up why flay kicks towelee, PMD, and everyone else’s tool in the ass… But I think the above is a damn good start.