Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
process running moved to dedicated method
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jan 12, 2011
1 parent 2e50e98 commit cc7487a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/net/ssh/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def opening?
def execute(command, klass=nil, &callback)
klass ||= default_process_class
process = klass.new(self, command, callback)
process.run if processes.empty?
processes << process
run_next_process if processes.length == 1
process
end

Expand Down Expand Up @@ -95,7 +95,7 @@ def close!
def child_finished(child)
channel.on_close(&method(:on_channel_close)) if !channel.nil?
processes.delete(child)
processes.first.run if processes.any?
run_next_process
end

def separator
Expand All @@ -112,6 +112,10 @@ def on_channel_close(channel)

private

def run_next_process
processes.first.run if processes.any?
end

def open_succeeded(channel)
@state = :pty
channel.on_close(&method(:on_channel_close))
Expand Down

0 comments on commit cc7487a

Please sign in to comment.