Class: RhoDevelopment::AllSubscribersFullUpdateNotifyingTask

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(aFilename) ⇒ AllSubscribersFullUpdateNotifyingTask

Returns a new instance of AllSubscribersFullUpdateNotifyingTask.



207
208
209
# File 'lib/build/development/live_update_task.rb', line 207

def initialize(aFilename)
  @filename = aFilename
end

Class Method Details

.fromHash(aHash) ⇒ Object



216
217
218
219
# File 'lib/build/development/live_update_task.rb', line 216

def self.fromHash(aHash)
  filename =aHash['filename']
  self.new(filename)
end

.taskNameObject



221
222
223
# File 'lib/build/development/live_update_task.rb', line 221

def self.taskName
  'NotifyAllSubscribersAboutFullUpdate'
end

Instance Method Details

#actionObject



225
226
227
228
229
230
231
232
233
# File 'lib/build/development/live_update_task.rb', line 225

def action
  unless Configuration::has_enabled_subscribers?
    puts 'Enabled subscribers not found'.warning
    return
  end
  Configuration::enabled_subscribers.each { |subscriber|
    subscriber.full_notify(@filename)
  }
end

#dispatchToUrl(anUri) ⇒ Object



211
212
213
214
# File 'lib/build/development/live_update_task.rb', line 211

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