Class: Rage::CLINewAppGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Rage::CLINewAppGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/rage/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
285 286 287 |
# File 'lib/rage/cli.rb', line 285 def self.source_root File.("templates", __dir__) end |
Instance Method Details
#copy_files ⇒ Object
297 298 299 |
# File 'lib/rage/cli.rb', line 297 def copy_files inject_templates end |
#create_directory ⇒ Object
293 294 295 |
# File 'lib/rage/cli.rb', line 293 def create_directory empty_directory(path) end |
#install_database ⇒ Object
301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/rage/cli.rb', line 301 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
289 290 291 |
# File 'lib/rage/cli.rb', line 289 def setup @use_database = !database.nil? end |