Class: FPM::Fry::Command

Inherits:
Clamp::Command
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fpm/fry/command.rb,
lib/fpm/fry/command/cook.rb

Direct Known Subclasses

Cook

Defined Under Namespace

Classes: Cook

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(invocation_path, ctx = {}) ⇒ Command

Returns a new instance of Command.



26
27
28
29
30
# File 'lib/fpm/fry/command.rb', line 26

def initialize(invocation_path, ctx = {})
  super
  @ui = ctx.fetch(:ui){ UI.new(tmpdir: dir) }
  @client = ctx[:client]
end

Instance Attribute Details

#clientObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/fpm/fry/command.rb', line 39

def client
  @client ||= begin
    client = FPM::Fry::Client.new(
      logger: logger,
      tls: tls?, tlsverify: tlsverify?
    )
    logger.debug("Docker connected",client.server_version)
    client
  end
end

#uiObject (readonly)

Returns the value of attribute ui.



22
23
24
# File 'lib/fpm/fry/command.rb', line 22

def ui
  @ui
end

Instance Method Details

#parse(attrs) ⇒ Object



32
33
34
35
36
37
# File 'lib/fpm/fry/command.rb', line 32

def parse(attrs)
  super
  if debug?
    ui.logger.level = :debug
  end
end