Skip to content
Browse files

Merge pull request #10 from romanvbabenko/master

Fix "undefined method blank?"
  • Loading branch information...
2 parents 5f3a37e + da8ff53 commit c9318b1a58533579e7c146f3034abec7592d1d21 @radar radar committed May 15, 2011
Showing with 13 additions and 12 deletions.
  1. +1 −1 init.rb
  2. +12 −11 lib/tasks/rails_upgrade_tasks.rake
View
2 init.rb
@@ -1,2 +1,2 @@
# Get long stack traces for easier debugging; you'll thank me later.
-Rails.backtrace_cleaner.remove_silencers!
+Rails.backtrace_cleaner.remove_silencers! if Rails.respond_to?(:backtrace_cleaner)
View
23 lib/tasks/rails_upgrade_tasks.rake
@@ -3,6 +3,7 @@ require 'routes_upgrader'
require 'gemfile_generator'
require 'application_checker'
require 'new_configuration_generator'
+require "active_support"
require 'fileutils'
@@ -13,35 +14,35 @@ namespace :rails do
checker = Rails::Upgrading::ApplicationChecker.new
checker.run
end
-
+
desc "Generates a Gemfile for your Rails 3 app out of your config.gem directives"
task :gems do
generator = Rails::Upgrading::GemfileGenerator.new
new_gemfile = generator.generate_new_gemfile
-
+
puts new_gemfile
end
-
+
desc "Create a new, upgraded route file from your current routes.rb"
task :routes do
upgrader = Rails::Upgrading::RoutesUpgrader.new
new_routes = upgrader.generate_new_routes
-
+
puts new_routes
end
-
+
desc "Extracts your configuration code so you can create a new config/application.rb"
task :configuration do
upgrader = Rails::Upgrading::NewConfigurationGenerator.new
new_config = upgrader.generate_new_application_rb
-
+
puts new_config
end
-
+
CLEAR = "\e[0m"
CYAN = "\e[36m"
WHITE = "\e[37m"
-
+
desc "Backs up your likely modified files so you can run the Rails 3 generator on your app with little risk"
task :backup do
files = [".gitignore",
@@ -56,19 +57,19 @@ namespace :rails do
"config.ru",
"doc/README_FOR_APP",
"test/test_helper.rb"]
-
+
puts
files.each do |f|
if File.exist?(f)
puts "#{CYAN}* #{CLEAR}backing up #{WHITE}#{f}#{CLEAR} to #{WHITE}#{f}.rails2#{CLEAR}"
FileUtils.cp(f, "#{f}.rails2")
end
end
-
+
puts
puts "This is a list of the files analyzed and backed up (if they existed);\nyou will probably not want the generator to replace them since\nyou probably modified them (but now they're safe if you accidentally do!)."
puts
-
+
files.each do |f|
puts "#{CYAN}- #{CLEAR}#{f}"
end

0 comments on commit c9318b1

Please sign in to comment.
Something went wrong with that request. Please try again.