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: 377 of 198,430
Downloads: 144,037,655

Daily

Ranking: 635 of 198,401
Downloads: 54,421

Depended by

RankDownloadsName
1,35335,592,544html2haml
1,93217,508,667rubycritic
2,02715,630,587protocol
2,30410,747,544fasterer
2,4479,543,709hairtrigger
4,0682,901,558churn
4,3392,467,440roodi
6,561930,719dawnscanner
6,698881,280sourcify
7,767633,571wrong
8,171573,837partialruby
8,480526,251quality
9,195440,341ripper_ruby_parser
9,660393,580brakeman-min
10,174348,930rufus-treechecker
11,074289,004haml2slim
13,993176,981brakeman-lib
14,514165,118excellent
14,622162,951ruby_parser-legacy
15,644142,776dynamic_fieldsets

Depends on

RankDownloadsName
81,462,600,952rake
58765,258,535racc
142373,659,467rdoc
353155,056,779sexp_processor
2,4129,714,887hoe
20,19390,349oedipus_lex

Owners

#GravatarHandle
1iconzenspider