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: 354 of 193,081
Downloads: 137,444,194

Daily

Ranking: 537 of 193,053
Downloads: 32,078

Depended by

RankDownloadsName
1,31034,558,082html2haml
1,93915,912,435rubycritic
1,96615,195,514protocol
2,2959,821,368fasterer
2,5837,857,815hairtrigger
3,9402,800,530churn
4,1932,407,576roodi
6,179921,579safemode
6,266896,369dawnscanner
6,345869,635sourcify
7,434608,748wrong
7,750569,755partialruby
8,134506,292quality
8,816426,139ripper_ruby_parser
9,414378,179brakeman-min
9,882338,629rufus-treechecker
10,791279,080haml2slim
13,836166,919brakeman-lib
14,088161,404excellent
14,288156,704ruby_parser-legacy

Depends on

RankDownloadsName
81,324,961,978rake
58680,238,296racc
165305,298,066rdoc
337147,123,150sexp_processor
2,3619,287,504hoe
20,93579,632oedipus_lex

Owners

#GravatarHandle
1iconzenspider