Sha256: 73b9537a935dae4123b26ce28952f3f33b71c4e4f7ffd9beea4345e364507861

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

module Cabalist
  class InstallGenerator < Rails::Generators::Base
    desc <<-EOF
      This generator installs the Cabalist initializer and 
      adds the route to Cabalist GUI (Cabalist::Frontend).
      Usage:
      rails generate cabalist:install <ModelName>
    EOF
    
    source_root File.expand_path('../templates/', __FILE__)
    
    def copy_initializer
      copy_file "initializers/cabalist.rb",
                "config/initializers/cabalist.rb"
    end
    
    def copy_assets
      directory "public/", "public/"
    end
    
    def add_route
      route "match '/cabalist' => Cabalist::Frontend, :anchor => false, :as => :cabalist"
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cabalist-0.0.3 lib/generators/cabalist/install/install_generator.rb
cabalist-0.0.2 lib/generators/cabalist/install/install_generator.rb