markus 4.0.21 → 4.0.22

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: ea4adcca87609a129ec8f549126c4bb574a1dd80
4
- data.tar.gz: 88bd916b5bd011a44bb1f4672049c8df17eed99e
3
+ metadata.gz: dee04aede3edc32afbedc10263a769a036afcc68
4
+ data.tar.gz: 1afc04487fb16bfdb6eed7c5b8882e2b3d175f6f
5
5
  SHA512:
6
- metadata.gz: 41384886916245694f24ca41a786dae14794688121e24340bf55ef515761688e68e626d4149ef97e6541375eec7d25ab105be364297d17d7783503264ae7480e
7
- data.tar.gz: 671a0f7c75f5e65e81788fb9d0914d831727fa872e8e99790462a9cc36d799bd6be4fc8a325a03ed396f1f2fb291907b7d47ee01c802e60bc227e200bcc704b1
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "markus"
3
- s.version = "4.0.21"
3
+ s.version = "4.0.22"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "MarkUS - Markup UnderScore. Quick n' dirty templating in the spirit of markaby."
data/test/change.mt_ CHANGED
@@ -3,7 +3,7 @@ class TestJsonChange < MarkUS
3
3
 
4
4
  template :main do
5
5
  element_! do
6
- query_ 76
6
+ query_ 90
7
7
  end
8
8
  end
9
9
  end
@@ -2,6 +2,6 @@ class ChangeIncludeCommon < MarkUS
2
2
  reload
3
3
 
4
4
  template :test do
5
- query_ 118
5
+ query_ 132
6
6
  end
7
7
  end
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
@@ -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.21
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-08 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest