class Kplay::CLI

Public Instance Methods

config() click to toggle source
# File lib/kplay/cli.rb, line 25
def config
  print 'Global config file: '
  puts Kplay::Config.global.path.to_s.yellow
  puts
  config = Kplay::Config.local
  puts config.to_h.to_yaml
end
info() click to toggle source
# File lib/kplay/cli.rb, line 11
def info
  print 'Checking requirements... '
  Kplay.assert_requirements!
  puts 'OK'.green

  path = Dir.pwd
  pod  = Kplay::Pod.new(path)
  puts "     name: #{pod.name}"
  puts "host path: #{pod.path_host}"
  puts "  vm path: #{pod.path_vm}"
  puts
end
open() click to toggle source
# File lib/kplay/cli.rb, line 66
def open
  Kplay.assert_requirements!
  pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, options)
  pod.shell
end
play() click to toggle source
# File lib/kplay/cli.rb, line 74
def play
  start
  open
  stop
end
pod_config() click to toggle source
# File lib/kplay/cli.rb, line 35
def pod_config
  Kplay.assert_requirements!
  pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, options)
  puts pod.configuration
end
start() click to toggle source
# File lib/kplay/cli.rb, line 52
def start
  Kplay.assert_requirements!
  pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, options)
  pod.start!
end
status() click to toggle source
# File lib/kplay/cli.rb, line 43
def status
  Kplay.assert_requirements!
  Kplay.sh ['minikube', 'status']
  pod = Kplay::Pod.new(Dir.pwd)
  Kplay.sh ['kubectl', 'get', 'pods', pod.name] rescue nil
end
stop() click to toggle source
# File lib/kplay/cli.rb, line 59
def stop
  Kplay.assert_requirements!
  pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, options)
  pod.stop!
end