ssh-forever 0.2.2 → 0.2.3

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.
@@ -1,3 +1,8 @@
1
+ == 0.2.3 2010-02-01
2
+
3
+ === New Features
4
+ * Use the -n switch to automatically add a friendly name to your ~/.ssh/config (Tom Stuart)
5
+
1
6
  == 0.2.2 2009-09-27
2
7
 
3
8
  === New Features
@@ -2,16 +2,16 @@
2
2
 
3
3
  Simple command to give you password-less SSH login on remote servers:
4
4
 
5
- ssh-forever username@yourserver.com [-p port] [-i identity_file]
5
+ ssh-forever username@yourserver.com [-p port] [-i identity_file] [-n name_for_future_use]
6
6
 
7
7
  ## Installation
8
8
 
9
9
  gem sources --add http://gemcutter.org
10
- gem install ssh-forever
10
+ sudo gem install ssh-forever
11
11
 
12
12
  ## Example:
13
13
 
14
- [matt@bowie ssh-forever (master)]$ ssh-forever mattwynne@mattwynne.net
14
+ [matt@bowie ssh-forever (master)]$ ssh-forever mattwynne@mattwynne.net -n dreamhost
15
15
  You do not appear to have a public key. I expected to find one at /Users/matt/.ssh/id_rsa.pub
16
16
  Would you like me to generate one? [Y/n]y
17
17
  Copying your public key to the remote server. Prepare to enter your password for the last time.
@@ -29,7 +29,8 @@ Simple command to give you password-less SSH login on remote servers:
29
29
  All activity may be logged by DreamHost Web Hosting.
30
30
 
31
31
  Last login: Sat Aug 15 17:24:17 2009
32
- [broncos]$
32
+ [broncos]$ exit
33
+ [matt@bowie ssh-forever (master)]$ ssh dreamhost
33
34
 
34
35
  ## Why
35
36
 
@@ -17,6 +17,10 @@ OptionParser.new do |opts|
17
17
  opts.on('-i', '--identity_file [IDENTITY_FILE]', 'identity_file') do |identity_file|
18
18
  options[:identity_file] = identity_file
19
19
  end
20
+
21
+ opts.on('-n', '--name [NAME]', 'name') do |name|
22
+ options[:name] = name
23
+ end
20
24
  end.parse!
21
25
 
22
26
  login = ARGV[0]
@@ -27,8 +27,25 @@ module SshForever
27
27
  `ssh #{@login}#{args} "#{remote_command}"`
28
28
  exit 1 unless $?.exitstatus == 0
29
29
 
30
+ if @options[:name]
31
+ puts "Creating host entry in local ssh config with name #{@options[:name]}"
32
+ File.open(File.expand_path("~/.ssh/config"), "a") do |config|
33
+ #ah heredocs, how I hate you...
34
+ host_config = <<-STUFF
35
+
36
+ Host #{@options[:name]}
37
+ HostName #{@login.split("@")[1]}
38
+ User #{@login.split("@")[0]}
39
+ STUFF
40
+ config << host_config
41
+ end
42
+ login_command = "ssh #{@options[:name]}#{args}"
43
+ else
44
+ login_command = "ssh #{@login}#{args}"
45
+ end
46
+
30
47
  puts "Success. From now on you can just use plain old 'ssh'. Logging you in..."
31
- exec "ssh #{@login}#{args}"
48
+ exec login_command
32
49
  end
33
50
 
34
51
  private
@@ -1,11 +1,6 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
- # -*- encoding: utf-8 -*-
5
-
6
1
  Gem::Specification.new do |s|
7
2
  s.name = %q{ssh-forever}
8
- s.version = "0.2.2"
3
+ s.version = "0.2.3"
9
4
 
10
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
6
  s.authors = ["Matt Wynne"]
@@ -23,7 +18,6 @@ Gem::Specification.new do |s|
23
18
  "History.txt",
24
19
  "LICENSE",
25
20
  "README.markdown",
26
- "Rakefile",
27
21
  "VERSION",
28
22
  "bin/ssh-forever",
29
23
  "lib/ssh-forever.rb",
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssh-forever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ hash: 17
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 3
10
+ version: 0.2.3
5
11
  platform: ruby
6
12
  authors:
7
13
  - Matt Wynne
@@ -27,7 +33,6 @@ files:
27
33
  - History.txt
28
34
  - LICENSE
29
35
  - README.markdown
30
- - Rakefile
31
36
  - VERSION
32
37
  - bin/ssh-forever
33
38
  - lib/ssh-forever.rb
@@ -42,21 +47,27 @@ rdoc_options:
42
47
  require_paths:
43
48
  - lib
44
49
  required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ">="
47
53
  - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
48
57
  version: "0"
49
- version:
50
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
51
60
  requirements:
52
61
  - - ">="
53
62
  - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
54
66
  version: "0"
55
- version:
56
67
  requirements: []
57
68
 
58
69
  rubyforge_project:
59
- rubygems_version: 1.3.4
70
+ rubygems_version: 1.4.2
60
71
  signing_key:
61
72
  specification_version: 3
62
73
  summary: Butter-smooth password-less SSH setup
data/Rakefile DELETED
@@ -1,19 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "ssh-forever"
8
- gem.summary = %Q{Butter-smooth password-less SSH setup}
9
- gem.description = %Q{Provides a replacement for the SSH command which automatically copies your public key while logging in}
10
- gem.email = "matt@mattwynne.net"
11
- gem.homepage = "http://github.com/mattwynne/ssh-forever"
12
- gem.authors = ["Matt Wynne"]
13
- gem.bindir = 'bin'
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
- end
16
- Jeweler::GemcutterTasks.new
17
- rescue LoadError
18
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
19
- end