Class: Singu::CLI
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Singu::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/singu/cli.rb
Constant Summary collapse
- DEFAULT_SINATRA_TEMPLATE_REPO =
'regedarek/singu-sinatra-template'
- DEFAULT_ANGULAR_TEMPLATE_REPO =
'regedarek/singu-angular-template'
Class Method Summary collapse
Instance Method Summary collapse
- #create_app_from_template ⇒ Object
- #initialize_git_repo ⇒ Object
- #install_dependencies ⇒ Object
- #setup ⇒ Object
Class Method Details
.source_root ⇒ Object
14 15 16 |
# File 'lib/singu/cli.rb', line 14 def self.source_root "." end |
Instance Method Details
#create_app_from_template ⇒ Object
29 30 31 32 33 34 |
# File 'lib/singu/cli.rb', line 29 def create_app_from_template sinatra_repo = .fetch(:template){{}}.fetch('sinatra', DEFAULT_SINATRA_TEMPLATE_REPO) angular_repo = .fetch(:template){{}}.fetch('angular', DEFAULT_ANGULAR_TEMPLATE_REPO) clone_repo(sinatra_repo) clone_repo(angular_repo) unless [:'skip-angular'] end |
#initialize_git_repo ⇒ Object
36 37 38 39 40 |
# File 'lib/singu/cli.rb', line 36 def initialize_git_repo inside(@app_path) do run('git init .') end end |
#install_dependencies ⇒ Object
42 43 44 45 46 |
# File 'lib/singu/cli.rb', line 42 def install_dependencies inside(@app_path) do run('bundle') end end |
#setup ⇒ Object
24 25 26 27 |
# File 'lib/singu/cli.rb', line 24 def setup @app_path = name.directory_name @name = name.file_name end |