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: 349 of 192,034
Downloads: 136,029,459

Daily

Ranking: 603 of 191,980
Downloads: 50,151

Depended by

RankDownloadsName
1,29734,316,498html2haml
1,93515,608,822rubycritic
1,95615,072,063protocol
2,2919,634,238fasterer
2,6047,586,463hairtrigger
3,9182,780,605churn
4,1632,395,784roodi
6,130917,291safemode
6,219886,831dawnscanner
6,280867,284sourcify
7,357601,429wrong
7,647569,108partialruby
8,055503,262quality
8,702424,991ripper_ruby_parser
9,210374,703brakeman-min
9,674336,844rufus-treechecker
10,595277,362haml2slim
13,655164,996brakeman-lib
13,845160,768excellent
14,189153,349ruby_parser-legacy

Depends on

RankDownloadsName
81,288,231,282rake
58662,102,067racc
167293,315,782rdoc
332145,420,370sexp_processor
2,3439,222,992hoe
20,84378,244oedipus_lex

Owners

#GravatarHandle
1iconzenspider