Class: Cabal::IdentityManager
- Inherits:
-
Object
- Object
- Cabal::IdentityManager
- Defined in:
- lib/cabal/identity_manager.rb
Overview
Manages ssh-agent sessions for forwarding identity information via Cabal::SSH
Instance Attribute Summary collapse
-
#env ⇒ String
readonly
The environment settings for the running ssh-agent.
Instance Method Summary collapse
-
#start ⇒ nil
Spawns an ssh-agent process and records its related environment settings.
-
#stop ⇒ nil
Stops a running ssh-agent that was previously spawned.
Instance Attribute Details
#env ⇒ String (readonly)
Returns the environment settings for the running ssh-agent.
7 8 9 |
# File 'lib/cabal/identity_manager.rb', line 7 def env @env end |
Instance Method Details
#start ⇒ nil
Spawns an ssh-agent process and records its related environment settings
11 12 13 14 15 16 |
# File 'lib/cabal/identity_manager.rb', line 11 def start @env = start_agent. split(/(\;|\n)/). select {|line| line =~ /^SSH_/}. join(' ') end |
#stop ⇒ nil
Stops a running ssh-agent that was previously spawned
20 21 22 |
# File 'lib/cabal/identity_manager.rb', line 20 def stop stop_agent end |