Class: Hrk::Execute::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/hrk/execute/command.rb

Constant Summary collapse

ARG =
/\A-[ar]\Z/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommand



8
9
10
# File 'lib/hrk/execute/command.rb', line 8

def initialize
  @env = Hrk::Env.new
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



4
5
6
# File 'lib/hrk/execute/command.rb', line 4

def env
  @env
end

Instance Method Details

#call(*args) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/hrk/execute/command.rb', line 12

def call *args
  command, remote = command_and_remote args
  Hrk::Heroku.new(*remote).call(*command).tap do
    @env.remote = remote
    @env.last_time = Time.now
  end
end