Class: Litestack::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#modify_action_cable_adapterObject



11
12
13
# File 'lib/generators/litestack/install/install_generator.rb', line 11

def modify_action_cable_adapter
  copy_file "cable.yml", "config/cable.yml", force: true
end

#modify_active_job_adapterObject



21
22
23
24
25
# File 'lib/generators/litestack/install/install_generator.rb', line 21

def modify_active_job_adapter
  gsub_file "config/environments/production.rb",
    "# config.active_job.queue_adapter     = :resque",
    "config.active_job.queue_adapter = :litejob"
end

#modify_cache_store_adapterObject



15
16
17
18
19
# File 'lib/generators/litestack/install/install_generator.rb', line 15

def modify_cache_store_adapter
  gsub_file "config/environments/production.rb",
    "# config.cache_store = :mem_cache_store",
    "config.cache_store = :litecache"
end

#modify_database_adapterObject

Force copy configuration files so Rails installs don’t ask questions that less experienced people might not understand. The more Sr folks. will know to check git to look at what changed.



7
8
9
# File 'lib/generators/litestack/install/install_generator.rb', line 7

def modify_database_adapter
  copy_file "database.yml", "config/database.yml", force: true
end

#modify_gitignoreObject



27
28
29
30
31
32
33
34
# File 'lib/generators/litestack/install/install_generator.rb', line 27

def modify_gitignore
  append_file ".gitignore", <<~TEXT

    # Ignore default Litestack SQLite databases.
    /db/**/*.sqlite3
    /db/**/*.sqlite3-*
  TEXT
end