123456789_123456789_123456789_123456789_123456789_

Module: Rails::DevCaching

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: railties/lib/rails/dev_caching.rb

Constant Summary

Class Method Summary

Class Method Details

.create_cache_file (private)

[ GitHub ]

  
# File 'railties/lib/rails/dev_caching.rb', line 35

def create_cache_file
  FileUtils.touch FILE
end

.delete_cache_file (private)

[ GitHub ]

  
# File 'railties/lib/rails/dev_caching.rb', line 39

def delete_cache_file
  File.delete FILE
end

.enable_by_argument(caching)

[ GitHub ]

  
# File 'railties/lib/rails/dev_caching.rb', line 24

def enable_by_argument(caching)
  FileUtils.mkdir_p("tmp")

  if caching
    create_cache_file
  elsif caching == false && File.exist?(FILE)
    delete_cache_file
  end
end

.enable_by_file

[ GitHub ]

  
# File 'railties/lib/rails/dev_caching.rb', line 10

def enable_by_file
  FileUtils.mkdir_p("tmp")

  if File.exist?(FILE)
    delete_cache_file
    puts "Action Controller caching disabled for development mode."
  else
    create_cache_file
    puts "Action Controller caching enabled for development mode."
  end

  FileUtils.touch "tmp/restart.txt"
end