Sha256: c08d28ccaab4dcaa9e67d3a058ec6239eead57fece1f1f737dd07774ca889cf0

Contents?: true

Size: 928 Bytes

Versions: 5

Compression:

Stored size: 928 Bytes

Contents

module Bootswitch
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)
    require File.expand_path('../../utils', __FILE__)
    include Generators::Utils
    
    def hello
      output "Welcome to the Bootswitch gem's installation process.", :magenta
      end
    
    # all public methods in here will be run in order
    def install_initializer
      output "This installs a basic initializer where you can set the method that stores the name of the bootswatch bootswatch to be displayed.", :magenta
      template "initializer.rb", "config/initializers/bootswitch.rb"
    end

    def add_route
      output "Adding Bootswitch to your routes.rb file", :magenta
      gsub_file "config/routes.rb", /mount Bootswitch::Engine => '\/bootswatch\/', :as => 'bootswitch'/, ''
      route("mount Bootswitch::Engine => '/bootswatch/', :as => 'bootswitch'")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bootswitch-0.0.5 lib/generators/bootswitch/install/install_generator.rb
bootswitch-0.0.4 lib/generators/bootswitch/install/install_generator.rb
bootswitch-0.0.3 lib/generators/bootswitch/install/install_generator.rb
bootswitch-0.0.2 lib/generators/bootswitch/install/install_generator.rb
bootswitch-0.0.1 lib/generators/bootswitch/install/install_generator.rb