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: 350 of 192,505
Downloads: 136,690,917

Daily

Ranking: 639 of 192,483
Downloads: 45,833

Depended by

RankDownloadsName
1,31034,428,418html2haml
1,93715,754,681rubycritic
1,96215,131,251protocol
2,2959,715,839fasterer
2,5967,715,644hairtrigger
3,9292,790,370churn
4,1762,401,075roodi
6,144919,087safemode
6,238891,563dawnscanner
6,309868,437sourcify
7,384605,300wrong
7,695569,435partialruby
8,098504,547quality
8,758425,485ripper_ruby_parser
9,261376,132brakeman-min
9,723337,807rufus-treechecker
10,736277,961haml2slim
13,810165,876brakeman-lib
14,028161,071excellent
14,300154,928ruby_parser-legacy

Depends on

RankDownloadsName
81,306,403,856rake
58670,952,303racc
165299,004,962rdoc
336146,210,042sexp_processor
2,3539,250,942hoe
20,94278,850oedipus_lex

Owners

#GravatarHandle
1iconzenspider