Created
February 10, 2010 13:16
-
-
Save kristianmandrup/300297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example - Upgrade an old Rails 2 app to Rails 3 app. | |
--- | |
Copy existing project (just in case!) | |
Use Rails template approach combined with Rails generators and a special Code refactoring library with Code refactoring operations. | |
- define different types of artifacts | |
- rails ruby file (*.rb) | |
- model file (app/models/**/*.rb) | |
- view file (app/views/**/*.rb) | |
- environment (config/environment.rb) | |
... | |
Define a Chain of Refactor steps for each type of artifact. | |
Each file is matched to one or more types of artifacts, and then chain of refactor steps is executed. | |
Common code matchings: | |
CONSTANT(::CONSTANT)*.message(args) | |
variable.(variable)*.message(args) | |
message(args) | |
# match on first end with same indentation (any tab converted to single space!) | |
statement do |args| | |
end | |
-- | |
DSL for code refactor operations using block, yield | |
Community should commit patches for different parts of app, plugin migrations etc. | |
Sweet! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment