Class: FigRake::Command
- Inherits:
-
Object
- Object
- FigRake::Command
- Defined in:
- lib/fig_rake/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#container_name ⇒ Object
Returns the value of attribute container_name.
-
#docker_command ⇒ Object
Returns the value of attribute docker_command.
-
#rake_args ⇒ Object
Returns the value of attribute rake_args.
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(command, container_name, rake_args, docker_command) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(command, container_name, rake_args, docker_command) ⇒ Command
Returns a new instance of Command.
5 6 7 |
# File 'lib/fig_rake/command.rb', line 5 def initialize(command, container_name, rake_args, docker_command) @command, @container_name, @rake_args, @docker_command = command, container_name, rake_args, docker_command end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/fig_rake/command.rb', line 3 def command @command end |
#container_name ⇒ Object
Returns the value of attribute container_name.
3 4 5 |
# File 'lib/fig_rake/command.rb', line 3 def container_name @container_name end |
#docker_command ⇒ Object
Returns the value of attribute docker_command.
3 4 5 |
# File 'lib/fig_rake/command.rb', line 3 def docker_command @docker_command end |
#rake_args ⇒ Object
Returns the value of attribute rake_args.
3 4 5 |
# File 'lib/fig_rake/command.rb', line 3 def rake_args @rake_args end |
Instance Method Details
#exec ⇒ Object
9 10 11 12 |
# File 'lib/fig_rake/command.rb', line 9 def exec p "#{docker_command} run --rm --entrypoint=#{command} #{container_name} #{rake_args.join(' ')}" exit system("#{docker_command} run --rm --entrypoint=#{command} #{container_name} #{rake_args.join(' ')}") end |