kumogata2-plugin-ruby 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: 51e8b5e2be5e26168a685aec2b274785dda1b57a
4
- data.tar.gz: 318d4fc663ae695bba0a49b9fbe27efb8408e9a8
3
+ metadata.gz: d46c27b2fb83e5c886b09b4839bb4bb1e53e826f
4
+ data.tar.gz: b7f2d716b5d6585751f432ebbda23803a8935bd2
5
5
  SHA512:
6
- metadata.gz: 445b934f153d0495fdebd901c09e89aac7da20d70c8bf32eba8b941576e5fa5cf6e2ffa7467c0698ff06236e5349a0b4feb9fce62797be5a0757de794bd4035f
7
- data.tar.gz: 59cf72d8c27378287a841141ea6d4721704d5ab859cda51619d24c9431d23f9977630b4fd05a6cba66b021a5672b33d397955a7b718f206092a7238695df2306
6
+ metadata.gz: e5b1636667c97b6cf145ba8f3429854f21813e721bf846e0a0fd64e70c2d500ddde1eb251c7df98a5984940e1cf9a6c411323d7eebab0f51b95d6f66bacb2e09
7
+ data.tar.gz: 592180d4d1f1ce091f62e2681235589618e5fda5cdfa67a3ad7ca563ab2c153ff184e4733fe388f84fa680ecc67212f889c48449010cc499b290db603072b7d4
data/README.md CHANGED
@@ -20,6 +20,26 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install kumogata2-plugin-ruby
22
22
 
23
+ ## Usage
24
+
25
+ ```sh
26
+ kumogata2 export my-stack --output-format rb > my-stack.rb
27
+ kumogata2 dry-run my-stack.rb my-stack
28
+ kumogata2 update my-stack.rb my-stack
29
+ ```
30
+
31
+ ### Export using braces
32
+
33
+ ```sh
34
+ EXPORT_RUBY_USE_BRACES=1 kumogata2 export ... --output-format rb
35
+ ```
36
+
37
+ ### Export old format
38
+
39
+ ```sh
40
+ EXPORT_RUBY_OLD_FORMAT=1 kumogata2 export ... --output-format rb
41
+ ```
42
+
23
43
  ## Example
24
44
 
25
45
  ```ruby
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_dependency 'kumogata2'
23
- spec.add_dependency 'dslh', '>= 0.3.0'
23
+ spec.add_dependency 'dslh', '>= 0.3.7'
24
24
 
25
25
  spec.add_development_dependency 'bundler'
26
26
  spec.add_development_dependency 'rake'
@@ -62,16 +62,26 @@ class Kumogata2::Plugin::Ruby
62
62
  end
63
63
  end
64
64
 
65
- dsl = Dslh.deval(template,
65
+ dslh_opts = {
66
66
  key_conv: key_conv,
67
67
  value_conv: value_conv,
68
- exclude_key: exclude_key)
68
+ exclude_key: exclude_key,
69
+ initial_depth: 1,
70
+ }
69
71
 
70
- dsl.gsub!(/^/, ' ').strip!
72
+ if ENV['EXPORT_RUBY_USE_BRACES'] == '1'
73
+ dslh_opts[:use_braces_instead_of_do_end] = true
74
+ end
75
+
76
+ if ENV['EXPORT_RUBY_OLD_FORMAT'] == '1'
77
+ dslh_opts[:dump_old_hash_array_format] = true
78
+ end
79
+
80
+ dsl = Dslh.deval(template, dslh_opts)
71
81
 
72
82
  <<-EOS
73
83
  template do
74
- #{dsl}
84
+ #{dsl.strip}
75
85
  end
76
86
  EOS
77
87
  end
@@ -1,7 +1,7 @@
1
1
  module Kumogata2
2
2
  module Plugin
3
3
  class Ruby
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kumogata2-plugin-ruby
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-14 00:00:00.000000000 Z
11
+ date: 2016-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kumogata2
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.0
33
+ version: 0.3.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.0
40
+ version: 0.3.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement