Class: Takelage::MutagenSocket

Overview

takelage mutagen socket

Instance Method Summary collapse

Methods included from MutagenSocketTerminate

#mutagen_socket_terminate

Methods included from MutagenSocketTidy

#mutagen_socket_tidy

Methods included from MutagenSocketList

#mutagen_socket_list

Methods included from MutagenSocketCreate

#mutagen_socket_create

Methods included from MutagenSocketCheck

#mutagen_socket_check

Methods included from MutagenCheckDaemon

#mutagen_check_daemon

Methods included from DockerImageTagCheck

#docker_image_tag_check

Methods included from DockerImageTagList

#docker_image_tag_list

Methods included from DockerImageTagLatest

#docker_image_tag_latest

Methods included from DockerContainerCommand

#docker_container_command

Methods included from DockerContainerCheckNetwork

#docker_container_check_network

Methods included from DockerContainerCheckExisting

#docker_container_check_existing

Methods included from DockerCheckDaemon

#docker_check_daemon

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

#initialize_logging, #log

Methods inherited from SubCommandBase

banner, subcommand_prefix

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 = [], local_options = {}, configuration = {})
  # initialize thor parent class
  super args, local_options, 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

#listObject

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

#tidyObject

Remove mutagen daemon files.



99
100
101
# File 'lib/takelage/mutagen/socket/cli.rb', line 99

def tidy
  exit mutagen_socket_tidy
end