Class: RhoDevelopment::LiveUpdateTask
- Defined in:
- lib/build/development/live_update_task.rb
Overview
Abstract class for all live update tasks
Direct Known Subclasses
AllPlatformsFullBundleBuildingTask, AllPlatformsPartialBundleBuildingTask, AllSubscribersFullUpdateNotifyingTask, AllSubscribersPartialUpdateNotifyingTask, PartialUpdateTask, PlatformPartialUpdateBuildingTask, SubscriberFullBundleUpdateBuildingTask, SubscriberFullUpdateNotifyingTask, SubscriberPartialUpdateNotifyingTask
Class Method Summary collapse
-
.descendants ⇒ Array
Returns LiveUpdateTask subclasses.
-
.fromHash(aHash) ⇒ Object
Creates an object, parametrises and returns it.
-
.taskName ⇒ String
Returns unique task name.
Instance Method Summary collapse
-
#dispatchToUrl(anUri) ⇒ Object
Method serializes itself to a hash and sends post request with the hash to specified URI.
-
#execute ⇒ Object
Execute specific task action.
Class Method Details
.descendants ⇒ Array
Returns LiveUpdateTask subclasses
14 15 16 |
# File 'lib/build/development/live_update_task.rb', line 14 def self.descendants ObjectSpace.each_object(Class).select { |each| each < self } end |
.fromHash(aHash) ⇒ Object
Creates an object, parametrises and returns it
21 22 23 |
# File 'lib/build/development/live_update_task.rb', line 21 def self.fromHash(aHash) self.new end |
.taskName ⇒ String
Returns unique task name
8 9 10 |
# File 'lib/build/development/live_update_task.rb', line 8 def self.taskName self.name end |
Instance Method Details
#dispatchToUrl(anUri) ⇒ Object
Method serializes itself to a hash and sends post request with the hash to specified URI
39 40 41 42 |
# File 'lib/build/development/live_update_task.rb', line 39 def dispatchToUrl(anUri) uri = URI.join(anUri, 'tasks/new') Net::HTTP.post_form(uri, {'taskName' => self.class.taskName}) end |
#execute ⇒ Object
Execute specific task action
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/build/development/live_update_task.rb', line 26 def execute puts "Executing #{self.class.taskName} at #{Time::now}".primary begin self.action rescue => e puts "Executing #{self.class.taskName} failed".warning puts e.inspect.to_s.info puts e.backtrace.to_s.info end end |