Class: RhoDevelopment::AllSubscribersPartialUpdateNotifyingTask

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

Returns a new instance of AllSubscribersPartialUpdateNotifyingTask.



175
176
177
# File 'lib/build/development/live_update_task.rb', line 175

def initialize(aFilename)
  @filename = aFilename
end

Class Method Details

.fromHash(aHash) ⇒ Object



184
185
186
187
# File 'lib/build/development/live_update_task.rb', line 184

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

.taskNameObject



189
190
191
# File 'lib/build/development/live_update_task.rb', line 189

def self.taskName
  'NotifyAllSubscribersAboutPartialUpdate'
end

Instance Method Details

#actionObject



193
194
195
196
197
198
199
200
201
# File 'lib/build/development/live_update_task.rb', line 193

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

#dispatchToUrl(anUri) ⇒ Object



179
180
181
182
# File 'lib/build/development/live_update_task.rb', line 179

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