dslh 0.2.6 → 0.2.7
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 +4 -4
- data/lib/dslh.rb +1 -1
- data/lib/dslh/version.rb +1 -1
- data/spec/dslh_spec.rb +43 -0
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34fdaa1328cc3db25ed56fd20cd760d792a69522
|
|
4
|
+
data.tar.gz: 082e32708c7439a9ae026cc017103b1512a924c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
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.
|
|
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-
|
|
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:
|