lib/cfoundry/v2/app.rb in cfoundry-0.5.1.rc2 vs lib/cfoundry/v2/app.rb in cfoundry-0.5.1.rc3
- old
+ new
@@ -187,18 +187,30 @@
self.state = "STOPPED"
update!
end
# Start the application.
- def start!
+ def start!(async = false, &blk)
self.state = "STARTED"
- update!
+ update!(async, &blk)
end
# Restart the application.
- def restart!
+ def restart!(async = false, &blk)
stop!
- start!
+ start!(async, &blk)
+ end
+
+ def update!(async = false)
+ response = @client.base.update_app(@guid, @diff, async)
+
+ yield response[:headers]["x-app-staging-log"] if block_given?
+
+ @manifest = @client.base.send(:parse_json, response[:body])
+
+ @diff.clear
+
+ true
end
# Determine application health.
#
# If all instances are running, returns "RUNNING". If only some are