Sha256: 2aa171e664971e4fe4796084c00279a8daaecc205a90ab834361d686845ef035

Contents?: true

Size: 761 Bytes

Versions: 25

Compression:

Stored size: 761 Bytes

Contents

require 'rails/generators'
require File.expand_path('utils', __dir__)

module Bobot
  class UninstallGenerator < Rails::Generators::Base
    include Rails::Generators::Migration
    include Generators::Utils::InstanceMethods
    extend Generators::Utils::ClassMethods
    source_root File.expand_path('templates', __dir__)

    desc 'Bobot uninstall'

    def uninstall
      display 'Why you leaving so soon? :('
      gsub_file 'config/routes.rb', %r{mount Bobot::Engine => \'\/.+\'(, as: \'bot\')?}, ''
      remove_file 'config/initializers/bobot.rb'
      remove_file 'app/bobot/workflow.rb'
      remove_file 'config/locales/bobot.en.yml'
      remove_file 'config/locales/bobot.fr.yml'
      display 'Done! Bobot has been uninstalled.'
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
bobot-4.2.0 lib/generators/bobot/uninstall_generator.rb
bobot-4.1.0 lib/generators/bobot/uninstall_generator.rb
bobot-4.0.0 lib/generators/bobot/uninstall_generator.rb
bobot-3.7.9 lib/generators/bobot/uninstall_generator.rb
bobot-3.7.8 lib/generators/bobot/uninstall_generator.rb