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: 295 of 183,139
Downloads: 120,803,627

Daily

Ranking: 839 of 183,127
Downloads: 21,159

Depended by

RankDownloadsName
1,04034,627,543gettext_i18n_rails
1,09631,612,475html2haml
1,24426,617,070flay
1,39321,540,949flog
1,59916,586,841ruby2ruby
1,71713,882,187protocol
1,82112,033,746rubycritic
2,2567,411,215fasterer
2,6355,302,547hairtrigger
3,6452,460,479churn
3,7882,265,999roodi
5,2131,033,063debride
5,587866,768safemode
5,763805,042sourcify
5,790793,916i18nliner
5,808790,841dawnscanner
6,783545,434partialruby
6,882525,524wrong
7,187474,559quality
7,692408,034ripper_ruby_parser

Depends on

RankDownloadsName
10954,857,689rake
84401,204,567racc
210168,249,756rdoc
280128,511,551sexp_processor
2,0898,575,570hoe
22,02861,182oedipus_lex

Owners

#GravatarHandle
1iconzenspider