Peter Marklund's Home
Have you ever tried upgrading Rails from version 1 to version 2? If not, you're in for a treat. Seriously though, it's not that bad, but depending on the size of your app, the number of plugins you use, and how badly you've patched Rails, your mileage may vary.
Here are some notes from an upgrade of this little weblog app just now:
As a bonus, here is a script to migrate your .rhtml view templates to the new .html.erb extension:
#!/usr/bin/env ruby # # change-extension <path> <from-extension> <to-extension> # # Command line script to recursively move all files under a certain directory from # one extension to another. Example usage: moving all .rhtml files in a Rails app to .html.erb to adopt # the new conventions in Rails 2. unless ARGV.size == 3 puts "Usage: : <path> <from-extension> <to-extension>" exit -1 end root_path, from_ext, to_ext = ARGV MOVE_COMMAND = "git mv" Dir[File.join(root_path, "**", "*.")].each do |from_path| to_path = from_path.chomp(from_ext) + to_ext command = " " puts command system(command) end
There you have it! Now you can enjoy Rails 2.3.2 in all its glory!