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: 331 of 187,571
Downloads: 130,917,773

Daily

Ranking: 598 of 187,548
Downloads: 37,972

Depended by

RankDownloadsName
1,26933,413,363html2haml
1,34929,772,467flay
1,50224,351,609flog
1,69418,409,351ruby2ruby
1,88714,738,354protocol
1,91414,295,478rubycritic
2,3078,915,433fasterer
2,6486,646,861hairtrigger
3,8182,703,676churn
4,0382,353,478roodi
5,1571,294,988debride
5,961896,106safemode
6,076855,690dawnscanner
6,081853,384sourcify
6,083853,065i18nliner
7,183578,700wrong
7,270564,545partialruby
7,837493,226quality
8,423418,744ripper_ruby_parser
9,050357,065brakeman-min

Depends on

RankDownloadsName
101,165,196,519rake
62582,912,236racc
183248,062,731rdoc
318139,384,189sexp_processor
2,2988,985,762hoe
21,12372,435oedipus_lex

Owners

#GravatarHandle
1iconzenspider