Class: Rage::CLI::NewAppGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Rage::CLI::NewAppGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/rage/cli/new_app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
9 10 11 |
# File 'lib/rage/cli/new_app_generator.rb', line 9 def self.source_root File.("../templates", __dir__) end |
Instance Method Details
#copy_files ⇒ Object
21 22 23 |
# File 'lib/rage/cli/new_app_generator.rb', line 21 def copy_files inject_templates end |
#create_directory ⇒ Object
17 18 19 |
# File 'lib/rage/cli/new_app_generator.rb', line 17 def create_directory empty_directory(path) end |
#install_database ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rage/cli/new_app_generator.rb', line 25 def install_database return unless @use_database @app_name = path.tr("-", "_").downcase append_to_file "#{path}/Gemfile", <<~RUBY gem "#{get_db_gem_name}" gem "activerecord" gem "standalone_migrations", require: false RUBY inject_templates("db-templates") inject_templates("db-templates/#{database}") end |
#setup ⇒ Object
13 14 15 |
# File 'lib/rage/cli/new_app_generator.rb', line 13 def setup @use_database = !database.nil? end |