babl-json 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/README.md +1 -3
- data/babl.gemspec +3 -1
- data/lib/babl.rb +4 -6
- data/lib/babl/builder/chain_builder.rb +6 -2
- data/lib/babl/builder/template_base.rb +16 -3
- data/lib/babl/errors.rb +7 -0
- data/lib/babl/nodes/create_pin.rb +24 -0
- data/lib/babl/nodes/dep.rb +38 -0
- data/lib/babl/nodes/each.rb +29 -0
- data/lib/babl/nodes/fixed_array.rb +25 -0
- data/lib/babl/nodes/goto_pin.rb +24 -0
- data/lib/babl/{rendering/internal_value_node.rb → nodes/internal_value.rb} +6 -5
- data/lib/babl/nodes/merge.rb +102 -0
- data/lib/babl/nodes/nav.rb +33 -0
- data/lib/babl/nodes/object.rb +26 -0
- data/lib/babl/nodes/parent.rb +64 -0
- data/lib/babl/nodes/static.rb +34 -0
- data/lib/babl/nodes/switch.rb +29 -0
- data/lib/babl/nodes/terminal_value.rb +76 -0
- data/lib/babl/nodes/with.rb +28 -0
- data/lib/babl/operators/array.rb +5 -28
- data/lib/babl/operators/call.rb +4 -2
- data/lib/babl/operators/continue.rb +19 -0
- data/lib/babl/operators/default.rb +13 -0
- data/lib/babl/operators/dep.rb +3 -36
- data/lib/babl/operators/each.rb +3 -33
- data/lib/babl/operators/enter.rb +4 -2
- data/lib/babl/operators/extends.rb +4 -1
- data/lib/babl/operators/merge.rb +7 -30
- data/lib/babl/operators/nav.rb +4 -36
- data/lib/babl/operators/object.rb +7 -29
- data/lib/babl/operators/parent.rb +4 -73
- data/lib/babl/operators/partial.rb +4 -2
- data/lib/babl/operators/pin.rb +14 -58
- data/lib/babl/operators/static.rb +11 -30
- data/lib/babl/operators/switch.rb +8 -51
- data/lib/babl/operators/with.rb +5 -34
- data/lib/babl/railtie.rb +2 -2
- data/lib/babl/rendering/compiled_template.rb +5 -13
- data/lib/babl/rendering/context.rb +13 -7
- data/lib/babl/schema/any_of.rb +137 -0
- data/lib/babl/schema/anything.rb +13 -0
- data/lib/babl/schema/dyn_array.rb +11 -0
- data/lib/babl/schema/fixed_array.rb +13 -0
- data/lib/babl/schema/object.rb +35 -0
- data/lib/babl/schema/static.rb +14 -0
- data/lib/babl/schema/typed.rb +0 -0
- data/lib/babl/template.rb +4 -9
- data/lib/babl/utils/ref.rb +6 -0
- data/lib/babl/version.rb +1 -1
- data/spec/operators/array_spec.rb +31 -7
- data/spec/operators/call_spec.rb +16 -14
- data/spec/operators/continue_spec.rb +25 -0
- data/spec/operators/default_spec.rb +15 -0
- data/spec/operators/dep_spec.rb +4 -8
- data/spec/operators/each_spec.rb +24 -5
- data/spec/operators/enter_spec.rb +9 -7
- data/spec/operators/extends_spec.rb +19 -5
- data/spec/operators/merge_spec.rb +105 -12
- data/spec/operators/nav_spec.rb +22 -10
- data/spec/operators/null_spec.rb +5 -4
- data/spec/operators/nullable_spec.rb +13 -13
- data/spec/operators/object_spec.rb +17 -6
- data/spec/operators/parent_spec.rb +18 -22
- data/spec/operators/partial_spec.rb +8 -6
- data/spec/operators/pin_spec.rb +100 -61
- data/spec/operators/source_spec.rb +10 -6
- data/spec/operators/static_spec.rb +17 -9
- data/spec/operators/switch_spec.rb +85 -45
- data/spec/operators/with_spec.rb +13 -15
- data/spec/spec_helper.rb +2 -31
- data/spec/spec_helper/operator_testing.rb +46 -0
- data/spec/spec_helper/schema_utils.rb +33 -0
- metadata +63 -4
- data/lib/babl/rendering/terminal_value_node.rb +0 -54
@@ -1,28 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
3
|
+
describe Babl::Operators::Source do
|
4
|
+
extend SpecHelper::OperatorTesting
|
5
5
|
|
6
6
|
describe '#source' do
|
7
7
|
let(:object) { { abc: { def: 12 } } }
|
8
8
|
|
9
9
|
context 'block returning primitive' do
|
10
|
-
|
10
|
+
template { source { true } }
|
11
|
+
|
11
12
|
it { expect(json).to eq(true) }
|
12
13
|
end
|
13
14
|
|
14
15
|
context 'block using operators' do
|
15
|
-
|
16
|
+
template { source { static(3) } }
|
17
|
+
|
16
18
|
it { expect(json).to eq(3) }
|
17
19
|
end
|
18
20
|
|
19
21
|
context 'two level sourcing' do
|
20
|
-
|
22
|
+
template { source { nav(:abc).source { nav(:def) } } }
|
23
|
+
|
21
24
|
it { expect(json).to eq(12) }
|
22
25
|
end
|
23
26
|
|
24
27
|
context 'string template' do
|
25
|
-
|
28
|
+
template { source('object(a: static(true))') }
|
29
|
+
|
26
30
|
it { expect(json).to eq('a' => true) }
|
27
31
|
end
|
28
32
|
end
|
@@ -1,19 +1,27 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
3
|
+
describe Babl::Operators::Static do
|
4
|
+
extend SpecHelper::OperatorTesting
|
5
5
|
|
6
6
|
describe '#static' do
|
7
|
-
|
8
|
-
|
7
|
+
context 'static object' do
|
8
|
+
template { static('1': 'cava') }
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
it { expect(json).to eq('1' => 'cava') }
|
11
|
+
it { expect(dependencies).to eq({}) }
|
12
|
+
it { expect(schema).to eq s_object(s_property(:'1', s_static('cava'))) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'static primitive' do
|
16
|
+
template { static('ok') }
|
17
|
+
|
18
|
+
it { expect(schema).to eq s_static('ok') }
|
19
|
+
end
|
13
20
|
|
14
21
|
context 'invalid' do
|
15
|
-
|
16
|
-
|
22
|
+
template { static(test: Object.new) }
|
23
|
+
|
24
|
+
it { expect { compiled }.to raise_error Babl::Errors::InvalidTemplateError }
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
@@ -1,81 +1,121 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
3
|
+
describe Babl::Operators::Switch do
|
4
|
+
extend SpecHelper::OperatorTesting
|
5
5
|
|
6
6
|
describe '#switch' do
|
7
|
-
context do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
).static('WTF')
|
18
|
-
}
|
7
|
+
context 'realistic use case' do
|
8
|
+
template {
|
9
|
+
even = nullable.nav(:even?)
|
10
|
+
odd = nullable.nav(:odd?)
|
11
|
+
|
12
|
+
each.switch(
|
13
|
+
even => nav { |x| "#{x} is even" },
|
14
|
+
odd => nav { |x| "#{x} is odd" },
|
15
|
+
default => continue
|
16
|
+
).static('WTF')
|
19
17
|
}
|
20
18
|
|
21
19
|
let(:object) { [1, 2, nil, 5] }
|
22
20
|
|
23
21
|
it { expect(json).to eq ['1 is odd', '2 is even', 'WTF', '5 is odd'] }
|
24
22
|
it { expect(dependencies).to eq(__each__: { even?: {}, odd?: {} }) }
|
25
|
-
it {
|
26
|
-
expect(documentation).to eq [
|
27
|
-
'Case 1': :__value__,
|
28
|
-
'Case 2': :__value__,
|
29
|
-
'Case 3': 'WTF'
|
30
|
-
]
|
31
|
-
}
|
23
|
+
it { expect(schema).to eq s_dyn_array(s_any_of(s_static('WTF'), s_anything)) }
|
32
24
|
end
|
33
25
|
|
34
26
|
context 'static condition' do
|
35
|
-
|
27
|
+
template { switch(true => 42) }
|
28
|
+
|
36
29
|
let(:object) { {} }
|
30
|
+
|
37
31
|
it { expect(json).to eq 42 }
|
38
32
|
end
|
39
33
|
|
40
|
-
context '
|
41
|
-
|
34
|
+
context 'only one output possible' do
|
35
|
+
template { switch(false => 2, true => 2) }
|
42
36
|
|
43
|
-
it { expect
|
37
|
+
it { expect(schema).to eq s_static(2) }
|
44
38
|
end
|
45
39
|
|
46
|
-
context '
|
47
|
-
|
40
|
+
context 'no branch taken' do
|
41
|
+
template { switch(false => 1) }
|
48
42
|
|
49
|
-
it { expect { compiled }.to raise_error Babl::InvalidTemplateError }
|
50
|
-
end
|
51
|
-
|
52
|
-
context 'unhandled default' do
|
53
43
|
let(:object) { { abc: { lol: { ok: 42 } } } }
|
54
|
-
let(:template) { dsl.source { switch(false => 1) } }
|
55
44
|
|
56
45
|
it { expect(dependencies).to eq({}) }
|
57
|
-
it { expect { json }.to raise_error Babl::RenderingError }
|
58
|
-
end
|
59
|
-
|
60
|
-
context 'continue without switch' do
|
61
|
-
let(:template) { dsl.source { continue } }
|
62
|
-
|
63
|
-
it { expect { compiled }.to raise_error Babl::InvalidTemplateError }
|
46
|
+
it { expect { json }.to raise_error Babl::Errors::RenderingError }
|
64
47
|
end
|
65
48
|
|
66
49
|
context 'non serializable objects are allowed internally' do
|
67
|
-
|
50
|
+
template { switch(test: 42) }
|
51
|
+
|
68
52
|
let(:object) { { test: Object.new } }
|
69
53
|
|
70
54
|
it { expect(json).to eq 42 }
|
71
55
|
end
|
72
56
|
|
73
|
-
context do
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
57
|
+
context 'switch between empty array and a dyn array' do
|
58
|
+
template { switch(1 => each.object(a: 1), 2 => []) }
|
59
|
+
|
60
|
+
let(:object) { [nil] }
|
61
|
+
|
62
|
+
it { expect(json).to eq(['a' => 1]) }
|
63
|
+
it { expect(schema).to eq s_dyn_array(s_object(s_property(:a, s_static(1)))) }
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'switch between fixed array and a dyn array producing different output' do
|
67
|
+
template { switch(1 => each.static(1), 2 => [2]) }
|
68
|
+
|
69
|
+
it {
|
70
|
+
expect(schema).to eq s_any_of(
|
71
|
+
s_dyn_array(s_static(1)), s_fixed_array(s_static(2))
|
72
|
+
)
|
78
73
|
}
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'switch between fixed array and a dyn array producing identical output' do
|
77
|
+
template { switch(1 => nullable.each.static(1), 2 => [1]) }
|
78
|
+
|
79
|
+
it { expect(schema).to eq s_dyn_array(s_static(1), nullable: true) }
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'switch between similar objects having only one different property' do
|
83
|
+
template { switch(1 => { a: 34, b: 3 }, 2 => { a: 34, b: 1 }, 3 => { b: 2, a: 34 }) }
|
84
|
+
|
85
|
+
it {
|
86
|
+
expect(schema).to eq s_object(
|
87
|
+
s_property(:a, s_static(34)),
|
88
|
+
s_property(:b, s_any_of(s_static(1), s_static(2), s_static(3)))
|
89
|
+
)
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
context 'switch between similar objects having more than one different property' do
|
94
|
+
template { switch(1 => { a: 35, b: 1 }, 2 => { a: 34, b: 2 }) }
|
95
|
+
|
96
|
+
it {
|
97
|
+
expect(schema).to eq s_any_of(
|
98
|
+
s_object(
|
99
|
+
s_property(:a, s_static(35)),
|
100
|
+
s_property(:b, s_static(1))
|
101
|
+
),
|
102
|
+
s_object(
|
103
|
+
s_property(:a, s_static(34)),
|
104
|
+
s_property(:b, s_static(2))
|
105
|
+
)
|
106
|
+
)
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
context 'switch between two possible dyn arrays' do
|
111
|
+
template { switch(1 => each.static('a'), 2 => each.static('b')) }
|
112
|
+
|
113
|
+
it { expect(schema).to eq s_dyn_array(s_any_of(s_static('a'), s_static('b'))) }
|
114
|
+
end
|
115
|
+
|
116
|
+
context 'with dependencies' do
|
117
|
+
template { nav(:test).switch(nav(:keke) => parent.nav(:lol)) }
|
118
|
+
|
79
119
|
it { expect(dependencies).to eq(test: { keke: {} }, lol: {}) }
|
80
120
|
end
|
81
121
|
end
|
data/spec/operators/with_spec.rb
CHANGED
@@ -1,32 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
3
|
+
describe Babl::Operators::With do
|
4
|
+
extend SpecHelper::OperatorTesting
|
5
5
|
|
6
6
|
describe '#with' do
|
7
7
|
context 'everything is fine' do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
}
|
8
|
+
template {
|
9
|
+
object(
|
10
|
+
result: with(
|
11
|
+
unscoped,
|
12
|
+
:msg,
|
13
|
+
_.parent.nav(:msg).dep(:lol)
|
14
|
+
) { |obj, a, b| "#{a} #{b} #{obj[:msg]}" }
|
15
|
+
)
|
18
16
|
}
|
19
17
|
|
20
18
|
let(:object) { { result: 42, msg: 'Hello C' } }
|
21
19
|
|
22
20
|
it { expect(json).to eq('result' => 'Hello C Hello C Hello C') }
|
23
21
|
it { expect(dependencies).to eq(result: {}, msg: { lol: {} }) }
|
24
|
-
it { expect(
|
22
|
+
it { expect(schema).to eq s_object(s_property(:result, s_anything)) }
|
25
23
|
end
|
26
24
|
|
27
25
|
context 'when the block raise an exception' do
|
28
|
-
|
29
|
-
|
26
|
+
template { with { raise 'lol' } }
|
27
|
+
|
30
28
|
it { expect { json }.to raise_error(/\__root__\.__block__/) }
|
31
29
|
end
|
32
30
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,31 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
|
4
|
-
module SpecHelper
|
5
|
-
module Operators
|
6
|
-
def self.included(base)
|
7
|
-
base.let(:dsl) { ::Babl::Template.new }
|
8
|
-
base.let(:compiled) { template.compile }
|
9
|
-
base.let(:json) { ::Oj.load(compiled.json(object)) }
|
10
|
-
base.let(:dependencies) { compiled.dependencies }
|
11
|
-
base.let(:documentation) { compiled.documentation }
|
12
|
-
|
13
|
-
base.before {
|
14
|
-
stub_const('TestLookupContext', Class.new {
|
15
|
-
attr_reader :code, :childs
|
16
|
-
|
17
|
-
def initialize(code = nil, **childs)
|
18
|
-
@code = code
|
19
|
-
@childs = childs
|
20
|
-
end
|
21
|
-
|
22
|
-
def find(name)
|
23
|
-
name = name.to_sym
|
24
|
-
return unless childs[name]
|
25
|
-
[name.to_s, childs[name].code, childs[name]]
|
26
|
-
end
|
27
|
-
})
|
28
|
-
}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
1
|
+
require 'spec_helper/operator_testing'
|
2
|
+
require 'spec_helper/schema_utils'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'babl'
|
2
|
+
require 'oj'
|
3
|
+
require 'json-schema'
|
4
|
+
require 'spec_helper/schema_utils'
|
5
|
+
|
6
|
+
module SpecHelper
|
7
|
+
module OperatorTesting
|
8
|
+
def template(*args, &block)
|
9
|
+
let(:template) { dsl.source(*args, &block) }
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.extended(base)
|
13
|
+
base.include SchemaUtils
|
14
|
+
|
15
|
+
base.let(:dsl) { Babl::Template.new }
|
16
|
+
base.let(:compiled) { template.compile }
|
17
|
+
base.let(:unchecked_json) { ::Oj.load(compiled.json(object)) }
|
18
|
+
base.let(:dependencies) { compiled.send(:dependencies) }
|
19
|
+
base.let(:schema) { compiled.send(:node).schema }
|
20
|
+
base.let(:json_schema) { compiled.json_schema }
|
21
|
+
base.let(:object) { nil }
|
22
|
+
|
23
|
+
base.let(:json) {
|
24
|
+
JSON::Validator.validate!(json_schema, unchecked_json, validate_schema: true)
|
25
|
+
unchecked_json
|
26
|
+
}
|
27
|
+
|
28
|
+
base.before {
|
29
|
+
stub_const('TestLookupContext', Class.new {
|
30
|
+
attr_reader :code, :childs
|
31
|
+
|
32
|
+
def initialize(code = nil, **childs)
|
33
|
+
@code = code
|
34
|
+
@childs = childs
|
35
|
+
end
|
36
|
+
|
37
|
+
def find(name)
|
38
|
+
name = name.to_sym
|
39
|
+
return unless childs[name]
|
40
|
+
[name.to_s, childs[name].code, childs[name]]
|
41
|
+
end
|
42
|
+
})
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'babl'
|
2
|
+
|
3
|
+
module SpecHelper
|
4
|
+
module SchemaUtils
|
5
|
+
def s_any_of(*args)
|
6
|
+
Babl::Schema::AnyOf.new(args)
|
7
|
+
end
|
8
|
+
|
9
|
+
def s_anything
|
10
|
+
Babl::Schema::Anything.instance
|
11
|
+
end
|
12
|
+
|
13
|
+
def s_dyn_array(schema, nullable: false)
|
14
|
+
Babl::Schema::DynArray.new(schema, nullable)
|
15
|
+
end
|
16
|
+
|
17
|
+
def s_fixed_array(*schemas, nullable: false)
|
18
|
+
Babl::Schema::FixedArray.new(schemas, nullable)
|
19
|
+
end
|
20
|
+
|
21
|
+
def s_object(*properties, additional: false, nullable: false)
|
22
|
+
Babl::Schema::Object.new(properties, additional, nullable)
|
23
|
+
end
|
24
|
+
|
25
|
+
def s_static(value)
|
26
|
+
Babl::Schema::Static.new(value)
|
27
|
+
end
|
28
|
+
|
29
|
+
def s_property(name, value, required: true)
|
30
|
+
Babl::Schema::Object::Property.new(name, value, required)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babl-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederic Terrazzoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.48'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: json-schema
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.8'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: oj
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: values
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.8'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.8'
|
69
97
|
description: JSON templating on steroids
|
70
98
|
email:
|
71
99
|
- frederic.terrazzoni@gmail.com
|
@@ -85,8 +113,25 @@ files:
|
|
85
113
|
- lib/babl.rb
|
86
114
|
- lib/babl/builder/chain_builder.rb
|
87
115
|
- lib/babl/builder/template_base.rb
|
116
|
+
- lib/babl/errors.rb
|
117
|
+
- lib/babl/nodes/create_pin.rb
|
118
|
+
- lib/babl/nodes/dep.rb
|
119
|
+
- lib/babl/nodes/each.rb
|
120
|
+
- lib/babl/nodes/fixed_array.rb
|
121
|
+
- lib/babl/nodes/goto_pin.rb
|
122
|
+
- lib/babl/nodes/internal_value.rb
|
123
|
+
- lib/babl/nodes/merge.rb
|
124
|
+
- lib/babl/nodes/nav.rb
|
125
|
+
- lib/babl/nodes/object.rb
|
126
|
+
- lib/babl/nodes/parent.rb
|
127
|
+
- lib/babl/nodes/static.rb
|
128
|
+
- lib/babl/nodes/switch.rb
|
129
|
+
- lib/babl/nodes/terminal_value.rb
|
130
|
+
- lib/babl/nodes/with.rb
|
88
131
|
- lib/babl/operators/array.rb
|
89
132
|
- lib/babl/operators/call.rb
|
133
|
+
- lib/babl/operators/continue.rb
|
134
|
+
- lib/babl/operators/default.rb
|
90
135
|
- lib/babl/operators/dep.rb
|
91
136
|
- lib/babl/operators/each.rb
|
92
137
|
- lib/babl/operators/enter.rb
|
@@ -106,14 +151,22 @@ files:
|
|
106
151
|
- lib/babl/railtie.rb
|
107
152
|
- lib/babl/rendering/compiled_template.rb
|
108
153
|
- lib/babl/rendering/context.rb
|
109
|
-
- lib/babl/rendering/internal_value_node.rb
|
110
154
|
- lib/babl/rendering/noop_preloader.rb
|
111
|
-
- lib/babl/
|
155
|
+
- lib/babl/schema/any_of.rb
|
156
|
+
- lib/babl/schema/anything.rb
|
157
|
+
- lib/babl/schema/dyn_array.rb
|
158
|
+
- lib/babl/schema/fixed_array.rb
|
159
|
+
- lib/babl/schema/object.rb
|
160
|
+
- lib/babl/schema/static.rb
|
161
|
+
- lib/babl/schema/typed.rb
|
112
162
|
- lib/babl/template.rb
|
113
163
|
- lib/babl/utils/hash.rb
|
164
|
+
- lib/babl/utils/ref.rb
|
114
165
|
- lib/babl/version.rb
|
115
166
|
- spec/operators/array_spec.rb
|
116
167
|
- spec/operators/call_spec.rb
|
168
|
+
- spec/operators/continue_spec.rb
|
169
|
+
- spec/operators/default_spec.rb
|
117
170
|
- spec/operators/dep_spec.rb
|
118
171
|
- spec/operators/each_spec.rb
|
119
172
|
- spec/operators/enter_spec.rb
|
@@ -131,6 +184,8 @@ files:
|
|
131
184
|
- spec/operators/switch_spec.rb
|
132
185
|
- spec/operators/with_spec.rb
|
133
186
|
- spec/spec_helper.rb
|
187
|
+
- spec/spec_helper/operator_testing.rb
|
188
|
+
- spec/spec_helper/schema_utils.rb
|
134
189
|
homepage: https://github.com/getbannerman/babl
|
135
190
|
licenses:
|
136
191
|
- MIT
|
@@ -158,6 +213,8 @@ summary: JSON templating on steroids
|
|
158
213
|
test_files:
|
159
214
|
- spec/operators/array_spec.rb
|
160
215
|
- spec/operators/call_spec.rb
|
216
|
+
- spec/operators/continue_spec.rb
|
217
|
+
- spec/operators/default_spec.rb
|
161
218
|
- spec/operators/dep_spec.rb
|
162
219
|
- spec/operators/each_spec.rb
|
163
220
|
- spec/operators/enter_spec.rb
|
@@ -175,3 +232,5 @@ test_files:
|
|
175
232
|
- spec/operators/switch_spec.rb
|
176
233
|
- spec/operators/with_spec.rb
|
177
234
|
- spec/spec_helper.rb
|
235
|
+
- spec/spec_helper/operator_testing.rb
|
236
|
+
- spec/spec_helper/schema_utils.rb
|