awful 0.0.35 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b149d082eb0ff8faf44c7190735d3348e6b2f6d3
4
- data.tar.gz: 8843022733d405071c30c8da57a0e6f736b9ab6b
3
+ metadata.gz: 0e4aa9e317381692d25c4f59ed46074cda3d16f5
4
+ data.tar.gz: a39626808424accf9a7b7415f2f202cd4500474c
5
5
  SHA512:
6
- metadata.gz: a42c760c9053101e83d170742f899b5732e40aabd30cc6cb9b596dcd9edc39f9d8b04638cb4fa4c8e22658fb63b9ed8e4ef890c18b2721129415b2f59e35ba48
7
- data.tar.gz: 29b3f11c5af7c9a8f5c682a9d7805f540278878fb0e560cd2192d624e6e94eef1af9237385ff7ed5800410fe8e344a950624b7f00ad6e019f8afa54e6a1a7cad
6
+ metadata.gz: aa0648dfd5b6cceb238e3d4c6d8f2ef6ec18a1ef050680faa9a9681447fd07b0ffd8059d7a502aae1be2a9e59a83b02b6dfc37c8da39a59603184c8529eeaa22
7
+ data.tar.gz: 547ba3ea49d5568c650abf36007de21b67f9875441c4c4e0df979fa949a2426a4862aabff5b61000d7592308ca9c6cf074337625d64edf1fa5ab12095e466dfe
@@ -27,6 +27,25 @@ module Awful
27
27
  end
28
28
  end
29
29
 
30
+ desc 'inbound NAME', 'show inbound rules for named security group'
31
+ method_option :long, aliases: '-l', default: false, desc: 'Long listing'
32
+ def inbound(name)
33
+ ec2.describe_security_groups.map(&:security_groups).flatten.find do |sg|
34
+ sg.group_name == name
35
+ end.ip_permissions.tap do |perms|
36
+ sources = ->(perm) { perm.ip_ranges.map(&:cidr_ip) + perm.user_id_group_pairs.map(&:group_id) }
37
+ if options[:long]
38
+ perms.map do |p|
39
+ sources.call(p).map do |s|
40
+ [p.ip_protocol, p.from_port, p.to_port, s]
41
+ end
42
+ end.flatten(1).tap { |list| print_table list }
43
+ else
44
+ puts perms.map { |p| sources.call(p) }.flatten
45
+ end
46
+ end
47
+ end
48
+
30
49
  end
31
50
 
32
51
  end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = "0.0.35"
2
+ VERSION = "0.0.36"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.35
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler