Class: RhoDevelopment::SubscriberFullBundleUpdateBuildingTask

Inherits:
LiveUpdateTask show all
Defined in:
lib/build/development/live_update_task.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LiveUpdateTask

descendants, #execute

Constructor Details

#initialize(aSubscriber, aFilename) ⇒ SubscriberFullBundleUpdateBuildingTask

Returns a new instance of SubscriberFullBundleUpdateBuildingTask.



119
120
121
122
# File 'lib/build/development/live_update_task.rb', line 119

def initialize(aSubscriber, aFilename)
  @subscriber = aSubscriber
  @filename = aFilename
end

Class Method Details

.fromHash(aHash) ⇒ Object



113
114
115
116
117
# File 'lib/build/development/live_update_task.rb', line 113

def self.fromHash(aHash)
  subscriber = Configuration::subscriber_by_ip(aHash['ip'])
  filename = aHash['filename']
  self.new(subscriber, filename)
end

.taskNameObject



109
110
111
# File 'lib/build/development/live_update_task.rb', line 109

def self.taskName
  'BuildFullBundleUpdateForSubscriber'
end

Instance Method Details

#actionObject



124
125
126
127
# File 'lib/build/development/live_update_task.rb', line 124

def action
  server = BuildServer.new
  server.build_full_bundle_for_subscriber(@subscriber, @filename)
end

#dispatchToUrl(anUri) ⇒ Object



129
130
131
132
# File 'lib/build/development/live_update_task.rb', line 129

def dispatchToUrl(anUri)
  uri = URI.join(anUri, 'tasks/new')
  Net::HTTP.post_form(uri, {'taskName' => self.class.taskName, 'ip' => @subscriber.ip, 'filename' => @filename})
end