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: 348 of 191,296
Downloads: 135,215,401

Daily

Ranking: 589 of 191,254
Downloads: 53,281

Depended by

RankDownloadsName
1,29734,157,731html2haml
1,93015,420,467rubycritic
1,95115,017,274protocol
2,2899,519,688fasterer
2,6157,456,809hairtrigger
3,9152,768,630churn
4,1502,387,251roodi
6,114912,474safemode
6,198880,477dawnscanner
6,250865,555sourcify
7,335597,722wrong
7,570568,238partialruby
8,036501,851quality
8,667423,282ripper_ruby_parser
9,166372,780brakeman-min
9,627335,942rufus-treechecker
10,546276,083haml2slim
13,616163,953brakeman-lib
13,762160,533excellent
14,136152,437ruby_parser-legacy

Depends on

RankDownloadsName
81,268,799,165rake
58651,264,360racc
169286,411,581rdoc
332144,453,452sexp_processor
2,3369,186,378hoe
20,81477,664oedipus_lex

Owners

#GravatarHandle
1iconzenspider