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: 357 of 193,553
Downloads: 138,175,598

Daily

Ranking: 812 of 193,540
Downloads: 11,310

Depended by

RankDownloadsName
1,31234,671,768html2haml
1,94316,073,968rubycritic
1,96915,243,470protocol
2,2959,938,127fasterer
2,5718,006,402hairtrigger
3,9612,810,746churn
4,2112,413,113roodi
6,294901,235dawnscanner
6,394870,755sourcify
7,578612,126wrong
7,911570,207partialruby
8,299507,313quality
8,966426,847ripper_ruby_parser
9,426380,938brakeman-min
9,915339,281rufus-treechecker
10,820279,969haml2slim
13,849168,386brakeman-lib
14,131161,741excellent
14,325157,298ruby_parser-legacy
15,205140,044dynamic_fieldsets

Depends on

RankDownloadsName
81,341,379,803rake
58689,441,834racc
164311,627,096rdoc
340147,984,571sexp_processor
2,3669,330,533hoe
20,89280,542oedipus_lex

Owners

#GravatarHandle
1iconzenspider