sshp 0.0.1 → 0.0.2

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.
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in sidekiq-throttler.gemspec
4
3
  gemspec
data/README.md CHANGED
@@ -11,10 +11,10 @@ gem install sshp
11
11
  To save an alias without hostname.
12
12
 
13
13
  ```sh
14
- sshp-alias u -i ~/keys/my_key.pem -l ubuntu"
14
+ sshp-alias u -i ~/keys/my_key.pem -l ubuntu
15
15
  ```
16
16
 
17
- To ssh an alias.
17
+ Then
18
18
 
19
19
  ```sh
20
20
  sshp u hostname.com
@@ -24,7 +24,7 @@ To save an alias with hostname.
24
24
  ```sh
25
25
  sshp-alias u -i ~/keys/my_key.pem -l ubuntu hostname.com
26
26
  ```
27
- To ssh an alias.
27
+ Then
28
28
 
29
29
  ```sh
30
30
  sshp u
data/bin/sshp CHANGED
@@ -10,7 +10,9 @@ if ARGV.any?
10
10
  puts "Executing #{command}"
11
11
  exec command
12
12
  end
13
+ puts "No alias found"
14
+ else
15
+ puts "Usage: sshp name [ssh options]"
13
16
  end
14
- puts "No alias found"
15
17
  puts "SSHP Version #{SSHP::VERSION}"
16
18
 
@@ -8,7 +8,10 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib sshp alias]
8
8
  if ARGV.any?
9
9
  SSHP::Alias.create_or_update_by_name ARGV[0], ARGV[1..-1].join(" ")
10
10
  puts "The alias #{ARGV[0]} was succefully saved"
11
+ else
12
+ puts "Usage: sshp-alias name [ssh options]"
11
13
  end
14
+
12
15
  puts "List of available aliases"
13
16
  SSHP::Alias.all.each_pair do |name, value|
14
17
  puts "#{name}: #{value} (To run `sshp #{name}`)"
@@ -8,7 +8,7 @@ module SSHP
8
8
  end
9
9
 
10
10
  def self.all
11
- @all ||= YAML.load File.open filename, "r"
11
+ @all ||= YAML.load(File.open filename, "r")["aliases"]
12
12
  rescue Errno::ENOENT
13
13
  @all = {}
14
14
  end
@@ -20,7 +20,7 @@ module SSHP
20
20
  end
21
21
 
22
22
  def self.save
23
- File.open(filename, "w") { |f| f.write all.to_yaml }
23
+ File.open(filename, "w") { |f| f.write ({ "aliases" => all }).to_yaml }
24
24
  end
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module SSHP
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: