Sha256: 4a7c18d16ed7a67662a2fefbb6f81e91e82ee5b0a17f5a693f80319da3c54987

Contents?: true

Size: 1 KB

Versions: 14

Compression:

Stored size: 1 KB

Contents

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

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

    argument :_namespace, type: :string, required: false, desc: 'Bot url namespace'
    desc 'Bobot install'

    def install
      remove_file 'config/initializers/bobot.rb'
      namespace = ask_for('Where do you want to mount bobot?', 'bot', _namespace)
      route("mount Bobot::Engine => '/#{namespace}', as: 'bot'")
      template 'config/initializers/bobot.rb', 'config/initializers/bobot.rb'
      template 'app/bobot/workflow.rb', 'app/bobot/workflow.rb'
      copy_file 'config/locales/bobot.en.yml', 'config/locales/bobot.en.yml'
      copy_file 'config/locales/bobot.fr.yml', 'config/locales/bobot.fr.yml'
      display 'Installation done', :green
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bobot-3.7.6 lib/generators/bobot/install_generator.rb
bobot-3.7.3 lib/generators/bobot/install_generator.rb
bobot-3.7.2 lib/generators/bobot/install_generator.rb
bobot-3.6.3 lib/generators/bobot/install_generator.rb
bobot-3.6.0 lib/generators/bobot/install_generator.rb
bobot-3.5.2 lib/generators/bobot/install_generator.rb
bobot-3.5.1 lib/generators/bobot/install_generator.rb
bobot-3.5.0 lib/generators/bobot/install_generator.rb
bobot-3.0.7 lib/generators/bobot/install_generator.rb
bobot-3.0.6 lib/generators/bobot/install_generator.rb
bobot-3.0.5 lib/generators/bobot/install_generator.rb
bobot-3.0.3 lib/generators/bobot/install_generator.rb
bobot-3.0.2 lib/generators/bobot/install_generator.rb
bobot-3.0.1 lib/generators/bobot/install_generator.rb