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: 339 of 188,987
Downloads: 133,115,683

Daily

Ranking: 638 of 188,969
Downloads: 41,272

Depended by

RankDownloadsName
1,28333,750,907html2haml
1,91814,883,025protocol
1,91914,877,011rubycritic
2,3059,225,454fasterer
2,6087,100,782hairtrigger
3,8712,738,049churn
4,0962,371,130roodi
6,042902,859safemode
6,144869,053dawnscanner
6,150866,339i18nliner
6,169860,747sourcify
7,266588,097wrong
7,431566,695partialruby
7,946498,448quality
8,540421,663ripper_ruby_parser
9,099367,217brakeman-min
9,511333,035rufus-treechecker
10,427274,312haml2slim
13,625159,415excellent
13,633159,292brakeman-lib

Depends on

RankDownloadsName
91,213,613,575rake
60617,746,907racc
177267,328,210rdoc
325141,954,938sexp_processor
2,3169,102,273hoe
20,94375,455oedipus_lex

Owners

#GravatarHandle
1iconzenspider