Class: Docker::Compose::ShellPrinter::Posix

Inherits:
Object
  • Object
show all
Defined in:
lib/docker/compose/shell_printer/posix.rb

Overview

Printer that works with any POSIX-compliant shell e.g. sh, bash, zsh

Direct Known Subclasses

Fish

Instance Method Summary collapse

Instance Method Details

#comment(value) ⇒ Object



5
6
7
# File 'lib/docker/compose/shell_printer/posix.rb', line 5

def comment(value)
  format('# %s', value)
end

#eval_output(command) ⇒ Object



9
10
11
# File 'lib/docker/compose/shell_printer/posix.rb', line 9

def eval_output(command)
  format('eval "$(%s)"', command)
end

#export(name, value) ⇒ Object



13
14
15
# File 'lib/docker/compose/shell_printer/posix.rb', line 13

def export(name, value)
  format('export %s=%s', name, single_quoted_escaped(value))
end

#unset(name) ⇒ Object



17
18
19
# File 'lib/docker/compose/shell_printer/posix.rb', line 17

def unset(name)
  format('unset %s', name)
end