lib/rye.rb in rye-0.4.1 vs lib/rye.rb in rye-0.4.3
- old
+ new
@@ -20,10 +20,16 @@
# happens over SSH (no HTTP daemon) and the default settings are
# less dangerous (for safety). For example, file globs are
# disabled so unless otherwise specified, you can't do this:
# <tt>rbox.rm('/etc/**/*')</tt>.
#
+# However, you can do this:
+#
+# rset = Rye::Set.new("dev-machines")
+# rset.add_boxes('host1', 'host2', 'host3', 'host4')
+# rset.ps('aux').grep
+#
# * See +bin/try+ for a bunch of working examples.
# * See Rye::Box#initialize for info about disabling safe-mode.
#
module Rye
extend self
@@ -101,12 +107,11 @@
# Add one or more private keys to the SSH Agent.
# * +keys+ one or more file paths to private keys used for passwordless logins.
def add_keys(*keys)
keys = keys.flatten.compact || []
return if keys.empty?
- Rye.shell("ssh-add", keys) if keys
- keys
+ Rye.shell("ssh-add", keys)
end
# Returns an Array of info about the currently available
# SSH keys, as provided by the SSH Agent. See
# Rye.start_sshagent_environment
@@ -210,9 +215,13 @@
# it will send them through Escape.shell_command otherwise
# it will return them joined by a space character.
def escape(safe, cmd, *args)
args = args.flatten.compact || []
safe ? Escape.shell_command(cmd, *args).to_s : [cmd, args].flatten.compact.join(' ')
+ end
+
+ def sshagent_info
+ @@agent_env
end
private
\ No newline at end of file