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

Commit 480876e

Browse files
committed
Stylistic changes
1 parent 0cc96f3 commit 480876e

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

lib/net/ssh/shell.rb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def execute(command, klass=nil, &callback)
6767
process = klass.new(self, command, callback)
6868
process.run if processes.empty?
6969
processes << process
70-
return process
70+
process
7171
end
7272

7373
def subshell(command, &callback)
@@ -77,7 +77,7 @@ def subshell(command, &callback)
7777
def execute!(command, &callback)
7878
execute(command, &callback)
7979
wait!
80-
return process
80+
process
8181
end
8282

8383
def busy?
@@ -112,41 +112,41 @@ def on_channel_close(channel)
112112

113113
private
114114

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
120120

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
125125

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))
134133
end
134+
end
135135

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
142142

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
149148
end
149+
end
150150
end
151151
end
152152
end
@@ -158,6 +158,6 @@ class Net::SSH::Connection::Session
158158
def shell(*args)
159159
shell = Net::SSH::Shell.new(self, *args)
160160
yield shell if block_given?
161-
return shell
161+
shell
162162
end
163163
end

0 commit comments

Comments
 (0)