@@ -67,7 +67,7 @@ def execute(command, klass=nil, &callback)
67
67
process = klass . new ( self , command , callback )
68
68
process . run if processes . empty?
69
69
processes << process
70
- return process
70
+ process
71
71
end
72
72
73
73
def subshell ( command , &callback )
@@ -77,7 +77,7 @@ def subshell(command, &callback)
77
77
def execute! ( command , &callback )
78
78
execute ( command , &callback )
79
79
wait!
80
- return process
80
+ process
81
81
end
82
82
83
83
def busy?
@@ -112,41 +112,41 @@ def on_channel_close(channel)
112
112
113
113
private
114
114
115
- def open_succeeded ( channel )
116
- @state = :pty
117
- channel . on_close ( &method ( :on_channel_close ) )
118
- channel . request_pty ( :modes => { Net ::SSH ::Connection ::Term ::ECHO => 0 } , &method ( :pty_requested ) )
119
- end
115
+ def open_succeeded ( channel )
116
+ @state = :pty
117
+ channel . on_close ( &method ( :on_channel_close ) )
118
+ channel . request_pty ( :modes => { Net ::SSH ::Connection ::Term ::ECHO => 0 } , &method ( :pty_requested ) )
119
+ end
120
120
121
- def open_failed ( channel , code , description )
122
- @state = :closed
123
- raise "could not open channel for process manager (#{ description } , ##{ code } )"
124
- end
121
+ def open_failed ( channel , code , description )
122
+ @state = :closed
123
+ raise "could not open channel for process manager (#{ description } , ##{ code } )"
124
+ end
125
125
126
- def pty_requested ( channel , success )
127
- @state = :shell
128
- raise "could not request pty for process manager" unless success
129
- if shell == :default
130
- channel . send_channel_request ( "shell" , &method ( :shell_requested ) )
131
- else
132
- channel . exec ( shell , &method ( :shell_requested ) )
133
- end
126
+ def pty_requested ( channel , success )
127
+ @state = :shell
128
+ raise "could not request pty for process manager" unless success
129
+ if shell == :default
130
+ channel . send_channel_request ( "shell" , &method ( :shell_requested ) )
131
+ else
132
+ channel . exec ( shell , &method ( :shell_requested ) )
134
133
end
134
+ end
135
135
136
- def shell_requested ( channel , success )
137
- @state = :initializing
138
- raise "could not request shell for process manager" unless success
139
- channel . on_data ( &method ( :look_for_initialization_done ) )
140
- channel . send_data "export PS1=; echo #{ separator } $?\n "
141
- end
136
+ def shell_requested ( channel , success )
137
+ @state = :initializing
138
+ raise "could not request shell for process manager" unless success
139
+ channel . on_data ( &method ( :look_for_initialization_done ) )
140
+ channel . send_data "export PS1=; echo #{ separator } $?\n "
141
+ end
142
142
143
- def look_for_initialization_done ( channel , data )
144
- if data . include? ( separator )
145
- @state = :open
146
- @when_open . each { |callback | callback . call ( self ) }
147
- @when_open . clear
148
- end
143
+ def look_for_initialization_done ( channel , data )
144
+ if data . include? ( separator )
145
+ @state = :open
146
+ @when_open . each { |callback | callback . call ( self ) }
147
+ @when_open . clear
149
148
end
149
+ end
150
150
end
151
151
end
152
152
end
@@ -158,6 +158,6 @@ class Net::SSH::Connection::Session
158
158
def shell ( *args )
159
159
shell = Net ::SSH ::Shell . new ( self , *args )
160
160
yield shell if block_given?
161
- return shell
161
+ shell
162
162
end
163
163
end
0 commit comments