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: 365 of 196,106
Downloads: 140,718,081

Daily

Ranking: 691 of 196,079
Downloads: 22,689

Depended by

RankDownloadsName
1,33035,089,222html2haml
1,93516,693,266rubycritic
1,99115,422,556protocol
2,30510,288,816fasterer
2,5078,658,679hairtrigger
4,0192,850,756churn
4,2732,437,938roodi
6,485917,472dawnscanner
6,599875,537sourcify
7,681623,048wrong
8,020572,200partialruby
8,366516,498quality
9,052435,002ripper_ruby_parser
9,515389,096brakeman-min
10,039344,009rufus-treechecker
10,914285,285haml2slim
13,866173,430brakeman-lib
14,305163,412excellent
14,412160,597ruby_parser-legacy
15,374142,138dynamic_fieldsets

Depends on

RankDownloadsName
81,393,995,228rake
58722,407,837racc
154336,079,615rdoc
346150,971,465sexp_processor
2,3809,506,771hoe
20,45785,654oedipus_lex

Owners

#GravatarHandle
1iconzenspider