RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

synvert = syntax + convert

synvert is a very interesting project we are working on now, it can parse your ruby source code, find out old deprecated ruby code and then automatically replace them with new better syntax ruby code according to predefined rules.

We already define 4 snippets (predefined rules),

1. use FactoryGirl short syntax, e.g. replace FactoryGirl.create(:post) with create(:post)
2. convert dynamic finders, e.g. replace User.find_all_by_login_and_active('name', true) with User.where(login: 'name', active: true)
3. use strong_parameters, remove attr_accessible in models and add def xxx_params; end in controllers
4. automatically upgrade rails 3.2 to rails 4.0

synvert is still in alpha stage, any suggestions or pull requests are welcome.

Comments

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!