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,085
Downloads: 142,344,168

Daily

Ranking: 573 of 197,066
Downloads: 15,480

Depended by

RankDownloadsName
1,33735,327,000html2haml
1,93517,069,880rubycritic
1,99915,530,198protocol
2,30510,526,550fasterer
2,4729,123,819hairtrigger
4,0462,878,982churn
4,2952,454,074roodi
6,522923,751dawnscanner
6,648878,557sourcify
7,717628,845wrong
8,095573,024partialruby
8,396524,008quality
9,111438,609ripper_ruby_parser
9,582391,538brakeman-min
10,101346,473rufus-treechecker
10,994287,406haml2slim
13,919175,257brakeman-lib
14,407164,313excellent
14,504162,051ruby_parser-legacy
15,521142,383dynamic_fieldsets

Depends on

RankDownloadsName
81,428,256,062rake
58743,504,901racc
150353,290,307rdoc
349152,925,389sexp_processor
2,4059,615,266hoe
20,25588,387oedipus_lex

Owners

#GravatarHandle
1iconzenspider