Class: RhoDevelopment::PlatformPartialUpdateBuildingTask
- Inherits:
-
LiveUpdateTask
- Object
- LiveUpdateTask
- RhoDevelopment::PlatformPartialUpdateBuildingTask
- Defined in:
- lib/build/development/live_update_task.rb
Overview
Class builds partial update bundle for specified platform
Class Method Summary collapse
-
.fromHash(aHash) ⇒ Object
Creates instance of class and parametrises it with values from passed argument.
-
.taskName ⇒ String
Returns unique task name.
Instance Method Summary collapse
-
#action ⇒ Object
Builds partial update bundle.
-
#dispatchToUrl(anUri) ⇒ Object
Method serializes itself to a hash and sends post request with the hash to specified URI.
-
#initialize(aPlatform, aFilename) ⇒ PlatformPartialUpdateBuildingTask
constructor
Initialize instance with platform name.
Methods inherited from LiveUpdateTask
Constructor Details
#initialize(aPlatform, aFilename) ⇒ PlatformPartialUpdateBuildingTask
Initialize instance with platform name
154 155 156 157 |
# File 'lib/build/development/live_update_task.rb', line 154 def initialize(aPlatform, aFilename) @platform = aPlatform @filename = aFilename end |
Class Method Details
.fromHash(aHash) ⇒ Object
Creates instance of class and parametrises it with values from passed argument
148 149 150 |
# File 'lib/build/development/live_update_task.rb', line 148 def self.fromHash(aHash) self.new(aHash['platform'], aHash['filename']) end |
.taskName ⇒ String
Returns unique task name
141 142 143 |
# File 'lib/build/development/live_update_task.rb', line 141 def self.taskName 'BuildPlatformPartialUpdate' end |
Instance Method Details
#action ⇒ Object
Builds partial update bundle
160 161 162 163 |
# File 'lib/build/development/live_update_task.rb', line 160 def action server = BuildServer.new server.build_partial_bundle_for_platform(@platform, @filename) end |
#dispatchToUrl(anUri) ⇒ Object
Method serializes itself to a hash and sends post request with the hash to specified URI
167 168 169 170 |
# File 'lib/build/development/live_update_task.rb', line 167 def dispatchToUrl(anUri) uri = URI.join(anUri, 'tasks/new') Net::HTTP.post_form(uri, {'taskName' => self.class.taskName, 'platform' => @platform, 'filename' => @filename}) end |