piculet 0.1.9 → 0.2.0

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: 85ce7a99878c859ea7ed72ee8ede67ff11a7751f
4
- data.tar.gz: 3206f6e51160671ff1e9e16517e11960d0cf7ea3
3
+ metadata.gz: b7950d816481ab26728fb4bf8d1e28811ec568ce
4
+ data.tar.gz: 0f18ab57131aaf558518ee0b0bc89a0577075e49
5
5
  SHA512:
6
- metadata.gz: be61e0f4ced38e05d438538414dded1d6bb98f245ce8359ba84b57f300fbd73b9da34afd0f2215d64aaf84e53467e9ba24c4443f6c19c8a134b258e5f10fd1d1
7
- data.tar.gz: 387470e127022cef37998045dac74745bcdd2ef997f6dbbae7c38a76316c89a8f1bd4d12a5a0c21b5192202196ea60ad367456bcaa31ca0ae5df7cbeb7c85f7c
6
+ metadata.gz: 929ee5edf3c0f42372ffa3a3611e4767479fdf5d9ab03db598dd8c60c37d564efa6de5e1159a1889891bc90e84259ed1a854cf6fc27280fcb5cbaa22253a39ae
7
+ data.tar.gz: 5195d1864f6dec6fc897bb66ce557e2974cb63962feab1a87e7089f990f8cce535240c33c47a78b730946d1d8f5cd4031d63d071cbd07c436b17658711e8be4b
data/README.md CHANGED
@@ -5,7 +5,7 @@ Piculet is a tool to manage EC2 Security Group.
5
5
  It defines the state of EC2 Security Group using DSL, and updates EC2 Security Group according to DSL.
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/piculet.png)](http://badge.fury.io/rb/piculet)
8
- [![Build Status](https://drone.io/bitbucket.org/winebarrel/piculet/status.png)](https://drone.io/bitbucket.org/winebarrel/piculet/latest)
8
+ [![Build Status](https://travis-ci.org/winebarrel/piculet.svg?branch=master)](https://travis-ci.org/winebarrel/piculet)
9
9
 
10
10
  ## Installation
11
11
 
@@ -19,6 +19,7 @@ module Piculet
19
19
  sg_names = @options[:sg_names]
20
20
  sgs = @ec2.security_groups
21
21
  sgs = sgs.filter('group-name', *sg_names) if sg_names
22
+ sgs = sgs.sort_by {|sg| sg.name }
22
23
 
23
24
  sgs.each do |sg|
24
25
  vpc = sg.vpc
@@ -49,20 +50,25 @@ module Piculet
49
50
  def export_ip_permissions(ip_permissions)
50
51
  ip_permissions = ip_permissions ? ip_permissions.aggregate : []
51
52
 
52
- ip_permissions.map do |ip_perm|
53
+ ip_permissions = ip_permissions.map do |ip_perm|
53
54
  {
54
55
  :protocol => ip_perm.protocol,
55
56
  :port_range => ip_perm.port_range,
56
- :ip_ranges => ip_perm.ip_ranges,
57
+ :ip_ranges => ip_perm.ip_ranges.sort,
57
58
  :groups => ip_perm.groups.map {|group|
58
59
  {
59
60
  :id => group.id,
60
61
  :name => group.name,
61
62
  :owner_id => group.owner_id,
62
63
  }
63
- },
64
+ }.sort_by {|g| g[:name] },
64
65
  }
65
66
  end
67
+
68
+ ip_permissions.sort_by do |ip_perm|
69
+ port_range = ip_perm[:port_range] || (0..0)
70
+ [ip_perm[:protocol], port_range.first, port_range.last]
71
+ end
66
72
  end
67
73
  end # Exporter
68
74
  end # Piculet
@@ -1,5 +1,5 @@
1
1
  module Piculet
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
4
4
 
5
5
  Version = Piculet::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piculet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-28 00:00:00.000000000 Z
11
+ date: 2014-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.19.0
19
+ version: 1.48.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.19.0
26
+ version: 1.48.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: term-ansicolor
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ files:
110
110
  - lib/piculet/wrapper/security-group-collection.rb
111
111
  - lib/piculet/wrapper/security-group.rb
112
112
  - lib/piculet.rb
113
- homepage: https://bitbucket.org/winebarrel/piculet
113
+ homepage: https://github.com/winebarrel/piculet
114
114
  licenses:
115
115
  - MIT
116
116
  metadata: {}
@@ -135,4 +135,3 @@ signing_key:
135
135
  specification_version: 4
136
136
  summary: Piculet is a tool to manage EC2 Security Group.
137
137
  test_files: []
138
- has_rdoc: