aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/commands.rb1
-rw-r--r--railties/lib/rails/commands/dev_cache.rb21
-rw-r--r--railties/lib/rails/tasks.rb1
-rw-r--r--railties/lib/rails/tasks/dev.rake14
4 files changed, 15 insertions, 22 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index 7627fcf5a0..fa47c52b96 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -14,6 +14,5 @@ command = ARGV.shift
command = aliases[command] || command
require 'rails/command'
-require 'rails/commands/dev_cache'
Rails::Command.run(command, ARGV)
diff --git a/railties/lib/rails/commands/dev_cache.rb b/railties/lib/rails/commands/dev_cache.rb
deleted file mode 100644
index ec96e8f630..0000000000
--- a/railties/lib/rails/commands/dev_cache.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'rails/command'
-
-module Rails
- module Commands
- # This is a wrapper around the Rails dev:cache command
- class DevCache < Command
- set_banner :dev_cache, 'Toggle development mode caching on/off'
- def dev_cache
- if File.exist? 'tmp/caching-dev.txt'
- File.delete 'tmp/caching-dev.txt'
- puts 'Development mode is no longer being cached.'
- else
- FileUtils.touch 'tmp/caching-dev.txt'
- puts 'Development mode is now being cached.'
- end
-
- FileUtils.touch 'tmp/restart.txt'
- end
- end
- end
-end
diff --git a/railties/lib/rails/tasks.rb b/railties/lib/rails/tasks.rb
index d60eaf6f4f..d3e33584d7 100644
--- a/railties/lib/rails/tasks.rb
+++ b/railties/lib/rails/tasks.rb
@@ -3,6 +3,7 @@ require 'rake'
# Load Rails Rakefile extensions
%w(
annotations
+ dev
framework
initializers
log
diff --git a/railties/lib/rails/tasks/dev.rake b/railties/lib/rails/tasks/dev.rake
new file mode 100644
index 0000000000..4593100465
--- /dev/null
+++ b/railties/lib/rails/tasks/dev.rake
@@ -0,0 +1,14 @@
+namespace :dev do
+ desc 'Toggle development mode caching on/off'
+ task :cache do
+ if File.exist? 'tmp/caching-dev.txt'
+ File.delete 'tmp/caching-dev.txt'
+ puts 'Development mode is no longer being cached.'
+ else
+ FileUtils.touch 'tmp/caching-dev.txt'
+ puts 'Development mode is now being cached.'
+ end
+
+ FileUtils.touch 'tmp/restart.txt'
+ end
+end