lib/cmds/stream.rb in cmds-0.2.1 vs lib/cmds/stream.rb in cmds-0.2.2

- old
+ new

@@ -9,21 +9,16 @@ # # @return [Fixnum] # command exit status. # def stream *args, **kwds, &io_block - Cmds.debug "entering Cmd#stream", + Cmds.debug "entering Cmds#stream", args: args, kwds: kwds, io_block: io_block - Cmds.spawn prepare(*args, **kwds), - input: @input, - # include env if mode is spawn argument - env: (@env_mode == :spawn_arg ? @env : {}), - chdir: @chdir, - &io_block + spawn *args, **kwds, &io_block end # #stream # stream and raise an error if exit code is not 0. # # @param *args (see #capture) @@ -33,19 +28,12 @@ # # @raise [SystemCallError] # if exit status is not 0. # def stream! *args, **kwds, &io_block - cmd = prepare(*args, **kwds) + status = stream *args, **kwds, &io_block - status = Cmds.spawn cmd, - input: @input, - # include env if mode is spawn argument - env: (@env_mode == :spawn_arg ? @env : {}), - chdir: @chdir, - &io_block - - Cmds.check_status cmd, status + Cmds.check_status last_prepared_cmd, status status end # #stream! end # Cmds \ No newline at end of file