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: 351 of 192,692
Downloads: 136,875,182

Daily

Ranking: 795 of 192,666
Downloads: 11,009

Depended by

RankDownloadsName
1,30834,462,991html2haml
1,93715,792,701rubycritic
1,96415,149,946protocol
2,2949,736,524fasterer
2,5907,749,921hairtrigger
3,9292,793,187churn
4,1792,402,748roodi
6,149919,622safemode
6,240893,162dawnscanner
6,321868,723sourcify
7,399606,239wrong
7,724569,505partialruby
8,110505,130quality
8,768425,669ripper_ruby_parser
9,315376,724brakeman-min
9,858338,006rufus-treechecker
10,761278,544haml2slim
13,817166,159brakeman-lib
14,040161,141excellent
14,302155,181ruby_parser-legacy

Depends on

RankDownloadsName
81,311,002,349rake
58673,199,344racc
165300,498,183rdoc
336146,433,788sexp_processor
2,3549,260,232hoe
20,94179,034oedipus_lex

Owners

#GravatarHandle
1iconzenspider