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: 380 of 199,228
Downloads: 144,888,069

Daily

Ranking: 669 of 199,184
Downloads: 57,742

Depended by

RankDownloadsName
1,35735,733,038html2haml
1,92817,749,326rubycritic
2,04015,680,627protocol
2,30710,862,293fasterer
2,4289,738,452hairtrigger
4,0822,916,047churn
4,3522,478,096roodi
6,583933,609dawnscanner
6,725882,536sourcify
7,810636,325wrong
8,208574,521partialruby
8,512528,292quality
9,241441,145ripper_ruby_parser
9,694395,685brakeman-min
10,199350,096rufus-treechecker
11,118290,061haml2slim
14,002178,826brakeman-lib
14,589165,637excellent
14,667163,819ruby_parser-legacy
15,697143,228dynamic_fieldsets

Depends on

RankDownloadsName
71,480,270,976rake
58776,907,388racc
142384,735,258rdoc
354156,212,321sexp_processor
2,4079,898,711hoe
20,15991,718oedipus_lex

Owners

#GravatarHandle
1iconzenspider