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: 325 of 186,698
Downloads: 129,100,348

Daily

Ranking: 1,122 of 186,685
Downloads: 7,099

Depended by

RankDownloadsName
1,01943,155,205gettext_i18n_rails
1,25133,075,681html2haml
1,34629,091,876flay
1,50023,732,900flog
1,68218,076,849ruby2ruby
1,83814,619,974protocol
1,88413,746,018rubycritic
2,2928,662,196fasterer
2,6506,400,071hairtrigger
3,7852,670,260churn
3,9852,335,464roodi
5,1771,239,287debride
5,906887,682safemode
6,028844,861sourcify
6,032842,749dawnscanner
6,042838,416i18nliner
7,135567,574wrong
7,170561,185partialruby
7,768487,825quality
8,324414,455ripper_ruby_parser

Depends on

RankDownloadsName
101,125,994,016rake
67548,154,633racc
190230,670,698rdoc
309137,287,509sexp_processor
2,2558,886,031hoe
21,39669,027oedipus_lex

Owners

#GravatarHandle
1iconzenspider