toquen 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: f4898328afa8282ce9598ca1aad43ac4604bd416
4
- data.tar.gz: ecdab549c9ac27456733f248d9c1af9b375cb6e9
3
+ metadata.gz: 3e35803c6014457d4b1865f9e08af7b8a50e6a04
4
+ data.tar.gz: 2c93235e6285491b42b7ff9d7763758ace466644
5
5
  SHA512:
6
- metadata.gz: 90c4bcf4c1d15d72aa98442840be6687f755647eed46bf83ec5663ceaa14741c72fd297c354eec34d03492727d50a231c121c2f3027117da5988e28feeb85cb4
7
- data.tar.gz: 708639a30d3457121cfa55adda961d8df0ff52e361dc7e2f19486e22fe4b7b2a782354958ca81dd56ec54a7d0cc225b5d71d1c2cbd3aeb85299cb1a8aa866124
6
+ metadata.gz: b5a596381ae877a688a92002902bfd3b8768de58bbb0c32d1738da439de32d40b4ed21c9f84a87aba022cb306fadd62bdad5a6ee4115e98870a7514ef9a04eaa
7
+ data.tar.gz: 10893f1b36c9e4422519f384f3d5cb638344412303d54a4fbf8bb9eabdfa883bfb11531ea201f7d3fbdf91ad28eb40d629e9e6f24c31e9348273bda4a56a749f
@@ -60,8 +60,10 @@ module Toquen
60
60
  end
61
61
 
62
62
  def get_security_groups(ids)
63
- ectwo = AWS::EC2.new
64
- ids.map { |id| ectwo.security_groups[id] }
63
+ AWS.memoize do
64
+ ectwo = AWS::EC2.new
65
+ ids.map { |id| ectwo.security_groups[id] }
66
+ end
65
67
  end
66
68
 
67
69
  def authorize_ingress(secgroup, protocol, port, ip)
@@ -86,18 +88,20 @@ module Toquen
86
88
 
87
89
  def server_details_in(region)
88
90
  AWS.config(:access_key_id => @key_id, :secret_access_key => @key, :region => region)
89
- AWS::EC2.new.instances.map do |i|
90
- {
91
- :id => i.tags["Name"],
92
- :internal_ip => i.private_ip_address,
93
- :external_ip => i.public_ip_address,
94
- :name => i.tags["Name"],
95
- :roles => Toquen.config.aws_roles_extractor.call(i),
96
- :type => i.instance_type,
97
- :external_dns => i.public_dns_name,
98
- :internal_dns => i.private_dns_name,
99
- :security_groups => i.security_groups.to_a.map(&:id)
100
- }
91
+ AWS.memoize do
92
+ AWS::EC2.new.instances.map do |i|
93
+ {
94
+ :id => i.tags["Name"],
95
+ :internal_ip => i.private_ip_address,
96
+ :external_ip => i.public_ip_address,
97
+ :name => i.tags["Name"],
98
+ :roles => Toquen.config.aws_roles_extractor.call(i),
99
+ :type => i.instance_type,
100
+ :external_dns => i.public_dns_name,
101
+ :internal_dns => i.private_dns_name,
102
+ :security_groups => i.security_groups.to_a.map(&:id)
103
+ }
104
+ end
101
105
  end
102
106
  end
103
107
 
@@ -1,3 +1,3 @@
1
1
  module Toquen
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toquen
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
  - Brian Muller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano