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
245 246 247 |
# File 'lib/rage/cli.rb', line 245 def self.source_root File.("templates", __dir__) end |
Instance Method Details
#copy_files ⇒ Object
257 258 259 |
# File 'lib/rage/cli.rb', line 257 def copy_files inject_templates end |
#create_directory ⇒ Object
253 254 255 |
# File 'lib/rage/cli.rb', line 253 def create_directory empty_directory(path) end |
#install_database ⇒ Object
261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/rage/cli.rb', line 261 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
249 250 251 |
# File 'lib/rage/cli.rb', line 249 def setup @use_database = !database.nil? end |