Class: CustomCaptcha::UninstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- CustomCaptcha::UninstallGenerator
- Includes:
- Generators::Utils::InstanceMethods
- Defined in:
- lib/generators/custom_captcha/uninstall/uninstall_generator.rb
Instance Method Summary collapse
- #clear_images ⇒ Object
- #destroy_initializer ⇒ Object
- #destroy_locale ⇒ Object
- #destroy_views ⇒ Object
- #show_readme ⇒ Object
Methods included from Generators::Utils::InstanceMethods
Instance Method Details
#clear_images ⇒ Object
11 12 13 |
# File 'lib/generators/custom_captcha/uninstall/uninstall_generator.rb', line 11 def clear_images rake("custom_captcha:clear_images") end |
#destroy_initializer ⇒ Object
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_locale ⇒ Object
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_views ⇒ Object
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_readme ⇒ Object
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 |