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: 293 of 180,402
Downloads: 109,122,627

Daily

Ranking: 352 of 180,392
Downloads: 72,370

Depended by

RankDownloadsName
1,02830,396,857html2haml
1,08927,347,787gettext_i18n_rails
1,15925,041,366flay
1,33620,065,185flog
1,51515,522,873ruby2ruby
1,74910,992,891rubycritic
2,0567,595,990protocol
2,2096,634,733fasterer
2,6624,552,156hairtrigger
3,5752,274,049churn
3,6072,218,251roodi
5,155922,873debride
5,341846,251safemode
5,529777,451sourcify
5,569764,122i18nliner
5,648740,759dawnscanner
6,589521,721partialruby
6,721495,688wrong
6,920462,031quality
7,367400,550ripper_ruby_parser

Depends on

RankDownloadsName
16851,212,111rake
101311,423,506racc
214146,124,327rdoc
269116,191,684sexp_processor
1,9528,404,214hoe
22,80654,523oedipus_lex

Owners

#GravatarHandle
1iconzenspider