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: 371 of 197,051
Downloads: 142,302,007

Daily

Ranking: 641 of 197,010
Downloads: 44,286

Depended by

RankDownloadsName
1,33735,320,617html2haml
1,93517,061,952rubycritic
1,99915,527,851protocol
2,30510,522,255fasterer
2,4739,107,387hairtrigger
4,0452,877,959churn
4,2942,453,569roodi
6,521923,599dawnscanner
6,645878,460sourcify
7,716628,646wrong
8,094573,010partialruby
8,394523,601quality
9,105438,462ripper_ruby_parser
9,581391,349brakeman-min
10,101346,412rufus-treechecker
10,990287,390haml2slim
13,920175,152brakeman-lib
14,401164,281excellent
14,500162,033ruby_parser-legacy
15,516142,382dynamic_fieldsets

Depends on

RankDownloadsName
81,427,168,861rake
58742,885,748racc
150352,720,308rdoc
348152,873,380sexp_processor
2,4049,612,990hoe
20,25588,277oedipus_lex

Owners

#GravatarHandle
1iconzenspider