diff --git a/warden-client/lib/warden/client/v1.rb b/warden-client/lib/warden/client/v1.rb index 6d98682a..ccd76fb0 100644 --- a/warden-client/lib/warden/client/v1.rb +++ b/warden-client/lib/warden/client/v1.rb @@ -123,10 +123,7 @@ def self.convert_stream_request(args) end def self.convert_stream_response(response) - to_return = [] - to_return << response.name if response.name - to_return << response.data if response.data - to_return + [response.name, response.data, response.exit_status] end def self.convert_run_request(args) diff --git a/warden-client/lib/warden/client/version.rb b/warden-client/lib/warden/client/version.rb index f2254cff..61035f04 100644 --- a/warden-client/lib/warden/client/version.rb +++ b/warden-client/lib/warden/client/version.rb @@ -1,5 +1,5 @@ module Warden class Client - VERSION = "0.0.4" + VERSION = "0.0.5" end end diff --git a/warden-client/spec/client/v1_spec.rb b/warden-client/spec/client/v1_spec.rb index 70b25bb7..1975ccb7 100644 --- a/warden-client/spec/client/v1_spec.rb +++ b/warden-client/spec/client/v1_spec.rb @@ -218,22 +218,19 @@ def to_response(response) end describe "response" do - it "should return a 2-element tuple" do + it "should return a 3-element tuple" do response = to_response \ Warden::Protocol::StreamResponse.new( :name => "stdout", - :data => "data" + :data => "data", + :exit_status => 25, ) response[0].should == "stdout" response[1].should == "data" + response[2].should == 25 end end - - it "should return an empty tuple when streaming stops" do - response = to_response Warden::Protocol::StreamResponse.new - response.size.should == 0 - end end describe "run" do diff --git a/warden-protocol/Gemfile b/warden-protocol/Gemfile index e07ef1ed..97c6db6d 100644 --- a/warden-protocol/Gemfile +++ b/warden-protocol/Gemfile @@ -2,3 +2,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in warden-protocol.gemspec gemspec + +gem 'rake' \ No newline at end of file diff --git a/warden-protocol/lib/warden/protocol/stream.rb b/warden-protocol/lib/warden/protocol/stream.rb index 126a82bc..c9d9775a 100644 --- a/warden-protocol/lib/warden/protocol/stream.rb +++ b/warden-protocol/lib/warden/protocol/stream.rb @@ -12,6 +12,7 @@ class StreamRequest < BaseRequest class StreamResponse < BaseResponse optional :name, :string, 1 optional :data, :string, 2 + optional :exit_status, :uint32, 3 end end end diff --git a/warden-protocol/lib/warden/protocol/version.rb b/warden-protocol/lib/warden/protocol/version.rb index d639164a..ee7ef9e5 100644 --- a/warden-protocol/lib/warden/protocol/version.rb +++ b/warden-protocol/lib/warden/protocol/version.rb @@ -2,6 +2,6 @@ module Warden module Protocol - VERSION = "0.0.3" + VERSION = "0.0.4" end end diff --git a/warden-protocol/spec/stream_spec.rb b/warden-protocol/spec/stream_spec.rb index bd83843f..5564c681 100644 --- a/warden-protocol/spec/stream_spec.rb +++ b/warden-protocol/spec/stream_spec.rb @@ -50,4 +50,9 @@ it_should_be_optional it_should_be_typed_as_string end + + field :exit_status do + it_should_be_optional + it_should_be_typed_as_uint + end end