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: 334 of 187,950
Downloads: 131,456,007

Daily

Ranking: 646 of 187,922
Downloads: 37,402

Depended by

RankDownloadsName
1,27233,498,704html2haml
1,35229,961,894flay
1,50724,528,676flog
1,69518,514,231ruby2ruby
1,89514,780,846protocol
1,91714,442,858rubycritic
2,3059,000,677fasterer
2,6486,725,525hairtrigger
3,8292,714,122churn
4,0532,358,763roodi
5,1491,310,824debride
5,976898,125safemode
6,092859,652dawnscanner
6,100856,822i18nliner
6,106855,466sourcify
7,204581,922wrong
7,321565,089partialruby
7,861494,847quality
8,451419,337ripper_ruby_parser
9,070359,654brakeman-min

Depends on

RankDownloadsName
101,176,878,843rake
60592,199,131racc
180252,918,034rdoc
319140,014,604sexp_processor
2,3029,017,131hoe
21,10173,139oedipus_lex

Owners

#GravatarHandle
1iconzenspider