Class: Telm::Generators::InstallGenerator

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

Constant Summary collapse

DEFAULT_ROUTE =
"/telm"

Instance Method Summary collapse

Instance Method Details

#add_mountObject



17
18
19
20
21
22
23
# File 'lib/generators/telm/install/install_generator.rb', line 17

def add_mount
  if existing_mount_path
    say_status :skip, "telm is already mounted at #{mount_path} in config/routes.rb", :yellow
  else
    route %(mount Telm::Engine => "#{mount_path}")
  end
end

#announceObject



29
30
31
# File 'lib/generators/telm/install/install_generator.rb', line 29

def announce
  say "✓ telm mounted at #{mount_path} — start your server and visit http://localhost:3000#{mount_path}"
end

#create_initializerObject



25
26
27
# File 'lib/generators/telm/install/install_generator.rb', line 25

def create_initializer
  template "initializer.rb.tt", "config/initializers/telm.rb"
end