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: 367 of 196,721
Downloads: 141,488,908

Daily

Ranking: 680 of 196,694
Downloads: 22,397

Depended by

RankDownloadsName
1,33235,202,252html2haml
1,93316,876,597rubycritic
1,99615,482,943protocol
2,30510,393,997fasterer
2,4928,866,622hairtrigger
4,0312,865,187churn
4,2882,446,287roodi
6,505920,512dawnscanner
6,619876,754sourcify
7,703625,770wrong
8,054572,502partialruby
8,380519,836quality
9,076436,399ripper_ruby_parser
9,543389,633brakeman-min
10,068345,179rufus-treechecker
10,954285,924haml2slim
13,903173,864brakeman-lib
14,338163,885excellent
14,443161,398ruby_parser-legacy
15,444142,197dynamic_fieldsets

Depends on

RankDownloadsName
81,410,641,125rake
58732,616,779racc
152344,213,097rdoc
347151,885,747sexp_processor
2,3909,558,724hoe
20,31287,202oedipus_lex

Owners

#GravatarHandle
1iconzenspider