Skip to content

Commit

Permalink
FIXED: add_keys stores key paths for Rye::Box and Rye::Set
Browse files Browse the repository at this point in the history
  • Loading branch information
delano committed Oct 25, 2010
1 parent da429e6 commit 3fb63c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,9 @@
RYE, CHANGES

#### 0.9.2 (2010-10-25) #############################

* FIXED: add_keys stores key paths for Rye::Box and Rye::Set

#### 0.9.1 (2010-10-18) #############################

* CHANGE: Don't add keys to ssh-agent in Rye::Box and Rye::Set
Expand Down
16 changes: 3 additions & 13 deletions lib/rye/box.rb
Expand Up @@ -271,19 +271,9 @@ def interactive_ssh(run=true)
# * +additional_keys+ is a list of file paths to private keys
# Returns the instance of Box
def add_keys(*additional_keys)
if Rye.sysinfo.os == :windows
@rye_opts[:keys] ||= []
@rye_opts[:keys] += additional_keys.flatten
return @rye_opts[:keys]
end
additional_keys = [additional_keys].flatten.compact || []
return if additional_keys.empty?
#ret = Rye.add_keys(additional_keys)
#if ret.is_a?(Rye::Rap)
# debug "ssh-add exit_status: #{ret.exit_status}"
# debug "ssh-add stdout: #{ret.stdout}"
# debug "ssh-add stderr: #{ret.stderr}"
#end
@rye_opts[:keys] ||= []
@rye_opts[:keys] += additional_keys.flatten.compact
@rye_opts[:keys].uniq
self # MUST RETURN self
end
alias :add_key :add_keys
Expand Down
19 changes: 10 additions & 9 deletions lib/rye/set.rb
Expand Up @@ -66,20 +66,21 @@ def add_box(*boxes)
end
alias :add_boxes :add_box

# Add one or more private keys to the SSH Agent.
# Add one or more private keys to each box. Also stores key paths
# in the set so when new boxes are added they will get the same keys,
# * +additional_keys+ is a list of file paths to private keys
# Returns the instance of Rye::Set
def add_key(*additional_keys)
if Rye.sysinfo.os == :windows
@opts[:keys] ||= []
@opts[:keys] += additional_keys.flatten
return @opts[:keys]
def add_keys(*additional_keys)
additional_keys = additional_keys.flatten.compact
@opts[:keys] ||= []
@opts[:keys] += additional_keys
@opts[:keys].uniq!
@boxes.each do |box|
box.add_keys *additional_keys
end
additional_keys = [additional_keys].flatten.compact || []
#Rye.add_keys(additional_keys)
self
end
alias :add_keys :add_key
alias :add_key :add_keys

# Add an environment variable. +n+ and +v+ are the name and value.
# Returns the instance of Rye::Set
Expand Down

0 comments on commit 3fb63c7

Please sign in to comment.