Class: Cabalist::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/cabalist/install/install_generator.rb

Overview

A Rails-specific generator which installs Cabalist in an application

This generator copies Cabalist assets to the application public directory, creates a relevant initializer in config/initializers and adds a route to the config/routes.rb, mounting the GUI at /cabalist endpoint.

Instance Method Summary collapse

Instance Method Details

#add_routeObject



27
28
29
# File 'lib/generators/cabalist/install/install_generator.rb', line 27

def add_route
  route "match '/cabalist' => Cabalist::Frontend, :anchor => false, :as => :cabalist"
end

#copy_assetsObject



23
24
25
# File 'lib/generators/cabalist/install/install_generator.rb', line 23

def copy_assets
  directory "public/", "public/"
end

#copy_initializerObject



18
19
20
21
# File 'lib/generators/cabalist/install/install_generator.rb', line 18

def copy_initializer
  copy_file "initializers/cabalist.rb",
            "config/initializers/cabalist.rb"
end