dgsuarez / reruby

Refactor Ruby
MIT License
35 stars 2 forks source link

CLI with references to files and positions #6

Closed dgsuarez closed 7 years ago

dgsuarez commented 7 years ago

The current CLI needs to be called with the full name of the class to modify (reruby rename_const My::BadClassName GoodClassName)

For better editor integration files + position is much better (reruby rename_const lib/my/bad_class_name:3 GoodClassName)

Is there a way for both options to coexist? Maybe by using a flag? reruby rename_const --file lib/my/bad_class_name:3 GoodClassName for example?

dgsuarez commented 7 years ago

A basic implementation is now available:

reruby rename_const -l lib/my_class.rb:3 NewClassName

Further work would be needed to do validation and location of entities other than namespace declarations. For now let's get this working on an editor plugin to see if it gels.