scutil 0.3.2 → 0.3.3
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.rdoc +5 -0
- data/lib/scutil.rb +6 -3
- data/scutil.gemspec +2 -2
- data/test/test_scutil.rb +2 -1
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/lib/scutil.rb
CHANGED
@@ -30,7 +30,7 @@ require 'scutil/connection_cache'
|
|
30
30
|
require 'scutil/system_connection'
|
31
31
|
|
32
32
|
module Scutil
|
33
|
-
SCUTIL_VERSION = '0.3.
|
33
|
+
SCUTIL_VERSION = '0.3.3'
|
34
34
|
# By default, buffer 10M of data before writing.
|
35
35
|
DEFAULT_OUTPUT_BUFFER_SIZE = 0xA00000
|
36
36
|
# Checks for a command starting with _sudo_ by default.
|
@@ -81,7 +81,7 @@ module Scutil
|
|
81
81
|
# the command are captured.
|
82
82
|
#
|
83
83
|
# If _output_ is a string it will be treated as a filename to be
|
84
|
-
# opened (mode 'w
|
84
|
+
# opened (mode 'w') and all command output will be written to
|
85
85
|
# this file. If _output_ is an IO object it will be treated as an
|
86
86
|
# open file handle.* Finally, if _output_ is omitted, or an empty
|
87
87
|
# string, all command output will be directed to _$stdout_.
|
@@ -146,7 +146,7 @@ module Scutil
|
|
146
146
|
# XXX: This may not be a safe assumuption...
|
147
147
|
fh = output
|
148
148
|
elsif (output.class == String)
|
149
|
-
fh = File.open(output, 'w
|
149
|
+
fh = File.open(output, 'w') unless output.empty?
|
150
150
|
else
|
151
151
|
raise Scutil::Error.new("Error: Invalid output object type: #{output.class}.", hostname)
|
152
152
|
end
|
@@ -201,6 +201,9 @@ module Scutil
|
|
201
201
|
|
202
202
|
# Write whatever is left
|
203
203
|
fh.write odata
|
204
|
+
|
205
|
+
# Close the file or you'll chase red herrings for two hours...
|
206
|
+
fh.close unless fh == $stdout
|
204
207
|
|
205
208
|
# If extended_data was recieved there was a problem...
|
206
209
|
raise Scutil::Error.new("Error: #{edata}", hostname, exit_status) unless (edata.empty?)
|
data/scutil.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'scutil'
|
4
|
-
s.version = '0.3.
|
5
|
-
s.date = '2011-
|
4
|
+
s.version = '0.3.3'
|
5
|
+
s.date = '2011-12-20'
|
6
6
|
s.summary = 'SSH Command UTILity'
|
7
7
|
s.description = <<-EOF
|
8
8
|
Scutil is a library for conveniently executing commands
|
data/test/test_scutil.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/ruby -I../lib -I.
|
1
|
+
#!/usr/bin/ruby -I../lib -I.
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'scutil'
|
@@ -211,4 +211,5 @@ if ARGV[0].nil?
|
|
211
211
|
end
|
212
212
|
|
213
213
|
(TestScutil.hostname, TestScutil.port) = ARGV[0].split(':')
|
214
|
+
ARGV[0] = nil;
|
214
215
|
TestScutil.user = 'mas'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
16
|
-
requirement: &
|
16
|
+
requirement: &20792060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 2.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20792060
|
25
25
|
description: ! " Scutil is a library for conveniently executing commands \n remotely
|
26
26
|
via SSH.\n"
|
27
27
|
email: marcantoniosr@gmail.com
|