sshkit 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +6 -0
- data/lib/sshkit/command.rb +4 -1
- data/lib/sshkit/version.rb +1 -1
- data/test/unit/test_command.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
This file is written in reverse chronological order, newer releases will
|
4
4
|
appear at the top.
|
5
5
|
|
6
|
+
## 0.0.12
|
7
|
+
|
8
|
+
* Also print anything the program wrote to stdout when the exit status is
|
9
|
+
non-zero and the command raises an error. (assits debugging badly behaved
|
10
|
+
programs that fail, and write their error output to stdout.)
|
11
|
+
|
6
12
|
## 0.0.11
|
7
13
|
|
8
14
|
* Implementing confuguration objects on the backends (WIP, undocumented)
|
data/lib/sshkit/command.rb
CHANGED
@@ -86,7 +86,10 @@ module SSHKit
|
|
86
86
|
@finished_at = Time.now
|
87
87
|
@exit_status = new_exit_status
|
88
88
|
if options[:raise_on_non_zero_exit] && exit_status > 0
|
89
|
-
|
89
|
+
message = ""
|
90
|
+
message += (stdout.strip.empty? ? "No messages written to stdout\n" : stdout.strip)
|
91
|
+
message += (stderr.strip.empty? ? "No messages written to stderr\n" : stderr.strip)
|
92
|
+
raise Failed, message
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
data/lib/sshkit/version.rb
CHANGED
data/test/unit/test_command.rb
CHANGED
@@ -159,7 +159,7 @@ module SSHKit
|
|
159
159
|
error = assert_raises SSHKit::Command::Failed do
|
160
160
|
Command.new(:whoami).exit_status = 1
|
161
161
|
end
|
162
|
-
assert_equal "No messages written to stderr", error.message
|
162
|
+
assert_equal "No messages written to stdout\nNo messages written to stderr\n", error.message
|
163
163
|
end
|
164
164
|
|
165
165
|
end
|