dslh 0.2.6 → 0.2.7

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: fa4ee0d726af330efe68242aa1d5aa7d772266a4
4
- data.tar.gz: d8235afa0db8146c8cc07da541914e03a83501c5
3
+ metadata.gz: 34fdaa1328cc3db25ed56fd20cd760d792a69522
4
+ data.tar.gz: 082e32708c7439a9ae026cc017103b1512a924c7
5
5
  SHA512:
6
- metadata.gz: 90d02012002838b554aa3a502668d5f9d9a6468aca98996f2a48a70d86a49b74f86c825109af5955cff06a2eed962d7964b7447d5a8b9a16d0b1a58ddda39e84
7
- data.tar.gz: 076e581bfec7598fd68f05624a61bd8d2c8ac58b5f52bafe6c9f24bed1741eb0066e01c9e9e89e82a089e5e7e0f0103b1dd6be744b760ff0b438ea4b1d1cb667
6
+ metadata.gz: 1d87263bf3c762a927b97d88516ed5de18ff03eedca6fa7bf6655990a9045e3bce11eed6b87952e470519d68c2af794df2875bed3a38e650f7a90cff2a01bfd0
7
+ data.tar.gz: b92baf05a6cfe51663bc39a6894c13b6ed545ed1eeabe14724fd0829fd1a0302b484c7daefed7456f9826c46c4271ff2f459cf048d1fc0ecc7de4084b7d045ae
data/lib/dslh.rb CHANGED
@@ -115,7 +115,7 @@ class Dslh
115
115
 
116
116
  case value
117
117
  when Hash
118
- if exclude_keys?(value.keys)
118
+ if exclude_keys?(value.keys) or value.values.any? {|v| v == [] }
119
119
  value_buf.puts('(' + ("\n" + value.pretty_inspect.strip).gsub("\n", "\n" + next_indent) + ')')
120
120
  else
121
121
  nested = true
data/lib/dslh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Dslh
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
data/spec/dslh_spec.rb CHANGED
@@ -2454,6 +2454,49 @@ Outputs do
2454
2454
  end
2455
2455
  Description "Drupal Website"
2456
2456
  end
2457
+ end
2458
+ EOS
2459
+ end
2460
+
2461
+ it 'should be hash that include empty array' do
2462
+ h = {"glossary"=>
2463
+ {"title"=>"example glossary",
2464
+ "GlossDiv"=>
2465
+ {"title"=>"S",
2466
+ "GlossList"=>
2467
+ {"GlossEntry"=>
2468
+ {"ID"=>"SGML",
2469
+ "SortAs"=>"SGML",
2470
+ "GlossTerm"=>"Standard Generalized Markup Language",
2471
+ "Acronym"=>"SGML",
2472
+ "Abbrev"=>"ISO 8879:1986",
2473
+ "GlossDef"=>
2474
+ {"para"=>
2475
+ "A meta-markup language, used to create markup languages such as DocBook.",
2476
+ "GlossSeeAlso"=>[]},
2477
+ "GlossSee"=>"markup"}}}}}
2478
+
2479
+ dsl = Dslh.deval(h)
2480
+ expect(dsl).to eq(<<-EOS)
2481
+ glossary do
2482
+ title "example glossary"
2483
+ GlossDiv do
2484
+ title "S"
2485
+ GlossList do
2486
+ GlossEntry do
2487
+ ID "SGML"
2488
+ SortAs "SGML"
2489
+ GlossTerm "Standard Generalized Markup Language"
2490
+ Acronym "SGML"
2491
+ Abbrev "ISO 8879:1986"
2492
+ GlossDef(
2493
+ {"para"=>
2494
+ "A meta-markup language, used to create markup languages such as DocBook.",
2495
+ "GlossSeeAlso"=>[]})
2496
+ GlossSee "markup"
2497
+ end
2498
+ end
2499
+ end
2457
2500
  end
2458
2501
  EOS
2459
2502
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dslh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-15 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,4 +101,3 @@ test_files:
101
101
  - spec/Drupal_Single_Instance.template
102
102
  - spec/dslh_spec.rb
103
103
  - spec/spec_helper.rb
104
- has_rdoc: