diff options
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 2 | ||||
-rw-r--r-- | railties/lib/rails/tasks/framework.rake | 5 | ||||
-rw-r--r-- | railties/lib/rails/tasks/restart.rake | 12 | ||||
-rw-r--r-- | railties/lib/rails/tasks/tmp.rake | 8 |
4 files changed, 12 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 65c91855da..fc1b62ee96 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -278,7 +278,7 @@ db_namespace = namespace :db do desc 'Clears a db/schema_cache.dump file.' task :clear => [:environment, :load_config] do filename = File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, "schema_cache.dump") - FileUtils.rm(filename) if File.exist?(filename) + rm_f filename, verbose: false end end diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index b28d47ef12..3e771167ee 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -1,4 +1,3 @@ -require 'fileutils' require 'active_support/deprecation' namespace :app do @@ -27,12 +26,12 @@ namespace :app do default_templates.each do |type, names| local_template_type_dir = File.join(project_templates, type) - FileUtils.mkdir_p local_template_type_dir + mkdir_p local_template_type_dir, verbose: false names.each do |name| dst_name = File.join(local_template_type_dir, name) src_name = File.join(generators_lib, type, name, "templates") - FileUtils.cp_r src_name, dst_name + cp_r src_name, dst_name, verbose: false end end end diff --git a/railties/lib/rails/tasks/restart.rake b/railties/lib/rails/tasks/restart.rake index 4f013484d3..3f98cbe51f 100644 --- a/railties/lib/rails/tasks/restart.rake +++ b/railties/lib/rails/tasks/restart.rake @@ -1,8 +1,8 @@ -require 'fileutils' - -desc "Restart app by touching tmp/restart.txt" +desc 'Restart app by touching tmp/restart.txt' task :restart do - FileUtils.mkdir_p('tmp') - FileUtils.touch('tmp/restart.txt') - FileUtils.rm_f('tmp/pids/server.pid') + verbose(false) do + mkdir_p 'tmp' + touch 'tmp/restart.txt' + rm_f 'tmp/pids/server.pid' + end end diff --git a/railties/lib/rails/tasks/tmp.rake b/railties/lib/rails/tasks/tmp.rake index deadb43892..c74a17a0ca 100644 --- a/railties/lib/rails/tasks/tmp.rake +++ b/railties/lib/rails/tasks/tmp.rake @@ -1,5 +1,3 @@ -require 'fileutils' - namespace :tmp do desc "Clear cache and socket files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear)" task clear: ["tmp:cache:clear", "tmp:sockets:clear"] @@ -17,21 +15,21 @@ namespace :tmp do namespace :cache do # desc "Clears all files and directories in tmp/cache" task :clear do - FileUtils.rm_rf(Dir['tmp/cache/[^.]*']) + rm_rf Dir['tmp/cache/[^.]*'], verbose: false end end namespace :sockets do # desc "Clears all files in tmp/sockets" task :clear do - FileUtils.rm(Dir['tmp/sockets/[^.]*']) + rm Dir['tmp/sockets/[^.]*'], verbose: false end end namespace :pids do # desc "Clears all files in tmp/pids" task :clear do - FileUtils.rm(Dir['tmp/pids/[^.]*']) + rm Dir['tmp/pids/[^.]*'], verbose: false end end end |