Class: Gitlab::QA::Docker::Command
- Inherits:
-
Object
- Object
- Gitlab::QA::Docker::Command
- Defined in:
- lib/gitlab/qa/docker/command.rb
Defined Under Namespace
Classes: StatusError
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(*args) ⇒ Object
- #execute!(&block) ⇒ Object
-
#initialize(cmd = nil) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(cmd = nil) ⇒ Command
Returns a new instance of Command.
15 16 17 |
# File 'lib/gitlab/qa/docker/command.rb', line 15 def initialize(cmd = nil) @args = Array(cmd) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
9 10 11 |
# File 'lib/gitlab/qa/docker/command.rb', line 9 def args @args end |
Class Method Details
.execute(cmd, &block) ⇒ Object
11 12 13 |
# File 'lib/gitlab/qa/docker/command.rb', line 11 def self.execute(cmd, &block) new(cmd).execute!(&block) end |
Instance Method Details
#<<(*args) ⇒ Object
19 20 21 |
# File 'lib/gitlab/qa/docker/command.rb', line 19 def <<(*args) tap { @args.concat(args) } end |
#execute!(&block) ⇒ Object
23 24 25 |
# File 'lib/gitlab/qa/docker/command.rb', line 23 def execute!(&block) engine("docker #{@args.join(' ')}", &block) end |