opsworks-connect 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +9 -13
- data/lib/opsworks-connect.rb +9 -7
- data/lib/opsworks-connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db4843dc0ab2fe5180e087a2103e2ef51d196027
|
4
|
+
data.tar.gz: e49017ec95e7d56593f3e590a3801f3dff2c7efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae26eaa2a08bc9f4ee2037b008728d4a4cd88afbc00fb2533161f7661029dad085ec9705590ab2939003449696cbb1b06f4c5416cf611af21ed6fd39cfd537ac
|
7
|
+
data.tar.gz: 7815631dd84b108a27a9c5edb570355e1f5cab4331a9b667f95fa949a366108e04bcd938290bc6c52bcb871b8251d7719d2edaea320c3c25572e6dcfaffe1a80
|
data/README.md
CHANGED
@@ -1,28 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# OpsWorks-Connect
|
2
2
|
|
3
|
-
|
3
|
+
Ease OpsWorks instance SSH connections
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
gem 'opsworks-connect'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
7
|
+
Install it yourself as:
|
16
8
|
|
17
9
|
$ gem install opsworks-connect
|
18
10
|
|
19
11
|
## Usage
|
20
12
|
|
21
|
-
|
13
|
+
Run command:
|
14
|
+
|
15
|
+
$ opsworks-connect
|
16
|
+
|
17
|
+
And it'll handle the rest!
|
22
18
|
|
23
19
|
## Contributing
|
24
20
|
|
25
|
-
1. Fork it ( https://github.com/
|
21
|
+
1. Fork it ( https://github.com/zpencerq/opsworks-connect/fork )
|
26
22
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
23
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
24
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/opsworks-connect.rb
CHANGED
@@ -5,6 +5,8 @@ module Opsworks
|
|
5
5
|
class Driver
|
6
6
|
def ask?(question, options)
|
7
7
|
answer = nil
|
8
|
+
answer = options[0] if options.length == 1
|
9
|
+
|
8
10
|
while answer == nil
|
9
11
|
puts "",question
|
10
12
|
options
|
@@ -51,14 +53,14 @@ module Opsworks
|
|
51
53
|
|
52
54
|
layer = ask?("Layers", layers)
|
53
55
|
instances = client.describe_instances(layer_id: layer[:layer_id])[:instances]
|
54
|
-
.
|
56
|
+
.reject { |instance| instance[:public_ip].nil? }
|
55
57
|
.map do |instance|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
{
|
59
|
+
instance_id: instance[:instance_id],
|
60
|
+
name: "#{instance[:hostname]} (#{instance[:status]})",
|
61
|
+
public_ip: instance[:public_ip]
|
62
|
+
}
|
63
|
+
end.sort_by { |option| option[:name] }
|
62
64
|
|
63
65
|
instance = ask?("Instances", instances)
|
64
66
|
|