Class: Hub::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_initializerObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/hub/install_generator.rb', line 8

def add_initializer
  path = "#{Rails.root}/config/initializers/hubs.rb"
  if File.exist?(path)
    puts 'Skipping config/initializers/hubs.rb creation, as file already exists!'
  else
    puts 'Adding Hubs initializer (config/initializers/hubs.rb)...'
    template 'config/initializers/hubs.rb', path
  end
end

#add_routesObject



18
19
20
# File 'lib/generators/hub/install_generator.rb', line 18

def add_routes
  route 'mount Hub::Engine, at: "/hub"'
end