
Programs that rewrite Ruby programs - tcopeland
http://thomasleecopeland.com/2016/09/20/programs-that-rewrite-ruby-programs.html
======
Sivart13
Author of `rails5-spec-converter` here. I've been looking for ways to
advertise this gem and wouldn't have guessed someone would find it via the
reverse_dependencies API :)

I don't think there's anything RSpec-specific in the gem other than the
default filename glob, which you can override on the command line. If there
are any other issues transforming non-RSpec suites I'd love to fix them.

------
jfoutz
I forget who said it, but "Programs that write programs are the happiest
programs of all".

I find these kinds of transformations _so much fun_ they're like the coolest
part of programming.

~~~
whateveracct
Some FPers argue that all programs should just be written as compositions of
compilers and interpreters ;) so everything can be the coolest part of
programming!

------
easong
If anyone is looking for a similar tool for JS, I've used codemods to great
effect.

[https://vramana.github.io/blog/2015/12/21/codemod-
tutorial/](https://vramana.github.io/blog/2015/12/21/codemod-tutorial/)

------
meesterdude
Relatedly, I wrote this to automatically rewrite rails controllers that wanted
to implement strong params

[http://ruru.name/entries/upgrading-rails-to-use-strong-
param...](http://ruru.name/entries/upgrading-rails-to-use-strong-params-
automatically)

not "smart" but worked well enough for me

------
benlovell
Rubocop does a similar job, also thanks in part to the parser library.

------
JoelMcCracken
I have been wanting to toy with doing this for a long time now. After seeing
this, maybe I will get around to it.

