formatron 0.1.7 → 0.1.8

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: 0704fc0d914f4d7dbcc7051b00602ddacc35973a
4
- data.tar.gz: 56b2a0dd76368627993b3e24ef65de73ea17acae
3
+ metadata.gz: 049951ef9db93c2170b452c87447f8a0861890fe
4
+ data.tar.gz: 59ff8f53b71c207181903b4ba7362bd7bde1a3d0
5
5
  SHA512:
6
- metadata.gz: 6313cf8357cdce3a96d92c75cdcebccf175c9b2b34d758e533834ff2ece2123e54c90a86b3df2b8c3b3652023a4939eb8f2e8b94e6ccbd70a0085dae5949a340
7
- data.tar.gz: c8108d166e067a3d97835000fde75ee45700501e11d6b10ef7745080efa114dd0c35fbda015aa08e2dafbfe8f326e0eadf12f97fd9ee43e4b4e48c7869471b47
6
+ metadata.gz: 00cfbb19687d2808ce482c3f4ae657593f4a489735ac25e1814a5de718a2ba59e96b9f49ddfa0ee709f471fcfa6f13630591910048fa8c152ebf142c098596a0
7
+ data.tar.gz: fe07f387ca07b44d693df4a73d85ce5ea2f7f84e84966df14b12d4b20a652797bed4bbe3ace3faf1d0f6a1107a4f53d911856191a4b998bd87aac87727ce2ec8
data/lib/formatron.rb CHANGED
@@ -38,7 +38,8 @@ class Formatron
38
38
  file: File.join(directory, FORMATRONFILE),
39
39
  config: @config,
40
40
  target: @target,
41
- external: @external
41
+ external: @external,
42
+ aws: @aws
42
43
  )
43
44
  _initialize
44
45
  end
@@ -65,7 +66,8 @@ class Formatron
65
66
  @kms_key = global.kms_key || external_global.kms_key
66
67
  @databag_secret = global.databag_secret || external_global.databag_secret
67
68
  hosted_zone_id = global.hosted_zone_id || external_global.hosted_zone_id
68
- @hosted_zone_name = @aws.hosted_zone_name hosted_zone_id
69
+ @hosted_zone_name =
70
+ global.hosted_zone_name || external_global.hosted_zone_name
69
71
  @configuration = @external.export formatron: @formatron
70
72
  @cloud_formation_template = CloudFormation::Template.new(
71
73
  formatron: @formatron,
data/lib/formatron/dsl.rb CHANGED
@@ -5,8 +5,8 @@ class Formatron
5
5
  class DSL
6
6
  attr_reader :formatron, :config, :target
7
7
 
8
- def initialize(file:, config:, target:, external:)
9
- @formatron = Formatron.new external: external
8
+ def initialize(file:, config:, target:, external:, aws:)
9
+ @formatron = Formatron.new external: external, aws: aws
10
10
  @config = config
11
11
  @target = target
12
12
  instance_eval File.read(file), file
@@ -8,13 +8,18 @@ class Formatron
8
8
  class Formatron
9
9
  extend Util::DSL
10
10
 
11
- dsl_initialize_block do |external:|
11
+ dsl_initialize_block do |external:, aws:|
12
+ @aws = aws
12
13
  @external = external
13
14
  end
14
15
 
15
16
  dsl_property :name
16
17
  dsl_property :bucket
17
- dsl_block :global, 'Global'
18
+
19
+ dsl_block :global, 'Global' do
20
+ { aws: @aws }
21
+ end
22
+
18
23
  dsl_hash :vpc, 'VPC'
19
24
 
20
25
  def depends(dependency)
@@ -7,12 +7,25 @@ class Formatron
7
7
  # Global configuration
8
8
  class Global
9
9
  extend Util::DSL
10
- dsl_initialize_block
10
+
11
+ attr_reader :hosted_zone_name
12
+
13
+ dsl_initialize_block do |aws:|
14
+ @aws = aws
15
+ end
16
+
11
17
  dsl_property :protect
12
18
  dsl_property :kms_key
13
19
  dsl_property :databag_secret
14
- dsl_property :hosted_zone_id
15
20
  dsl_block :ec2, 'EC2'
21
+
22
+ def hosted_zone_id(value = nil)
23
+ unless value.nil?
24
+ @hosted_zone_id = value
25
+ @hosted_zone_name = @aws.hosted_zone_name value
26
+ end
27
+ @hosted_zone_id
28
+ end
16
29
  end
17
30
  end
18
31
  end
@@ -22,7 +22,7 @@ class Formatron
22
22
  @target = target
23
23
  @config = config
24
24
  @local_config = Marshal.load Marshal.dump(@config)
25
- @formatron = Formatron::DSL::Formatron.new external: nil
25
+ @formatron = Formatron::DSL::Formatron.new external: nil, aws: @aws
26
26
  @outputs = Outputs.new aws: @aws, target: @target
27
27
  end
28
28
 
@@ -106,6 +106,8 @@ class Formatron
106
106
  global.databag_secret unless global.databag_secret.nil?
107
107
  configuration_global['hosted_zone_id'] =
108
108
  global.hosted_zone_id unless global.hosted_zone_id.nil?
109
+ configuration_global['hosted_zone_name'] =
110
+ global.hosted_zone_name unless global.hosted_zone_name.nil?
109
111
  ec2 = global.ec2
110
112
  unless ec2.nil?
111
113
  configuration_ec2 = configuration_global['ec2'] = {}
@@ -1,4 +1,4 @@
1
1
  # add version to class
2
2
  class Formatron
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Halliday
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  version: '0'
414
414
  requirements: []
415
415
  rubyforge_project:
416
- rubygems_version: 2.4.5.1
416
+ rubygems_version: 2.2.2
417
417
  signing_key:
418
418
  specification_version: 4
419
419
  summary: AWS/Chef Deployment Tool