aws-ssh 1.1.1 → 1.2.0

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 +5 -5
  2. data/bin/aws-ssh +16 -12
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4b0810c9f39a7a08a1da018725f544033769ba09
4
- data.tar.gz: e7cb343982032d66e38dab1024b17b0cbf1e63f3
2
+ SHA256:
3
+ metadata.gz: a511eba7e7d885b53de7756b5391bc73a9f03f7e0eacd8b3955c7b439647c850
4
+ data.tar.gz: efe5c46419d308fff8eef5f449bf060a33e8aa782d77e6d0d8b0b1c34ad1c9bb
5
5
  SHA512:
6
- metadata.gz: 80ab44660e1e6b860d4bb5961ff421b12599e01291b31a414165071d29c1605ef75a8a68b7bdc5ec5a68897f346003957c2e5649c094519cccaeda31eb32bba2
7
- data.tar.gz: b97b74819572525b07eb07edb52c0d4692cff0b0fa376d14852728e45f6084229b8cdcd3f5dbfe6b4d5a53fc5a596ca7a369a5e42121fe616a1ad0259ae359aa
6
+ metadata.gz: 9dee855a009d6bcc1f6f02dd855adb0d716e61da117d746b36e14b2f0f2a0783804bf828a63ce31c3577271ed2c92e558cf8573001bf9e66f78700a6ec394c00
7
+ data.tar.gz: 5acb7696d2d61ef1d19049663449812f7d0b3473f3c96b8caa80cb3229c57d92ed8359682adbdc67c351c2b38f9f5377c933ad5e42173e7627591492620a393b
@@ -4,7 +4,7 @@ require 'slop'
4
4
  require 'aws-sdk'
5
5
  require 'yaml'
6
6
 
7
- module AWSSH
7
+ module AWSSSH
8
8
  class Runner
9
9
  DEFAULT_OPTIONS = {
10
10
  'user' => ENV['user'],
@@ -32,16 +32,16 @@ module AWSSH
32
32
  def cli
33
33
  @cli ||= Slop.parse do |o|
34
34
  o.banner = <<-USAGE
35
- awssh - a tool that makes easy to ssh into AWS EC2 servers
35
+ aws-ssh - a tool that makes easy to ssh into AWS EC2 servers
36
36
 
37
- Usage: awssh [hostname regex]
37
+ Usage: aws-ssh [hostname regex]
38
38
 
39
39
  Examples:
40
- $ awssh prod.*app2
40
+ $ aws-ssh prod.*app2
41
41
  ... will SSH into the instance and you will see:
42
42
  user@prod-rails-app4~$
43
43
 
44
- $ awssh --show-only --stack qa -u worker
44
+ $ aws-ssh --show-only --stack qa -u worker
45
45
  ... will show all instances registered in QA stack of Opsworks
46
46
  ssh worker@10.20.30.40 => MyApp QA - qa-rails-app
47
47
  ssh worker@10.20.30.41 => MyApp QA - qa-sidekiq
@@ -49,16 +49,16 @@ Examples:
49
49
  # All hosts in one-line (suitable for CSSH):
50
50
  worker@10.20.30.40 worker@10.20.30.41
51
51
 
52
- The config file .awssh is looked up in following directories:
52
+ The config file .aws-ssh is looked up in following directories:
53
53
  ./ (current directory)
54
54
  ~/ ($HOME directory)
55
55
  USAGE
56
56
 
57
57
  o.separator "Options:"
58
58
  o.string '-s', '--stack', 'AWS OpsWorks Stack name regex. E.g: `-s prod` will match "Production" stack name'
59
- o.string '-p', '--profile', 'AWS config profile name. Default: profile set in .awssh file', default: defaults['profile']
60
- o.string '-r', '--region', 'AWS region. E.g: us-east-1. Default: region set in .awssh file', default: defaults['region']
61
- o.string '-u', '--user', 'SSH username to use. Default: user set in .awssh file or current machine user', default: defaults['user']
59
+ o.string '-p', '--profile', 'AWS config profile name. Default: profile set in .aws-ssh file', default: defaults['profile']
60
+ o.string '-r', '--region', 'AWS region. E.g: us-east-1. Default: region set in .aws-ssh file', default: defaults['region']
61
+ o.string '-u', '--user', 'SSH username to use. Default: user set in .aws-ssh file or current machine user', default: defaults['user']
62
62
  o.bool '-so', '--show-only', 'Only show the matched hosts instead of ssh. Default: false', default: false
63
63
  o.bool '-cs', '--csensitive', 'Use case-sensitive for regex matching. Default: false', default: false
64
64
  o.bool '-v', '--verbose', 'Verbose mode. Default: false', default: false
@@ -93,8 +93,12 @@ The config file .awssh is looked up in following directories:
93
93
 
94
94
  def defaults
95
95
  @defaults ||= begin
96
- defaults = YAML.load_file('.awssh') if File.exist?('.awssh')
97
- defaults ||= YAML.load_file("#{ENV['HOME']}/.awssh") if File.exist?("#{ENV['HOME']}/.awssh")
96
+ if File.exist?('.awssh') || File.exist?("#{ENV['HOME']}/.awssh")
97
+ puts 'WARNING: please rename the config file .awssh to .aws-ssh'
98
+ exit(1)
99
+ end
100
+ defaults = YAML.load_file('.aws-ssh') if File.exist?('.aws-ssh')
101
+ defaults ||= YAML.load_file("#{ENV['HOME']}/.aws-ssh") if File.exist?("#{ENV['HOME']}/.aws-ssh")
98
102
  DEFAULT_OPTIONS.merge(defaults) if defaults
99
103
  end
100
104
  end
@@ -164,4 +168,4 @@ The config file .awssh is looked up in following directories:
164
168
  end
165
169
  end
166
170
 
167
- AWSSH::Runner.new.run
171
+ AWSSSH::Runner.new.run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Sales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-08 00:00:00.000000000 Z
11
+ date: 2018-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -42,14 +42,14 @@ description: A tool that makes easy to ssh into AWS EC2 servers
42
42
  email:
43
43
  - rafaelcds@gmail.com
44
44
  executables:
45
- - awssh
46
45
  - aws-ssh
46
+ - awssh
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - bin/aws-ssh
51
51
  - bin/awssh
52
- homepage: https://github.com/buzzstarter/aws-ssh
52
+ homepage: https://github.com/rafaelsales/aws-ssh
53
53
  licenses:
54
54
  - MIT
55
55
  metadata: {}
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.6.8
72
+ rubygems_version: 2.7.6
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A tool that makes easy to ssh into AWS EC2 servers