Class: Rubble::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rubble/command/base.rb

Direct Known Subclasses

Upload

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plan, context) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
# File 'lib/rubble/command/base.rb', line 11

def initialize(plan, context)
    @log = Logging.logger[self]
    @plan = plan
    @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



7
8
9
# File 'lib/rubble/command/base.rb', line 7

def context
  @context
end

#localObject (readonly)

Returns the value of attribute local.



8
9
10
# File 'lib/rubble/command/base.rb', line 8

def local
  @local
end

#planObject (readonly)

Returns the value of attribute plan.



6
7
8
# File 'lib/rubble/command/base.rb', line 6

def plan
  @plan
end

#remoteObject (readonly)

Returns the value of attribute remote.



9
10
11
# File 'lib/rubble/command/base.rb', line 9

def remote
  @remote
end

Instance Method Details

#deploy_dirObject



52
53
54
# File 'lib/rubble/command/base.rb', line 52

def deploy_dir
    resolve(File.join(server.rubble_dir, server.deploy_dir))
end

#envObject



29
30
31
# File 'lib/rubble/command/base.rb', line 29

def env
    @plan.env
end

#resolve(string) ⇒ Object



47
48
49
50
# File 'lib/rubble/command/base.rb', line 47

def resolve(string)
    string = '"' << string.gsub('"', '\"') << '"'
    eval(string, binding)
end

#resourceObject



25
26
27
# File 'lib/rubble/command/base.rb', line 25

def resource
    @plan.resource
end

#serverObject



17
18
19
# File 'lib/rubble/command/base.rb', line 17

def server
    @plan.server
end

#targetObject



21
22
23
# File 'lib/rubble/command/base.rb', line 21

def target
    @plan.target
end