Class: Kplay::CLI
- Inherits:
-
Thor
- Object
- Thor
- Kplay::CLI
- Defined in:
- lib/kplay/cli.rb
Instance Method Summary collapse
- #config ⇒ Object
- #info ⇒ Object
- #open ⇒ Object
- #play ⇒ Object
- #pod_config ⇒ Object
- #start ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Instance Method Details
#config ⇒ Object
25 26 27 28 29 30 31 |
# 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 ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# 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 ⇒ Object
66 67 68 69 70 |
# File 'lib/kplay/cli.rb', line 66 def open Kplay.assert_requirements! pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, ) pod.shell end |
#play ⇒ Object
74 75 76 77 78 |
# File 'lib/kplay/cli.rb', line 74 def play start open stop end |
#pod_config ⇒ Object
35 36 37 38 39 |
# File 'lib/kplay/cli.rb', line 35 def pod_config Kplay.assert_requirements! pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, ) puts pod.configuration end |
#start ⇒ Object
52 53 54 55 56 |
# File 'lib/kplay/cli.rb', line 52 def start Kplay.assert_requirements! pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, ) pod.start! end |
#status ⇒ Object
43 44 45 46 47 48 |
# 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 ⇒ Object
59 60 61 62 63 |
# File 'lib/kplay/cli.rb', line 59 def stop Kplay.assert_requirements! pod = Kplay::Pod.new(Dir.pwd, Kplay::Config.local, ) pod.stop! end |