Class: AuxiliaryRails::CLI
- Inherits:
-
Thor
- Object
- Thor
- AuxiliaryRails::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/auxiliary_rails/cli.rb
Constant Summary collapse
- TEMPLATES_DIR =
File.("#{__dir__}/../../templates/")
- REPOSITORY_URL =
'https://raw.githubusercontent.com/ergoserv/' \ 'auxiliary_rails/develop/templates' .freeze
Instance Method Summary collapse
Instance Method Details
#new(app_path) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/auxiliary_rails/cli.rb', line 30 def new(app_path) run "rails new #{app_path} " \ "--database=#{[:database]} " \ "--template=#{rails_template_path([:template])} " \ '--skip-action-cable ' \ '--skip-coffee ' \ '--skip-test ' end |
#rails_template_path(template) ⇒ Object (private)
41 42 43 44 45 46 47 |
# File 'lib/auxiliary_rails/cli.rb', line 41 def rails_template_path(template) if [:develop] == true "#{REPOSITORY_URL}/rails/#{template}.rb" else "#{TEMPLATES_DIR}/rails/#{template}.rb" end end |