Class: SimpleSinatraApi::CLI

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/simple_sinatra_api/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
# File 'lib/simple_sinatra_api/cli.rb', line 11

def self.source_root
  File.expand_path('../../../templates', __FILE__)
end

Instance Method Details

#create_appObject



18
19
20
# File 'lib/simple_sinatra_api/cli.rb', line 18

def create_app
  directory 'new_app', name.underscore
end

#initialize_git_repoObject



22
23
24
25
26
# File 'lib/simple_sinatra_api/cli.rb', line 22

def initialize_git_repo
  inside(name.underscore) do
    run('git init .')
  end
end

#install_dependenciesObject



28
29
30
31
32
# File 'lib/simple_sinatra_api/cli.rb', line 28

def install_dependencies
  inside(name.underscore) do
    run('bundle')
  end
end