Class: CustomCaptcha::UninstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Generators::Utils::InstanceMethods
Defined in:
lib/generators/custom_captcha/uninstall/uninstall_generator.rb

Instance Method Summary collapse

Methods included from Generators::Utils::InstanceMethods

#display

Instance Method Details

#clear_imagesObject



11
12
13
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 11

def clear_images
  rake("custom_captcha:clear_images")
end

#destroy_initializerObject



15
16
17
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 15

def destroy_initializer
  remove_file "config/initializers/custom_captcha.rb"
end

#destroy_localeObject



19
20
21
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 19

def destroy_locale
  remove_file "config/locales/custom_captcha.en.yml"
end

#destroy_viewsObject



23
24
25
26
27
28
29
30
31
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 23

def destroy_views
#    filename_pattern = File.expand_path("../../../../../app/views/custom_captcha/captcha_styles/*", __FILE__)
#    Dir[filename_pattern].each do |f|
#      copy_file f, "app/views/custom_captcha/captcha_styles/#{File.basename f}"
#    end
  Dir["app/views/custom_captcha/captcha_styles/*"].each do |f|
    remove_file f
  end
end

#show_readmeObject



33
34
35
36
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 33

def show_readme
  display "Done! custom_captcha has been uninstalled."
  readme("README")
end