Class: Tinet::Command::Ps

Inherits:
Base
  • Object
show all
Defined in:
lib/tinet/command/ps.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Shell

#sh, #sudo

Constructor Details

This class inherits a constructor from Tinet::Command::Base

Instance Method Details

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tinet/command/ps.rb', line 6

def run
  if all
    stdout, * = sudo "docker ps -a -f name=#{Tinet.namespace}"
  else
    stdout, * = sudo "docker ps -f name=#{Tinet.namespace}"
  end

  unless dry_run
    logger.info 'TINET Docker Containers'
    logger.info '-' * 50
    logger.info stdout
  end
end