class KubsCLI::CLI

Public Instance Methods

copy() click to toggle source
# File lib/kubs_cli/cli.rb, line 25
def copy
  run_command { KubsCLI::Copy.new.copy_all }
end
git_pull() click to toggle source
# File lib/kubs_cli/cli.rb, line 62
def git_pull
  swap_dir { Rake.sh('git pull') }
rescue RuntimeError => e
  KubsCLI.add_error(e: e, msg: 'Ran into an error pulling down your repo')
end
git_push(message = nil) click to toggle source
# File lib/kubs_cli/cli.rb, line 48
def git_push(message = nil)
  message ||= 'auto push files'

  swap_dir do
    Rake.sh('git add -A')
    Rake.sh("git commit -m \"#{message}\"")
    Rake.sh('git push')
  rescue RuntimeError => e
    KubsCLI.add_error(e: e, msg: 'Something went wrong pushing your repo')
  end
end
git_status() click to toggle source
# File lib/kubs_cli/cli.rb, line 69
def git_status
  swap_dir { Rake.sh('git status') }
end
init() click to toggle source
# File lib/kubs_cli/cli.rb, line 18
def init
  puts "Adding .kubs to #{Dir.home}..."
  KubsCLI.create_config_dir
end
install_dependencies() click to toggle source
# File lib/kubs_cli/cli.rb, line 36
def install_dependencies
  run_command { KubsCLI::Install.new.install_dependencies }
  Rake.sh('echo "Restart your shell"')
end
install_packages() click to toggle source
# File lib/kubs_cli/cli.rb, line 42
def install_packages
  run_command { KubsCLI::Install.new.install_packages }
end
pull() click to toggle source
# File lib/kubs_cli/cli.rb, line 31
def pull
  run_command { KubsCLI::Pull.new.pull_all }
end
run_command() { || ... } click to toggle source
# File lib/kubs_cli/cli.rb, line 80
def run_command
  KubsCLI.load_configuration
  yield
  KubsCLI.print_errors
end
swap_dir() { || ... } click to toggle source
# File lib/kubs_cli/cli.rb, line 74
def swap_dir
  KubsCLI.load_configuration
  Rake.cd(KubsCLI.configuration.config_files)
  yield
end
version() click to toggle source
# File lib/kubs_cli/cli.rb, line 11
def version
  puts "kubs-cli version #{KubsCLI::VERSION}"
end