Class: HotCatch::UninstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/hot_catch/uninstall_generator.rb

Instance Method Summary collapse

Instance Method Details

#remove_hot_catch_configObject



25
26
27
# File 'lib/generators/hot_catch/uninstall_generator.rb', line 25

def remove_hot_catch_config
  remove_file "config/hot_catch_config.json"
end

#remove_initialize_file_for_sender_logsObject



29
30
31
# File 'lib/generators/hot_catch/uninstall_generator.rb', line 29

def remove_initialize_file_for_sender_logs
  remove_file "config/initializers/hot_catch_sender_logs.rb"
end

#remove_log_filesObject



21
22
23
# File 'lib/generators/hot_catch/uninstall_generator.rb', line 21

def remove_log_files
  remove_file "tmp/hot_catch_buf_file"
end

#remove_rack_loggerObject

include Rails::Generators::Migration



9
10
11
# File 'lib/generators/hot_catch/uninstall_generator.rb', line 9

def remove_rack_logger
  remove_file "config/hot_catch_logger.rb"
end

#unchange_filesObject



13
14
15
16
17
18
19
# File 'lib/generators/hot_catch/uninstall_generator.rb', line 13

def unchange_files
  gsub_file "config/application.rb", /require_relative 'hot_catch_logger'/, ""
  gsub_file "config/application.rb", /config.*Logger/, ""

  gsub_file "config/environments/development.rb", /.*\s.*hot_catch_buf_file'\)\)\s*/, ""
  gsub_file "config/environments/production.rb", /.*\s.*hot_catch_buf_file'\)\)\s*/, ""
end