mappru 0.1.1 → 0.1.2

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: 91fb9f0fc2af0eb772f30a17cf48a9e369e0fbb9
4
- data.tar.gz: 5c73c0ff7481a80f1306faaee92b1172da7e340a
3
+ metadata.gz: 6d2863ef4f96c705e0456fed60c95340f14ac98a
4
+ data.tar.gz: 782fbb40ac0429950b62978c469818dfbbd67216
5
5
  SHA512:
6
- metadata.gz: a768ea8894402927fce8b21478ac9aad18b91da9a4477c3544204047e4e4b51a8571c12ddff7402e64bb42f363c3fe475d5fc92869271b6ba82ddc3258d15da7
7
- data.tar.gz: 27749ece277cccf758eaec61efeab991527fc04f6bd9eb0a969ec8921c21dbc50e9b655119e743385ca36dd01aae4bbbe57aec25b0ab392c5e651ce673836b7f
6
+ metadata.gz: 6d5719b27e17b0b5f079daacf39af19b7659ab68e60a95ab30b7ab0a71d2a1321ee5214c300194af00677968874d7a2b5e2a5efd0aae9730538b3825480fb20a
7
+ data.tar.gz: e1118fa5356b82b3fb5f6ebd63a9982bf72865f9f93ec6037459f5806b9835409ca016f25888d2afbb881a0d1d4b3bdb77d6fc278ef44f9458020f17890ace99
data/exe/mappru CHANGED
@@ -91,12 +91,13 @@ def run_export(client, options)
91
91
  requires = []
92
92
 
93
93
  exported.each do |vpc_id, rts|
94
- vpc_dir = File.join(dir, vpc_id)
95
- FileUtils.mkdir_p(vpc_id)
94
+ vpc_name = client.vpc_name_by_id(vpc_id) || vpc_id
95
+ vpc_dir = File.join(dir, vpc_name)
96
+ FileUtils.mkdir_p(vpc_dir)
96
97
 
97
98
  rts.each do |rt_name, attrs|
98
99
  filename = "#{rt_name}.rtbl"
99
- requires << File.join(vpc_id, filename)
100
+ requires << File.join(vpc_name, filename)
100
101
  rt_file = File.join(vpc_dir, filename)
101
102
 
102
103
  logger.info(" write `#{rt_file}`")
data/lib/mappru/client.rb CHANGED
@@ -13,6 +13,11 @@ class Mappru::Client
13
13
  Mappru::Exporter.export(@client, @options)
14
14
  end
15
15
 
16
+ def vpc_name_by_id(vpc_id)
17
+ name_tag = @resource.vpc(vpc_id).tags.find {|i| i.key == 'Name' } || {}
18
+ name_tag[:value]
19
+ end
20
+
16
21
  def apply(file)
17
22
  walk(file)
18
23
  end
data/lib/mappru/driver.rb CHANGED
@@ -78,6 +78,8 @@ class Mappru::Driver
78
78
  end
79
79
  end
80
80
 
81
+ private
82
+
81
83
  def rt_id_by_vpc_rt_name
82
84
  return @rt_ids if @rt_ids
83
85
 
@@ -1,3 +1,3 @@
1
1
  module Mappru
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mappru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk