Class: Takelage::MutagenSocket
- Inherits:
-
SubCommandBase
- Object
- Thor
- SubCommandBase
- Takelage::MutagenSocket
- Includes:
- ConfigModule, DockerCheckDaemon, DockerContainerCheckExisting, DockerContainerCheckNetwork, DockerContainerCommand, DockerContainerLib, DockerImageTagCheck, DockerImageTagLatest, DockerImageTagList, LoggingModule, MutagenCheckDaemon, MutagenSocketCheck, MutagenSocketCreate, MutagenSocketList, MutagenSocketTerminate, MutagenSocketTidy, SystemModule
- Defined in:
- lib/takelage/mutagen/socket/cli.rb
Overview
takelage mutagen socket
Instance Method Summary collapse
-
#check(socket) ⇒ Object
Check if mutagen [SOCKET] exists.
-
#create(name, containersock, hostsock) ⇒ Object
Create a mutagen socket [NAME] from [IN] to [OUT] of the container.
-
#initialize(args = [], local_options = {}, configuration = {}) ⇒ MutagenSocket
constructor
Initialize mutagen socket.
-
#list ⇒ Object
List mutagen sockets.
-
#terminate(socket) ⇒ Object
Terminate a mutagen [SOCKET].
-
#tidy ⇒ Object
Remove mutagen daemon files.
Methods included from MutagenSocketTerminate
Methods included from MutagenSocketTidy
Methods included from MutagenSocketList
Methods included from MutagenSocketCreate
Methods included from MutagenSocketCheck
Methods included from MutagenCheckDaemon
Methods included from DockerImageTagCheck
Methods included from DockerImageTagList
Methods included from DockerImageTagLatest
Methods included from DockerContainerCommand
Methods included from DockerContainerCheckNetwork
#docker_container_check_network
Methods included from DockerContainerCheckExisting
#docker_container_check_existing
Methods included from DockerCheckDaemon
Methods included from ConfigModule
#config, #configured?, #initialize_config
Methods included from SystemModule
#command_available_else_error?, #command_available_else_warn?, #hash_to_yaml, #read_yaml_erb_file, #read_yaml_file, #rm_fr, #run, #run_and_capture, #run_and_exit, #run_and_fork, #try
Methods included from LoggingModule
Methods inherited from SubCommandBase
Constructor Details
#initialize(args = [], local_options = {}, configuration = {}) ⇒ MutagenSocket
Initialize mutagen socket
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 25 def initialize(args = [], = {}, configuration = {}) # initialize thor parent class super args, , configuration @docker_repo = config.active['docker_repo'] @username = ENV['USER'] || 'noname' @workdir = Dir.getwd inside = _docker_container_lib_check_matrjoschka @hostname = inside ? ENV['HOSTNAME'] : _docker_container_lib_hostname @hostlabel = "hostname=#{@hostname}" @takellabel = config.active['mutagen_socket_takelage_label'] end |
Instance Method Details
#check(socket) ⇒ Object
Check if mutagen [SOCKET] exists.
48 49 50 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 48 def check(socket) exit mutagen_socket_check socket end |
#create(name, containersock, hostsock) ⇒ Object
Create a mutagen socket [NAME] from [IN] to [OUT] of the container.
60 61 62 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 60 def create(name, containersock, hostsock) exit mutagen_socket_create name, containersock, hostsock end |
#list ⇒ Object
List mutagen sockets.
72 73 74 75 76 77 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 72 def list socket_list = mutagen_socket_list exit false if socket_list == false say socket_list true end |
#terminate(socket) ⇒ Object
Terminate a mutagen [SOCKET].
87 88 89 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 87 def terminate(socket) exit mutagen_socket_terminate socket end |
#tidy ⇒ Object
Remove mutagen daemon files.
99 100 101 |
# File 'lib/takelage/mutagen/socket/cli.rb', line 99 def tidy exit mutagen_socket_tidy end |