roadworker 0.5.1 → 0.5.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: f3894ed56603b6ea3075cf9d433bb922dc0c4e1e
4
- data.tar.gz: ff89d471102797b62b2ae6244916a065d257e0b8
3
+ metadata.gz: 0338a0339060f90a10bc7dced8b9753800fd6f52
4
+ data.tar.gz: 20691e1ad5a6f8de4a42ad4ad3cf37509d00bbf1
5
5
  SHA512:
6
- metadata.gz: c0ac6bae62a8c93b41870bf5f06a8300087084db487b14a59260d73d273e0cea4f06b2389049af3c2bb7f98fd94fbf3208065adda28d59cd2b6265cbaeb4135e
7
- data.tar.gz: fd1a628336467103b97d91053f3384747a9c0abd152cd785317738deb71b5649e7c736b2f7b3562d87707c3ea108831b6ea4f86ad56db5b5235e45a6359db63c
6
+ metadata.gz: adc447ff22cfada469adccc8c88855e2cf067d88025c14d9620720404bb43e4dd43c83fcda7e4e24edf4d548b2d3461b541dece6eb5b01d56b09b792f7d87408
7
+ data.tar.gz: 45fa6357cf068b431cf25154d141029196a8044b21f5fc15acb00e5a45710ab416c07cc916a210b71f43b6bbecb702462a98f17966a418aff2284291b95021fc
@@ -7,8 +7,15 @@ require 'logger'
7
7
 
8
8
  Version = Roadworker::VERSION
9
9
 
10
+ MAGIC_COMMENT = <<-EOS
11
+ # -*- mode: ruby -*-
12
+ # vi: set ft=ruby :
13
+ EOS
14
+
15
+ DEFAULT_ROUTEFILE = 'Routefile'
16
+
10
17
  mode = nil
11
- file = 'Routefile'
18
+ file = DEFAULT_ROUTEFILE
12
19
  output_file = '-'
13
20
  split = false
14
21
 
@@ -94,7 +101,8 @@ begin
94
101
  if split
95
102
  logger.info('Export Route53')
96
103
 
97
- output_file = 'Routefile' if output_file == '-'
104
+ output_file = DEFAULT_ROUTEFILE if output_file == '-'
105
+ output_file = File.join(output_file, DEFAULT_ROUTEFILE) if File.directory?(output_file)
98
106
  requires = []
99
107
 
100
108
  client.export do |exported, converter|
@@ -105,6 +113,7 @@ begin
105
113
  logger.info(" write `#{route_file}`")
106
114
 
107
115
  open(route_file, 'wb') do |f|
116
+ f.puts MAGIC_COMMENT
108
117
  f.puts converter.call({
109
118
  :hosted_zones => [zone],
110
119
  :health_checks => exported[:health_checks],
@@ -116,6 +125,8 @@ begin
116
125
  logger.info(" write `#{output_file}`")
117
126
 
118
127
  open(output_file, 'wb') do |f|
128
+ f.puts MAGIC_COMMENT
129
+
119
130
  requires.each do |route_file|
120
131
  f.puts "require '#{File.basename route_file}'"
121
132
  end
@@ -128,7 +139,10 @@ begin
128
139
  puts client.export
129
140
  else
130
141
  logger.info("Export Route53 to `#{output_file}`")
131
- open(output_file, 'wb') {|f| f.puts client.export }
142
+ open(output_file, 'wb') do |f|
143
+ f.puts MAGIC_COMMENT
144
+ f.puts client.export
145
+ end
132
146
  end
133
147
  end
134
148
  when :test
@@ -1,3 +1,3 @@
1
1
  module Roadworker
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel