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 = {}, parent_attribute_values = {}) ⇒ Command

Returns a new instance of Command.



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

def initialize(invocation_path, ctx = {}, parent_attribute_values = {})
  super
  @ui = ctx.fetch(:ui){ UI.new }
end

Instance Attribute Details

#clientObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/fpm/fry/command.rb', line 35

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.



19
20
21
# File 'lib/fpm/fry/command.rb', line 19

def ui
  @ui
end

Instance Method Details

#parse(attrs) ⇒ Object



28
29
30
31
32
33
# File 'lib/fpm/fry/command.rb', line 28

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