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: 373 of 197,744
Downloads: 143,163,140

Daily

Ranking: 695 of 197,724
Downloads: 62,487

Depended by

RankDownloadsName
1,34435,444,761html2haml
1,93117,277,353rubycritic
2,01515,577,200protocol
2,30110,630,704fasterer
2,4549,341,918hairtrigger
4,0542,890,235churn
4,3192,460,381roodi
6,536926,722dawnscanner
6,674879,921sourcify
7,748630,941wrong
8,131573,481partialruby
8,431525,205quality
9,160439,358ripper_ruby_parser
9,622392,334brakeman-min
10,133347,824rufus-treechecker
11,030288,072haml2slim
13,945176,028brakeman-lib
14,458164,642excellent
14,564162,428ruby_parser-legacy
15,579142,530dynamic_fieldsets

Depends on

RankDownloadsName
81,444,561,272rake
57753,562,495racc
147362,648,494rdoc
350153,936,392sexp_processor
2,4099,652,728hoe
20,21889,350oedipus_lex

Owners

#GravatarHandle
1iconzenspider