Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Programs that rewrite Ruby programs (thomasleecopeland.com)
77 points by tcopeland on Sept 21, 2016 | hide | past | favorite | 8 comments


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.


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.


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!


Are you a Lisper?


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/


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...

not "smart" but worked well enough for me


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


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: