rye 0.8.13 → 0.8.14

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.
Files changed (6) hide show
  1. data/CHANGES.txt +6 -2
  2. data/bin/rye +12 -14
  3. data/lib/rye.rb +1 -1
  4. data/lib/rye/box.rb +5 -3
  5. data/rye.gemspec +1 -1
  6. metadata +2 -2
data/CHANGES.txt CHANGED
@@ -1,10 +1,14 @@
1
1
  RYE, CHANGES
2
2
 
3
- TODO: Fix "rye authorize" for remote root user
3
+ #### 0.8.14 (2010-02-25) #############################
4
+
5
+ * FIXED: rye authorize command now logs in to grab the actual homedir.
6
+ * CHANGED: Support user@host syntax for rye authorize command
7
+
4
8
 
5
9
  #### 0.8.13 (2010-02-12) #############################
6
10
 
7
- * CHANGE: Remove hanna dependency
11
+ * CHANGE: Remove hanna dependency [Diego Elio 'Flameeyes' Pettenò]
8
12
 
9
13
  #### 0.8.12 (2010-01-16) #############################
10
14
 
data/bin/rye CHANGED
@@ -51,24 +51,22 @@ command :ssh do |obj|
51
51
  end
52
52
 
53
53
  about "Add your public keys to one or more remote machines"
54
- usage "rye authorize [-u username] host"
55
- option :u, :user, String, "Username"
54
+ usage "rye authorize [username@]host"
56
55
  argv :hostname
57
56
  command :authorize do |obj|
58
57
  raise "You must specify a host" unless obj.argv.hostname
59
- user = Rye.sysinfo.user
60
-
61
- opts = { :debug => nil, :auth_methods => %w(publickey hostbased) }
62
- opts[:user] = obj.option.user if obj.option.user
63
- opts[:user] ||= user
64
-
65
58
  obj.argv.each do |hostname|
66
-
67
- puts "Authorizing #{opts[:user]}@#{hostname}"
68
- rbox = Rye::Box.new(hostname, opts)
69
- puts "Added public keys for: ", rbox.authorize_keys_remote
70
- puts "Now try: " << "ssh #{opts[:user]}@#{hostname}"
71
-
59
+ if hostname.index('@')
60
+ user, host = *hostname.split('@')
61
+ else
62
+ user, host = user = Rye.sysinfo.user, hostname
63
+ end
64
+ opts = { :debug => nil, :user => user, :auth_methods => %w(publickey hostbased) }
65
+ puts "Authorizing #{user}@#{host}"
66
+ rbox = Rye::Box.new(host, opts)
67
+ rbox.authorize_keys_remote
68
+ puts "Added public keys for: ", Rye.keys
69
+ puts "Now try: " << "ssh #{user}@#{host}"
72
70
  end
73
71
 
74
72
  end
data/lib/rye.rb CHANGED
@@ -42,7 +42,7 @@ require 'esc'
42
42
  module Rye
43
43
  extend self
44
44
 
45
- VERSION = "0.8.13".freeze unless defined?(VERSION)
45
+ VERSION = "0.8.14".freeze unless defined?(VERSION)
46
46
 
47
47
  @@sysinfo = nil
48
48
  @@agent_env = Hash.new # holds ssh-agent env vars
data/lib/rye/box.rb CHANGED
@@ -362,7 +362,8 @@ module Rye
362
362
  elsif ostmp == "windows"
363
363
  user_defaults['HOME'] = 'C:/Documents and Settings'
364
364
  else
365
- raw = self.quietly { useradd(:D) } rescue ["HOME=/home"]
365
+ raw = self.quietly { useradd(:D) } rescue []
366
+ raw = ["HOME=/home"] if raw.nil? || raw.empty?
366
367
  raw.each do |nv|
367
368
  n, v = nv.scan(/\A([\w_-]+?)=(.+)\z/).flatten
368
369
  user_defaults[n] = v
@@ -390,7 +391,8 @@ module Rye
390
391
 
391
392
  # The homedir path is important b/c this is where we're going to
392
393
  # look for the .ssh directory. That's where auth love is stored.
393
- homedir = self.guess_user_home(this_user)
394
+ homedir = self.quietly { pwd }.first
395
+ homedir ||= self.guess_user_home(this_user)
394
396
 
395
397
  unless self.file_exists?(homedir)
396
398
  rap.add_exit_code(1)
@@ -401,7 +403,7 @@ module Rye
401
403
  # Let's go into the user's home directory that we now know exists.
402
404
  self.cd homedir
403
405
 
404
- files = ['.ssh/authorized_keys', '.ssh/authorized_keys2']
406
+ files = ['.ssh/authorized_keys', '.ssh/authorized_keys2', '.ssh/identity']
405
407
  files.each do |akey_path|
406
408
  if self.file_exists?(akey_path)
407
409
  # TODO: Make Rye::Cmd.incremental_backup
data/rye.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "rye"
3
3
  s.rubyforge_project = "rye"
4
- s.version = "0.8.13"
4
+ s.version = "0.8.14"
5
5
  s.summary = "Rye: Safely run SSH commands on a bunch of machines at the same time (from Ruby)."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-12 00:00:00 -05:00
12
+ date: 2010-02-25 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency