cfdef 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1a0018c4e1873b8f79e5e3470a2e572eb087436
4
- data.tar.gz: 187a7b1126bd8a5c14eb025f500f3412a3e13bdf
3
+ metadata.gz: 0f7569ecd16aca5421994ce854733c6593d79cae
4
+ data.tar.gz: 7f70f529230958a3113e232f140a95ef29c2ea53
5
5
  SHA512:
6
- metadata.gz: 047161dfcf5b3e8583911223aaaef2cc78d26d23e9d2eb72f94e126e4c67a85b6770e7bb2199c50c72283c09755297c2d0d309e849a3c9b1cac618dca50769eb
7
- data.tar.gz: 8204a92ce706ecf25abad78d3673dae78a4f1011a63a0d0b8ae62e761ff7ad8f54a0f71ebb89c8e11e3aa5abc2e8db8395780dc0a6afd04b352793de6e1af8fd
6
+ metadata.gz: f4110663867762259c075df419a806b491e1b821bd3692ba06a0f4e5a59d4d91e236ff90ddbb5486de098a723aeb0f12b3cec168e5cc50890acf81683416a1d5
7
+ data.tar.gz: bc7917e4e368cbc06804eb2b75967830272807e54f666b96ea657fd00e616bd23e8890108ec3323c077ba4eb62c05b3f56961267a52ca0f3600e9e16b172be38
data/README.md CHANGED
@@ -47,6 +47,7 @@ Usage: cfdef [options]
47
47
  -o, --output FILE
48
48
  --split
49
49
  --target-origin ID_RGX
50
+ --use-braces
50
51
  --no-color
51
52
  --debug
52
53
  ```
data/cfdef.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency 'aws-sdk', '~> 2.3.0'
23
23
  spec.add_dependency 'diffy'
24
- spec.add_dependency 'dslh', '>= 0.3.5'
24
+ spec.add_dependency 'dslh', '>= 0.3.6'
25
25
  spec.add_dependency 'term-ansicolor'
26
26
 
27
27
  spec.add_development_dependency 'bundler'
data/exe/cfdef CHANGED
@@ -37,15 +37,16 @@ def parse_options(argv)
37
37
  options[:aws][:credentials][:path] = v
38
38
  end
39
39
 
40
- opt.on('-a', '--apply') { options[:mode] = :apply }
41
- opt.on('-f', '--file FILE') {|v| options[:file] = v }
42
- opt.on('' , '--dry-run') { options[:dry_run] = true }
43
- opt.on('-e', '--export') { options[:mode] = :export }
44
- opt.on('-o', '--output FILE') {|v| options[:output] = v }
45
- opt.on('' , '--split') { options[:split] = :true }
46
- opt.on('' , '--target-origin ID_RGX') {|v| options[:target] = Regexp.new(v) }
47
- opt.on('' , '--no-color') { options[:color] = false }
48
- opt.on('' , '--debug') { options[:debug] = true }
40
+ opt.on('-a', '--apply') { options[:mode] = :apply }
41
+ opt.on('-f', '--file FILE') {|v| options[:file] = v }
42
+ opt.on('' , '--dry-run') { options[:dry_run] = true }
43
+ opt.on('-e', '--export') { options[:mode] = :export }
44
+ opt.on('-o', '--output FILE') {|v| options[:output] = v }
45
+ opt.on('' , '--split') { options[:split] = true }
46
+ opt.on('' , '--target-origin ID_RGX') {|v| options[:target] = Regexp.new(v) }
47
+ opt.on('' , '--use-braces') { options[:use_braces] = true }
48
+ opt.on('' , '--no-color') { options[:color] = false }
49
+ opt.on('' , '--debug') { options[:debug] = true }
49
50
 
50
51
  opt.parse!(argv)
51
52
 
@@ -30,12 +30,22 @@ class Cfdef::DSL::Converter
30
30
  end
31
31
 
32
32
  def output_distribution(dist_id, distribution)
33
- dist_conf = Dslh.deval(distribution, initial_depth: 1, force_dump_braces: true).strip
33
+ dslh_opts = {initial_depth: 1, force_dump_braces: true}
34
+ dslh_opts[:use_braces_instead_of_do_end] = true if @options[:use_braces]
35
+ dist_conf = Dslh.deval(distribution, dslh_opts).strip
34
36
 
35
- <<-EOS
37
+ if @options[:use_braces]
38
+ <<-EOS
39
+ distribution(#{dist_id.inspect}) {
40
+ #{dist_conf}
41
+ }
42
+ EOS
43
+ else
44
+ <<-EOS
36
45
  distribution #{dist_id.inspect} do
37
46
  #{dist_conf}
38
47
  end
39
- EOS
48
+ EOS
49
+ end
40
50
  end
41
51
  end
data/lib/cfdef/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cfdef
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfdef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.5
47
+ version: 0.3.6
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.5
54
+ version: 0.3.6
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: term-ansicolor
57
57
  requirement: !ruby/object:Gem::Requirement