Class: Masks::InstallGenerator

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

Overview

Generator for rails g masks:install.

Instance Method Summary collapse

Instance Method Details

#add_migrationsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/masks/install/install_generator.rb', line 20

def add_migrations
  if yes?("generate migrations for masks?")
    rails_command "masks:install:migrations"
  else
    puts
    puts 'run "rails masks:install:migrations" to add them later on...'
  end

  puts
  puts "[masks] welcome!"
  puts "[masks] visit https://masks.geiger.to for more information."
end

#add_routingObject



8
9
10
# File 'lib/generators/masks/install/install_generator.rb', line 8

def add_routing
  route 'mount Masks::Engine => "/"'
end

#copy_initializer_fileObject



12
13
14
# File 'lib/generators/masks/install/install_generator.rb', line 12

def copy_initializer_file
  copy_file "initializer.rb", "config/initializers/masks.rb"
end

#copy_masks_jsonObject



16
17
18
# File 'lib/generators/masks/install/install_generator.rb', line 16

def copy_masks_json
  copy_file "masks.json", "masks.json"
end