2015-12-06 08:23:28 -05:00
|
|
|
require 'rails/command'
|
2015-11-30 16:33:33 -05:00
|
|
|
|
|
|
|
module Rails
|
|
|
|
module Commands
|
|
|
|
# This is a wrapper around the Rails dev:cache command
|
|
|
|
class DevCache < Command
|
2015-12-06 08:23:28 -05:00
|
|
|
set_banner :dev_cache, 'Toggle development mode caching on/off'
|
2015-11-30 16:33:33 -05:00
|
|
|
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
|