Class: RhoDevelopment::SubscriberFullUpdateNotifyingTask

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) ⇒ SubscriberFullUpdateNotifyingTask

Returns a new instance of SubscriberFullUpdateNotifyingTask.



288
289
290
291
# File 'lib/build/development/live_update_task.rb', line 288

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

Class Method Details

.fromHash(aHash) ⇒ Object



282
283
284
285
286
# File 'lib/build/development/live_update_task.rb', line 282

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

.taskNameObject



278
279
280
# File 'lib/build/development/live_update_task.rb', line 278

def self.taskName
  'NotifySubscriberAboutFullBundleUpdate'
end

Instance Method Details

#actionObject



293
294
295
# File 'lib/build/development/live_update_task.rb', line 293

def action
  @subscriber.full_notify(@filename)
end

#dispatchToUrl(anUri) ⇒ Object



297
298
299
300
# File 'lib/build/development/live_update_task.rb', line 297

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