Class: AppTap::CLI::Init

Inherits:
Thor::Group
  • Object
show all
Includes:
Helpers, Thor::Actions
Defined in:
lib/apptap/cli/init.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#app_config_path, #app_procfile_path, #brew_bin, #brew_command, #brew_dir, #brew_install_path, #brew_repo_url, #filter_config, #load_config, #procfile_config_end_token, #procfile_config_start_token

Class Method Details

.source_rootObject



7
8
9
# File 'lib/apptap/cli/init.rb', line 7

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

Instance Method Details

#create_sample_configObject



11
12
13
14
15
# File 'lib/apptap/cli/init.rb', line 11

def create_sample_config
  empty_directory(File.dirname(app_config_path))
  template('templates/config/apptap.yml.erb', app_config_path)
  template('templates/Procfile.dev.erb', app_procfile_path)
end

#install_homebrewObject



17
18
19
20
21
22
23
# File 'lib/apptap/cli/init.rb', line 17

def install_homebrew
  if File.exists?(brew_install_path)
    say_status 'installed', 'Homebrew', :blue
  else
    run("git clone #{brew_repo_url} #{brew_install_path}")
  end
end