Categories: None [Edit]

ruby_parser

https://rubygems.org/gems/ruby_parser
https://github.com/seattlerb/ruby_parser
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension). It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem. As an example: def conditional1 arg1 return 1 if arg1 == 0 return 0 end becomes: s(:defn, :conditional1, s(:args, :arg1), s(:if, s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0))) Tested against 801,039 files from the latest of all rubygems (as of 2013-05): * 1.8 parser is at 99.9739% accuracy, 3.651 sigma * 1.9 parser is at 99.9940% accuracy, 4.013 sigma * 2.0 parser is at 99.9939% accuracy, 4.008 sigma * 2.6 parser is at 99.9972% accuracy, 4.191 sigma * 3.0 parser has a 100% parse rate. * Tested against 2,672,412 unique ruby files across 167k gems. * As do all the others now, basically.

Total

Ranking: 338 of 188,572
Downloads: 132,518,993

Daily

Ranking: 535 of 188,550
Downloads: 26,708

Depended by

RankDownloadsName
1,28033,663,736html2haml
1,91514,849,673protocol
1,91814,720,847rubycritic
2,3079,146,682fasterer
2,6236,950,292hairtrigger
3,8602,730,255churn
4,0822,367,020roodi
6,019901,519safemode
6,113865,512dawnscanner
6,122863,192i18nliner
6,139859,345sourcify
7,246585,708wrong
7,397566,275partialruby
7,910497,734quality
8,513420,893ripper_ruby_parser
9,084364,873brakeman-min
9,498331,154rufus-treechecker
10,384273,913haml2slim
12,317193,139mvz-live_ast
13,578159,037excellent

Depends on

RankDownloadsName
101,198,049,204rake
60609,324,029racc
176262,269,964rdoc
325141,251,943sexp_processor
2,3129,075,852hoe
20,97074,895oedipus_lex

Owners

#GravatarHandle
1iconzenspider