Class: RailsMaint::CLI
Instance Method Summary
collapse
#available_locales, #default_maintenance_page_content
Instance Method Details
#disable ⇒ Object
25
26
27
28
|
# File 'lib/rails_maint/cli.rb', line 25
def disable
delete_file('tmp/maintenance_mode.txt')
puts "Maintenance mode disabled"
end
|
#enable ⇒ Object
19
20
21
22
|
# File 'lib/rails_maint/cli.rb', line 19
def enable
File.write('tmp/maintenance_mode.txt', Time.now.to_s)
puts "Maintenance mode enabled."
end
|
#install ⇒ Object
12
13
14
15
16
|
# File 'lib/rails_maint/cli.rb', line 12
def install
create_config_file
create_locale_file(options[:locale])
puts "RailsMaint has been installed with #{options[:locale]} locale."
end
|
#uninstall ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/rails_maint/cli.rb', line 31
def uninstall
delete_file('tmp/maintenance_mode.txt')
delete_file('config/rails_maint.yml')
delete_file('config/locales/rails_maint.en.yml')
delete_file('config/locales/rails_maint.tr.yml')
puts "RailsMaint has been uninstalled and all related files have been removed."
end
|