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: 342 of 189,432
Downloads: 133,669,470

Daily

Ranking: 713 of 189,408
Downloads: 36,934

Depended by

RankDownloadsName
1,28833,832,474html2haml
1,92315,046,645rubycritic
1,92914,918,735protocol
2,3019,306,931fasterer
2,6217,197,969hairtrigger
3,8822,746,266churn
4,1082,375,039roodi
6,067903,770safemode
6,158872,047dawnscanner
6,168869,601i18nliner
6,198861,986sourcify
7,285589,890wrong
7,463567,287partialruby
7,972499,299quality
8,571422,038ripper_ruby_parser
9,108369,021brakeman-min
9,545334,081rufus-treechecker
10,455274,661haml2slim
13,569162,050brakeman-lib
13,669159,787excellent

Depends on

RankDownloadsName
91,232,715,961rake
58630,199,212racc
176272,366,605rdoc
327142,620,497sexp_processor
2,3209,127,249hoe
20,92875,958oedipus_lex

Owners

#GravatarHandle
1iconzenspider