scutil 0.4.0 → 0.4.1
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 +11 -13
- data/scutil.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/lib/scutil.rb
CHANGED
@@ -29,7 +29,7 @@ require 'scutil/connection_cache'
|
|
29
29
|
require 'scutil/system_connection'
|
30
30
|
|
31
31
|
module Scutil
|
32
|
-
SCUTIL_VERSION = '0.4.
|
32
|
+
SCUTIL_VERSION = '0.4.1'
|
33
33
|
|
34
34
|
# By default, buffer 10M of data before writing.
|
35
35
|
DEFAULT_OUTPUT_BUFFER_SIZE = 0xA00000
|
@@ -37,12 +37,12 @@ module Scutil
|
|
37
37
|
# Checks for a command starting with _sudo_ by default.
|
38
38
|
DEFAULT_PTY_REGEX = /^\s*sudo/
|
39
39
|
|
40
|
-
# Default password prompt is
|
40
|
+
# Default password prompt is <em>[sudo] password for</em>. Redhat based systems use
|
41
41
|
# _Password:_ instead.
|
42
42
|
DEFAULT_SUDO_PASSWD_REGEX = /^\[sudo\] password for/
|
43
43
|
# DEFAULT_PASSWD_REGEX = /^Password:/
|
44
44
|
|
45
|
-
# Default password failed prompt is
|
45
|
+
# Default password failed prompt is <em>Sorry, try again</em>.
|
46
46
|
DEFAULT_SUDO_PASSWD_FAILED_REGEX = /^Sorry, try again/
|
47
47
|
|
48
48
|
@connection_cache = ConnectionCache.new
|
@@ -82,9 +82,9 @@ module Scutil
|
|
82
82
|
#
|
83
83
|
# If _output_ is a string it will be treated as a filename to be opened
|
84
84
|
# (mode 'w') and all command output will be written to this file. If
|
85
|
-
# _output_ is an IO object it will be treated as an open file handle
|
85
|
+
# _output_ is an IO object it will be treated as an open file handle.
|
86
86
|
# Finally, if _output_ is omitted, or an empty string, all command output
|
87
|
-
# will be directed to
|
87
|
+
# will be directed to <em>$stdout</em>.
|
88
88
|
#
|
89
89
|
# <em>*NB:* This isn't actually true. The only check made is to see if
|
90
90
|
# _output_ responds to +:write+. The idea being that not only will a file
|
@@ -101,10 +101,8 @@ module Scutil
|
|
101
101
|
#
|
102
102
|
# * :scutil_verbose => Extra output.
|
103
103
|
# * :scutil_force_pty => Force a PTY request (or not) for every channel.
|
104
|
-
# * :scutil_pty_regex => Specific a custom regex here for use when scutil
|
105
|
-
#
|
106
|
-
# * :scutil_sudo_passwd_regex => If sudo requires a password you can specify the
|
107
|
-
# prompt to look for, e.g., _Password:_ .
|
104
|
+
# * :scutil_pty_regex => Specific a custom regex here for use when scutil decides whether or not to request a PTY.
|
105
|
+
# * :scutil_sudo_passwd_regex => If sudo requires a password you can specify the prompt to look for, e.g., _Password:_ .
|
108
106
|
# * :scutil_sudo_passwd_failed_regex => Regular expression for a sudo password failure.
|
109
107
|
# * :scutil_sudo_passwd => The sudo password.
|
110
108
|
#
|
@@ -112,12 +110,12 @@ module Scutil
|
|
112
110
|
# on to Net::SSH, _except_ those prefixed with _scutil__.
|
113
111
|
#
|
114
112
|
# All calls to Scutil.exec_command, regardless of the way it's used, will
|
115
|
-
# return the remote command's return value
|
113
|
+
# return the remote command's return value:
|
116
114
|
#
|
117
115
|
# retval = Scutil.exec_command('hostname', 'username', '/bin/true')
|
118
116
|
# puts "True is false!" if retval != 0
|
119
117
|
#
|
120
|
-
# See the
|
118
|
+
# See the _test_ directory for more usage examples.
|
121
119
|
def exec_command(hostname, username, cmd, output=nil, new_options={})
|
122
120
|
# Fill in defaults
|
123
121
|
options = get_default_options
|
@@ -279,8 +277,8 @@ Define in :scutil_sudo_passwd or check :scutil_sudo_failed_passwd for the correc
|
|
279
277
|
:scutil_verbose => false,
|
280
278
|
:scutil_force_pty => false,
|
281
279
|
:scutil_pty_regex => DEFAULT_PTY_REGEX,
|
282
|
-
:scutil_sudo_passwd_regex =>
|
283
|
-
:scutil_sudo_passwd_failed_regex =>
|
280
|
+
:scutil_sudo_passwd_regex => DEFAULT_SUDO_PASSWD_REGEX,
|
281
|
+
:scutil_sudo_passwd_failed_regex => DEFAULT_SUDO_PASSWD_FAILED_REGEX,
|
284
282
|
:scutil_sudo_passwd => nil
|
285
283
|
}
|
286
284
|
end
|
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.4.
|
5
|
-
s.date = '2012-02-
|
4
|
+
s.version = '0.4.1'
|
5
|
+
s.date = '2012-02-22'
|
6
6
|
s.summary = 'SSH Command UTILity'
|
7
7
|
s.description = <<-EOF
|
8
8
|
Scutil is a library for conveniently executing commands
|
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.4.
|
4
|
+
version: 0.4.1
|
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: 2012-02-
|
12
|
+
date: 2012-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
16
|
-
requirement: &
|
16
|
+
requirement: &12112160 !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: *12112160
|
25
25
|
description: ! " Scutil is a library for conveniently executing commands \n remotely
|
26
26
|
via SSH.\n"
|
27
27
|
email: marcantoniosr@gmail.com
|