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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1151d7ec4c7331bcab6408d0c9f4e8e9e40fa3e2
4
- data.tar.gz: 06ba2140eb8cfb21732174e6c2a385f45a175d21
3
+ metadata.gz: db4843dc0ab2fe5180e087a2103e2ef51d196027
4
+ data.tar.gz: e49017ec95e7d56593f3e590a3801f3dff2c7efa
5
5
  SHA512:
6
- metadata.gz: c9a4bbacaeda0e2b7d03b3954b920d74d37715458c1e29040e5aae86ddf138dadcc408ff7e040ea52c18642be37146d7ed0bf46456aa7a12449bb891e6ada68d
7
- data.tar.gz: df2d9a8f501169cf5c381f39ba64e5046ed8b09f6597f893352680455160a95cf62bf0e25c7af678937c40f7f0d462e61fb24423c4e2e842a2a07f99cb0faf10
6
+ metadata.gz: ae26eaa2a08bc9f4ee2037b008728d4a4cd88afbc00fb2533161f7661029dad085ec9705590ab2939003449696cbb1b06f4c5416cf611af21ed6fd39cfd537ac
7
+ data.tar.gz: 7815631dd84b108a27a9c5edb570355e1f5cab4331a9b667f95fa949a366108e04bcd938290bc6c52bcb871b8251d7719d2edaea320c3c25572e6dcfaffe1a80
data/README.md CHANGED
@@ -1,28 +1,24 @@
1
- # Opsworks
1
+ # OpsWorks-Connect
2
2
 
3
- TODO: Write a gem description
3
+ Ease OpsWorks instance SSH connections
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
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
- TODO: Write usage instructions here
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/[my-github-username]/opsworks-connect/fork )
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`)
@@ -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
- .find_all { |instance| instance[:status] == "online" }
56
+ .reject { |instance| instance[:public_ip].nil? }
55
57
  .map do |instance|
56
- {
57
- instance_id: instance[:instance_id],
58
- name: instance[:hostname],
59
- public_ip: instance[:public_ip]
60
- }
61
- end.sort_by { |option| option[:name] }
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
 
@@ -1,3 +1,3 @@
1
1
  module Opsworks
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spencer Ellinor