sshman 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sshman/sshman.rb +7 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa9cdb191d79a0fb683e6c8555ab82246f55c1de0f567263112c5d9ad4d152e5
4
- data.tar.gz: 21520da596d46d025f346e910127edc57a88367f57711ebd161caf319edfccac
3
+ metadata.gz: 45eed8265f83e42f992e39d076c00e216eb27765de50c3a63027485000b2889e
4
+ data.tar.gz: ba5b30f2793966eba1d72d6cff27b0dc6823d631cc4c5d03330803e5e3e2d3d1
5
5
  SHA512:
6
- metadata.gz: c54efd16ff02c2cbad5d32aeefc9d2578c0fbcae98aa107fe5549b9a63fca5231a02f494273bb4685097926052ad9ae20f83151f1e889b377b0972bb17f4f6c6
7
- data.tar.gz: d97c7b5ef6d2201f0ba0e9c4988f8a1e58704147bdce3c797509787b65225b699c0dca3f3401cca877d3fc99ae180f97e9b5e8b8eb01eeaeb320ddf9b987c29d
6
+ metadata.gz: e65a3828a9a74032ce754caa0414638123613f3d79fcfe91ec36f3230f7224bc22b6dd824680887f1d1fb1488bcb2118110ac983784604add9e71d35f7c2b21a
7
+ data.tar.gz: cc8667dda8aa810581f7ecf21888a5902c133425d7872b8dafd412c7c9b4df0be31f7994481db755e9853dcf7a7f4b18279752efaca96f0b5bbcc6ae688c4f78
data/lib/sshman/sshman.rb CHANGED
@@ -17,7 +17,7 @@ module Sshman
17
17
  when 'delete'
18
18
  new.delete_server
19
19
  when 'connect'
20
- new.connect_to_server
20
+ new.connect_to_server(argv[1])
21
21
  when 'help'
22
22
  new.display_help
23
23
  when 'version'
@@ -191,11 +191,15 @@ HELP
191
191
  end
192
192
 
193
193
  # Connect to a server using SSH
194
- def connect_to_server
194
+ def connect_to_server(alias_name = nil)
195
+ # If no alias is provided, ask the user for one
196
+ if alias_name.nil?
195
197
  print "Enter alias of the server to connect: "
196
198
  alias_name = gets.chomp.strip
199
+ end
200
+
201
+ # Search for the server in the CSV file
197
202
  server = nil
198
-
199
203
  CSV.foreach(SERVERS_CSV, headers: true) do |row|
200
204
  if row['alias'] == alias_name
201
205
  server = row
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SubnetMasked