markus 4.0.21 → 4.0.22
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/markus.rb +2 -4
- data/markus.gemspec +1 -1
- data/test/change.mt_ +1 -1
- data/test/change_include_common.mt_ +1 -1
- data/test/json.mt_ +9 -4
- data/test/tc_basic_json.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dee04aede3edc32afbedc10263a769a036afcc68
|
4
|
+
data.tar.gz: 1afc04487fb16bfdb6eed7c5b8882e2b3d175f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d915766aa59dbb95631f08b7f8d7cdafac11f582d37f950eb4a4f4a98b94b92d7aa904a2d2c5b9c3757b6f4be7baa382a476f34fcb29b0d7a7454b8b2592b1
|
7
|
+
data.tar.gz: 0a7c2e2c1afe56aef4fb33baa0856acc3e78973fc10e58ff6481f64323cdfd86fb0b4a1f6f5ee1f279de93639681d0226b42baeb84497182fec8d18dd2c35bab
|
data/lib/markus.rb
CHANGED
@@ -185,9 +185,8 @@ class MarkUS
|
|
185
185
|
@__markus_level += 1
|
186
186
|
mpsic = @__markus_parent
|
187
187
|
|
188
|
-
if mpsic == :a
|
188
|
+
if mpsic == :a && !tname.nil?
|
189
189
|
@__markus_buffer << __markus_indent + "{"
|
190
|
-
@__markus_level += 1
|
191
190
|
end
|
192
191
|
|
193
192
|
if [content, attrs, blk].compact.length > 1
|
@@ -224,9 +223,8 @@ class MarkUS
|
|
224
223
|
end
|
225
224
|
end
|
226
225
|
|
227
|
-
if mpsic == :a
|
226
|
+
if mpsic == :a && !tname.nil?
|
228
227
|
@__markus_buffer.last.chomp!(',')
|
229
|
-
@__markus_level -= 1
|
230
228
|
@__markus_buffer << __markus_indent + "},"
|
231
229
|
end
|
232
230
|
|
data/markus.gemspec
CHANGED
data/test/change.mt_
CHANGED
data/test/json.mt_
CHANGED
@@ -27,19 +27,24 @@ class TestJSON < MarkUS
|
|
27
27
|
|
28
28
|
nested_ do
|
29
29
|
path_ "contact"
|
30
|
-
query_ do
|
30
|
+
query_ do
|
31
31
|
term_ do
|
32
32
|
element_! "contact.durchwahl", "aaa"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
|
+
element_! do
|
38
|
+
weight_ 1
|
39
|
+
filter_ {}
|
40
|
+
end
|
41
|
+
|
37
42
|
end
|
38
43
|
end
|
39
44
|
end
|
40
|
-
end
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
|
-
end
|
48
|
+
end
|
44
49
|
end
|
45
50
|
end
|
data/test/tc_basic_json.rb
CHANGED
@@ -8,13 +8,13 @@ class TestBasicJSON < Minitest::Test
|
|
8
8
|
def test_json
|
9
9
|
s = TestJSON.new
|
10
10
|
s.__markus_indent = true
|
11
|
-
assert s.json_!(:main) == "\"from\": 1,\n\"size\": 6,\n\"query\": {\n \"filtered\": {\n \"filter\": {\n \"bool\": {\n \"must\": [\n {\n \"bool\": {\n \"should\": [\n \"_score\",\n {\n \"nested\": {\n \"path\": \"contact\",\n \"query\": {\n \"term\": {\n \"contact.durchwahl\": 1\n }\n }\n }\n },\n {\n \"nested\": {\n \"path\": \"contact\",\n \"query\": {\n \"term\": {\n \"contact.durchwahl\": \"aaa\"\n }\n }\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n}"
|
11
|
+
assert s.json_!(:main) == "\"from\": 1,\n\"size\": 6,\n\"query\": {\n \"filtered\": {\n \"filter\": {\n \"bool\": {\n \"must\": [\n {\n \"bool\": {\n \"should\": [\n \"_score\",\n {\n \"nested\": {\n \"path\": \"contact\",\n \"query\": {\n \"term\": {\n \"contact.durchwahl\": 1\n }\n }\n }\n },\n {\n \"nested\": {\n \"path\": \"contact\",\n \"query\": {\n \"term\": {\n \"contact.durchwahl\": \"aaa\"\n }\n }\n }\n },\n {\n \"weight\": 1,\n \"filter\": {}\n }\n ]\n }\n }\n ]\n }\n }\n }\n}"
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_json_noindent
|
15
15
|
s = TestJSON.new
|
16
16
|
s.__markus_indent = false
|
17
|
-
assert s.json_!(:main) == "\"from\": 1,\"size\": 6,\"query\": {\"filtered\": {\"filter\": {\"bool\": {\"must\": [{\"bool\": {\"should\": [\"_score\",{\"nested\": {\"path\": \"contact\",\"query\": {\"term\": {\"contact.durchwahl\": 1}}}},{\"nested\": {\"path\": \"contact\",\"query\": {\"term\": {\"contact.durchwahl\": \"aaa\"}}}}]}}]}}}}"
|
17
|
+
assert s.json_!(:main) == "\"from\": 1,\"size\": 6,\"query\": {\"filtered\": {\"filter\": {\"bool\": {\"must\": [{\"bool\": {\"should\": [\"_score\",{\"nested\": {\"path\": \"contact\",\"query\": {\"term\": {\"contact.durchwahl\": 1}}}},{\"nested\": {\"path\": \"contact\",\"query\": {\"term\": {\"contact.durchwahl\": \"aaa\"}}}},{\"weight\": 1,\"filter\": {}}]}}]}}}}"
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_json_arguments
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|