Class: DatacraftsIoSkeleton::Composer
- Inherits:
-
Thor
- Object
- Thor
- DatacraftsIoSkeleton::Composer
- Defined in:
- lib/datacrafts_io_skeleton/composer.rb
Overview
Defines all CLI commands, their descriptions, params and aliases.
Constant Summary collapse
- FRONTEND_CREATORS =
{ "react" => ->(app_name, ) { ReactCreator.new(app_name, ).call }, "vue" => ->(app_name, ) { VueCreator.new(app_name, ).call }, nil => proc { |app_name| puts("The frontend is not specified for #{app_name}") } }.freeze
- ALLOWED_FRONTEND =
FRONTEND_CREATORS.keys.freeze
Instance Method Summary collapse
-
#create(app_name) ⇒ Object
Creates new app.
-
#version ⇒ Object
Informs user about gem version.
Instance Method Details
#create(app_name) ⇒ Object
Creates new app.
40 41 42 43 44 45 |
# File 'lib/datacrafts_io_skeleton/composer.rb', line 40 def create(app_name) say("The specified frontend is not allowed", :red) && return unless specified_frontend_valid? DatacraftsIoSkeleton::RailsCreator.new(app_name).call FRONTEND_CREATORS[[:frontend]].call(app_name, ) end |
#version ⇒ Object
Informs user about gem version.
50 51 52 |
# File 'lib/datacrafts_io_skeleton/composer.rb', line 50 def version say("datacrafts-io-skeleton #{DatacraftsIoSkeleton::VERSION}") end |