Class: Metaforce::Job::Deploy

Inherits:
Metaforce::Job show all
Defined in:
lib/metaforce/job/deploy.rb

Constant Summary

Constants inherited from Metaforce::Job

DELAY_MULTIPLIER, DELAY_START

Instance Attribute Summary

Attributes inherited from Metaforce::Job

#id

Instance Method Summary collapse

Methods inherited from Metaforce::Job

disable_threading!, #done?, #inspect, #started?, #state, #status

Constructor Details

#initialize(client, path, options = {}) ⇒ Deploy

Public: Instantiate a new deploy job.

Examples

job = Metaforce::Job::Deploy.new(client, './path/to/deploy')
# => #<Metaforce::Job::Deploy @id=nil>

Returns self.



12
13
14
15
# File 'lib/metaforce/job/deploy.rb', line 12

def initialize(client, path, options={})
  super(client)
  @path, @options = path, options
end

Instance Method Details

#performObject

Public: Perform the job.

Examples

job = Metaforce::Job::Deploy.new(client, './path/to/deploy')
job.perform
# => #<Metaforce::Job::Deploy @id='1234'>

Returns self.



26
27
28
29
# File 'lib/metaforce/job/deploy.rb', line 26

def perform
  @id = client._deploy(payload, @options).id
  super
end

#resultObject

Public: Get the detailed status of the deploy.

Examples

job.result
# => { :id => '1234', :success => true, ... }

Returns the DeployResult (www.salesforce.com/us/developer/docs/api_meta/Content/meta_deployresult.htm).



39
40
41
# File 'lib/metaforce/job/deploy.rb', line 39

def result
  @result ||= client.status(id, :deploy)
end

#success?Boolean

Public: Returns true if the deploy was successful.

Examples

job.success?
# => true

Returns true or false based on the DeployResult.

Returns:

  • (Boolean)


51
52
53
# File 'lib/metaforce/job/deploy.rb', line 51

def success?
  result.success
end