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: 343 of 189,933
Downloads: 134,281,230

Daily

Ranking: 615 of 189,920
Downloads: 30,683

Depended by

RankDownloadsName
1,29433,947,217html2haml
1,92415,206,715rubycritic
1,94014,957,031protocol
2,2939,396,181fasterer
2,6197,306,125hairtrigger
3,8942,756,397churn
4,1252,380,382roodi
6,091905,722safemode
6,184874,850dawnscanner
6,192873,502i18nliner
6,234863,140sourcify
7,308593,378wrong
7,512567,769partialruby
7,999500,813quality
8,606422,726ripper_ruby_parser
9,133371,042brakeman-min
9,584334,930rufus-treechecker
10,497275,259haml2slim
13,579163,124brakeman-lib
13,705160,125excellent

Depends on

RankDownloadsName
81,248,043,640rake
58639,616,252racc
171278,590,807rdoc
329143,351,648sexp_processor
2,3299,152,247hoe
20,89876,575oedipus_lex

Owners

#GravatarHandle
1iconzenspider