wlang 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +27 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +16 -0
- data/README.md +32 -55
- data/lib/wlang.rb +8 -0
- data/lib/wlang/compiler/grammar.citrus +19 -16
- data/lib/wlang/dialect.rb +18 -14
- data/lib/wlang/html.rb +7 -11
- data/lib/wlang/scope.rb +68 -28
- data/lib/wlang/scope/binding_scope.rb +3 -3
- data/lib/wlang/scope/null_scope.rb +34 -0
- data/lib/wlang/scope/object_scope.rb +18 -7
- data/lib/wlang/scope/proc_scope.rb +4 -4
- data/lib/wlang/scope/sinatra_scope.rb +44 -0
- data/lib/wlang/template.rb +10 -2
- data/lib/wlang/tilt/wlang_template.rb +1 -1
- data/lib/wlang/version.rb +2 -2
- data/spec/assumptions/test_core.rb +8 -0
- data/spec/fixtures/templates/hello_from_sinatra.wlang +1 -0
- data/spec/integration/html/test_greater.rb +12 -2
- data/spec/integration/sinatra/test_partials.rb +35 -0
- data/spec/integration/test_examples.rb +2 -2
- data/spec/spec_helper.rb +7 -0
- data/spec/unit/compiler/test_grammar.rb +1 -1
- data/spec/unit/compiler/test_parser.rb +17 -0
- data/spec/unit/dialect/test_context.rb +28 -0
- data/spec/unit/dialect/test_evaluate.rb +10 -0
- data/spec/unit/dialect/test_render.rb +4 -0
- data/spec/unit/scope/sinatra_scope/test_fetch.rb +28 -0
- data/spec/unit/scope/test_binding_scope.rb +1 -1
- data/spec/unit/scope/test_chain.rb +5 -5
- data/spec/unit/scope/test_coerce.rb +7 -3
- data/spec/unit/scope/test_null_scope.rb +35 -0
- data/spec/unit/scope/test_object_scope.rb +1 -1
- data/spec/unit/scope/test_proc_scope.rb +1 -1
- data/spec/unit/scope/test_push.rb +70 -0
- data/spec/unit/template/test_call_args_conventions.rb +101 -0
- data/spec/unit/test_assumptions.rb +12 -0
- data/spec/unit/test_scope.rb +26 -16
- data/wlang.gemspec +2 -0
- data/wlang.noespec +3 -1
- metadata +143 -33
- data/lib/wlang/scope/proxy_scope.rb +0 -18
- data/lib/wlang/scope/root_scope.rb +0 -24
- data/spec/unit/scope/test_proxy_scope.rb +0 -22
- data/spec/unit/scope/test_root_scope.rb +0 -22
@@ -1,28 +1,28 @@
|
|
1
1
|
module WLang
|
2
2
|
describe Scope, '.chain' do
|
3
3
|
|
4
|
-
it 'returns
|
5
|
-
Scope.chain([]).should eq(Scope.
|
4
|
+
it 'returns the NullScope on empty chain' do
|
5
|
+
Scope.chain([]).should eq(Scope.null)
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'returns a single scope on singleton' do
|
9
9
|
s = Scope.chain([{:who => "World"}])
|
10
10
|
s.should be_a(Scope::ObjectScope)
|
11
|
-
s.parent.should
|
11
|
+
s.parent.should be_nil
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'uses the last scope as most specific' do
|
15
15
|
s = Scope.chain([{:who => "World"}, lambda{}])
|
16
16
|
s.should be_a(Scope::ProcScope)
|
17
17
|
s.parent.should be_a(Scope::ObjectScope)
|
18
|
-
s.parent.parent.should
|
18
|
+
s.parent.parent.should be_nil
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'strips nils' do
|
22
22
|
s = Scope.chain([nil, {:who => "World"}, nil, lambda{}, nil])
|
23
23
|
s.should be_a(Scope::ProcScope)
|
24
24
|
s.parent.should be_a(Scope::ObjectScope)
|
25
|
-
s.parent.parent.should
|
25
|
+
s.parent.parent.should be_nil
|
26
26
|
end
|
27
27
|
|
28
28
|
end
|
@@ -10,6 +10,10 @@ module WLang
|
|
10
10
|
Scope.coerce(lambda{}).should be_a(Scope::ProcScope)
|
11
11
|
end
|
12
12
|
|
13
|
+
it 'recognizes Sinatra applications' do
|
14
|
+
Scope.coerce(sinatra_app).should be_a(Scope::SinatraScope)
|
15
|
+
end
|
16
|
+
|
13
17
|
it 'falls back to ObjectScope on Hash' do
|
14
18
|
Scope.coerce({}).should be_a(Scope::ObjectScope)
|
15
19
|
end
|
@@ -19,14 +23,14 @@ module WLang
|
|
19
23
|
end
|
20
24
|
|
21
25
|
it 'returns the Scope if nothing has to be done' do
|
22
|
-
Scope.coerce(Scope.
|
26
|
+
Scope.coerce(Scope.null).should eq(Scope.null)
|
23
27
|
s = Scope.coerce({})
|
24
28
|
Scope.coerce(s).should eq(s)
|
25
29
|
end
|
26
30
|
|
27
|
-
it '
|
31
|
+
it 'returns the Scope on a Scope' do
|
28
32
|
s = Scope.coerce({})
|
29
|
-
Scope.coerce(s
|
33
|
+
Scope.coerce(s).should eq(s)
|
30
34
|
end
|
31
35
|
|
32
36
|
end # describe Scope
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module WLang
|
3
|
+
class Scope
|
4
|
+
describe NullScope do
|
5
|
+
|
6
|
+
let(:scope){ NullScope.new }
|
7
|
+
|
8
|
+
it 'throws on fetch' do
|
9
|
+
lambda{ scope.fetch(:who) }.should throw_symbol(:fail)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'throws on fetch even on `self`' do
|
13
|
+
lambda{ scope.fetch(:self) }.should throw_symbol(:fail)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns pushed scope on push' do
|
17
|
+
pushed = ObjectScope.new(12)
|
18
|
+
scope.push(pushed).should eq(pushed)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'coerces pushed scope on push' do
|
22
|
+
scope.push(12).should be_a(ObjectScope)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns nil on pop' do
|
26
|
+
scope.pop.should be_nil
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns an empty array of subjects' do
|
30
|
+
scope.subjects.should eq([])
|
31
|
+
end
|
32
|
+
|
33
|
+
end # describe NullScope
|
34
|
+
end # class Scope
|
35
|
+
end # module WLang
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module WLang
|
3
|
+
describe Scope, 'push' do
|
4
|
+
|
5
|
+
let(:x_scope){ Scope.coerce(:x) }
|
6
|
+
|
7
|
+
subject{ x_scope.push(pushed) }
|
8
|
+
|
9
|
+
before do
|
10
|
+
subject.should be_a(Scope)
|
11
|
+
end
|
12
|
+
|
13
|
+
after do
|
14
|
+
x_scope.parent.should be_nil
|
15
|
+
x_scope.subject.should eq(:x)
|
16
|
+
x_scope.root.should eq(x_scope)
|
17
|
+
x_scope.subjects.should eq([:x])
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when pushing a simple value' do
|
21
|
+
let(:pushed){ :y }
|
22
|
+
|
23
|
+
it 'returns the scope with correct subject' do
|
24
|
+
subject.subject.should eq(:y)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'sets the parent correctly on created scope' do
|
28
|
+
subject.parent.should eq(x_scope)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'returns the correct root scope' do
|
32
|
+
subject.root.should eq(x_scope)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'has the correct subjects' do
|
36
|
+
subject.subjects.should eq([:x, :y])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'when pushing another scope' do
|
41
|
+
let(:pushed){ Scope.coerce(:y).push(:z) }
|
42
|
+
|
43
|
+
it 'returns the scope with most specific subject' do
|
44
|
+
subject.subject.should eq(:z)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'rechains parents correctly' do
|
48
|
+
subject.parent.subject.should eq(:y)
|
49
|
+
subject.parent.parent.subject.should eq(:x)
|
50
|
+
subject.parent.parent.parent.should be_nil
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'returns the correct root scope' do
|
54
|
+
subject.root.should eq(x_scope)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'does not touch the original scope' do
|
58
|
+
pushed.subject.should eq(:z)
|
59
|
+
pushed.parent.subject.should eq(:y)
|
60
|
+
pushed.parent.parent.should be_nil
|
61
|
+
pushed.root.should eq(pushed.parent)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'has the correct subjects' do
|
65
|
+
subject.subjects.should eq([:x, :y, :z])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module WLang
|
3
|
+
describe Template, 'call_args_conventions' do
|
4
|
+
|
5
|
+
let(:template){ Template.new("Hello ${who}!") }
|
6
|
+
|
7
|
+
subject{ template.send(:call_args_conventions, args.dup) }
|
8
|
+
|
9
|
+
let(:scope) { subject.first }
|
10
|
+
let(:buffer){ subject.last }
|
11
|
+
|
12
|
+
before do
|
13
|
+
scope.should be_a(Scope)
|
14
|
+
buffer.should respond_to(:<<)
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'without any argument' do
|
18
|
+
let(:args){ [] }
|
19
|
+
it 'sets a default NullScope' do
|
20
|
+
scope.should eq(Scope.null)
|
21
|
+
end
|
22
|
+
it 'uses a string buffer' do
|
23
|
+
buffer.should eq('')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'with only a String buffer' do
|
28
|
+
let(:args){ [ 'foo' ] }
|
29
|
+
it 'sets a default NullScope' do
|
30
|
+
scope.should eq(Scope.null)
|
31
|
+
end
|
32
|
+
it 'uses the provided buffer' do
|
33
|
+
buffer.should eq('foo')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'with only a StringIO buffer' do
|
38
|
+
let(:args){ [ StringIO.new ] }
|
39
|
+
it 'sets a default NullScope' do
|
40
|
+
scope.should eq(Scope.null)
|
41
|
+
end
|
42
|
+
it 'uses the provided buffer' do
|
43
|
+
buffer.should eq(args.first)
|
44
|
+
buffer.object_id.should eq(args.first.object_id)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'with only a Hash' do
|
49
|
+
let(:args){ [ {} ] }
|
50
|
+
it 'sets the correct scope subjects' do
|
51
|
+
scope.subjects.should eq(args)
|
52
|
+
end
|
53
|
+
it 'uses a string buffer' do
|
54
|
+
buffer.should eq('')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'with multiple scoping arguments' do
|
59
|
+
let(:args){ [ 12, {} ] }
|
60
|
+
it 'builds a chain of scoping arguments' do
|
61
|
+
scope.subjects.should eq(args)
|
62
|
+
end
|
63
|
+
it 'uses a string buffer' do
|
64
|
+
buffer.should eq('')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'with both a Hash and a String' do
|
69
|
+
let(:args){ [ {}, 'foo' ] }
|
70
|
+
it 'sets a default ObjectScope' do
|
71
|
+
scope.subjects.should eq([args.first])
|
72
|
+
end
|
73
|
+
it 'uses a string buffer' do
|
74
|
+
buffer.should eq('foo')
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context 'when the template has locals and no arguments' do
|
79
|
+
let(:template){ Template.new(hello_with_data_path) }
|
80
|
+
let(:args){ [] }
|
81
|
+
it 'uses template locals in Scope' do
|
82
|
+
scope.subjects.should eq([{"who" => "world"}])
|
83
|
+
end
|
84
|
+
it 'uses a string buffer' do
|
85
|
+
buffer.should eq('')
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'when the template has locals and arguments' do
|
90
|
+
let(:template){ Template.new(hello_with_data_path) }
|
91
|
+
let(:args){ [ 12, {}, 'foo' ] }
|
92
|
+
it 'sets the correct scoping subjects' do
|
93
|
+
scope.subjects.should eq([12, {}, {"who" => "world"}])
|
94
|
+
end
|
95
|
+
it 'uses the string as buffer' do
|
96
|
+
buffer.should eq('foo')
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
end
|
@@ -22,8 +22,20 @@ describe "ruby assumptions" do
|
|
22
22
|
|
23
23
|
it "lambda arity" do
|
24
24
|
lambda{|| }.arity.should eq(0)
|
25
|
+
(lambda{ }.arity <= 0).should be_true
|
25
26
|
lambda{|fn|}.arity.should eq(1)
|
26
27
|
lambda{|fn1,fn2|}.arity.should eq(2)
|
27
28
|
end
|
28
29
|
|
30
|
+
it 'allows using a Proc usable in a case statement' do
|
31
|
+
proc = lambda{|x| x > 10}
|
32
|
+
[ 17, 3 ].map{|x|
|
33
|
+
case x
|
34
|
+
when proc then x*10
|
35
|
+
else
|
36
|
+
x
|
37
|
+
end
|
38
|
+
}.should eq([170, 3])
|
39
|
+
end
|
40
|
+
|
29
41
|
end
|
data/spec/unit/test_scope.rb
CHANGED
@@ -6,51 +6,61 @@ module WLang
|
|
6
6
|
|
7
7
|
it 'acts like a stack' do
|
8
8
|
s = scope
|
9
|
-
s.evaluate(:who).should eq("World")
|
10
|
-
lambda{ s.pop.evaluate(:who) }.should throw_symbol(:fail)
|
9
|
+
s.evaluate(:who, nil).should eq("World")
|
11
10
|
s = scope.push(:who => "World2")
|
12
|
-
s.evaluate(:who).should eq("World2")
|
11
|
+
s.evaluate(:who, nil).should eq("World2")
|
13
12
|
s = s.pop
|
14
|
-
s.evaluate(:who).should eq("World")
|
13
|
+
s.evaluate(:who, nil).should eq("World")
|
15
14
|
end
|
16
15
|
|
17
16
|
it 'has a `with` helper' do
|
18
17
|
scope.with(:who => "World2") do |s|
|
19
|
-
s.evaluate(:who).should eq("World2")
|
18
|
+
s.evaluate(:who, nil).should eq("World2")
|
20
19
|
end
|
21
|
-
scope.evaluate(:who).should eq("World")
|
20
|
+
scope.evaluate(:who, nil).should eq("World")
|
22
21
|
end
|
23
22
|
|
24
23
|
it 'allows pushing scopes' do
|
25
24
|
scope.with Scope.coerce(:other => "World2") do |s|
|
26
|
-
s.evaluate(:other).should eq("World2")
|
27
|
-
s.evaluate(:who).should eq("World")
|
25
|
+
s.evaluate(:other, nil).should eq("World2")
|
26
|
+
s.evaluate(:who, nil).should eq("World")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'gives access to the root' do
|
31
|
+
scope.root.should eq(scope)
|
32
|
+
scope.with(:other => "World2") do |s|
|
33
|
+
s.root.should eq(scope)
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
31
37
|
it 'evaluates `self` accurately' do
|
32
|
-
scope.evaluate(:self).should eq(:who => "World")
|
38
|
+
scope.evaluate(:self, nil).should eq(:who => "World")
|
33
39
|
end
|
34
40
|
|
35
41
|
it 'evaluates dot expressions correctly' do
|
36
|
-
scope.evaluate("who.upcase").should eq("WORLD")
|
42
|
+
scope.evaluate("who.upcase", nil).should eq("WORLD")
|
37
43
|
end
|
38
44
|
|
39
45
|
it 'strips strings before evaluation' do
|
40
|
-
scope.evaluate(" who ").should eq("World")
|
41
|
-
scope.evaluate(" who.upcase ").should eq("WORLD")
|
46
|
+
scope.evaluate(" who ", nil).should eq("World")
|
47
|
+
scope.evaluate(" who.upcase ", nil).should eq("WORLD")
|
42
48
|
end
|
43
49
|
|
44
50
|
it 'fails when not found' do
|
45
|
-
lambda{
|
51
|
+
lambda{
|
52
|
+
scope.evaluate(:nosuchone, nil)
|
53
|
+
}.should throw_symbol(:fail)
|
46
54
|
end
|
47
55
|
|
48
56
|
it 'supports a default value instead of fail' do
|
49
|
-
scope.evaluate(:nosuchone, 12).should eq(12)
|
57
|
+
scope.evaluate(:nosuchone, nil, 12).should eq(12)
|
58
|
+
scope.evaluate(:nosuchone, nil, nil).should be_nil
|
50
59
|
end
|
51
60
|
|
52
|
-
it 'supports
|
53
|
-
scope.evaluate(:nosuchone, nil).should
|
61
|
+
it 'supports a default value through a block instead of fail' do
|
62
|
+
scope.evaluate(:nosuchone, nil){ 12 }.should eq(12)
|
63
|
+
scope.evaluate(:nosuchone, nil){ nil }.should be_nil
|
54
64
|
end
|
55
65
|
|
56
66
|
end # describe Scope
|
data/wlang.gemspec
CHANGED
@@ -129,6 +129,8 @@ Gem::Specification.new do |s|
|
|
129
129
|
s.add_development_dependency("rspec", "~> 2.10.0")
|
130
130
|
s.add_development_dependency("yard", "~> 0.8.1")
|
131
131
|
s.add_development_dependency("bluecloth", "~> 2.2.0")
|
132
|
+
s.add_development_dependency("sinatra", ">= 1.4")
|
133
|
+
s.add_development_dependency("rack-test", "~> 0.6.1")
|
132
134
|
s.add_dependency("citrus", "~> 2.4.1")
|
133
135
|
s.add_dependency("temple", "~> 0.4.0")
|
134
136
|
s.add_dependency("quickl", "~> 0.4.3")
|
data/wlang.noespec
CHANGED
@@ -12,7 +12,7 @@ variables:
|
|
12
12
|
upper:
|
13
13
|
WLang
|
14
14
|
version:
|
15
|
-
2.0
|
15
|
+
2.1.0
|
16
16
|
summary: |-
|
17
17
|
WLang is a powerful code generation and templating engine
|
18
18
|
description: |-
|
@@ -43,3 +43,5 @@ variables:
|
|
43
43
|
- {name: rspec, version: "~> 2.10.0", groups: [development]}
|
44
44
|
- {name: yard, version: "~> 0.8.1", groups: [development]}
|
45
45
|
- {name: bluecloth, version: "~> 2.2.0", groups: [development]}
|
46
|
+
- {name: sinatra, version: ">= 1.4", groups: [development]}
|
47
|
+
- {name: rack-test, version: "~> 0.6.1", groups: [development]}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wlang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: tilt
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: '1.3'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '1.3'
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: rake
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ~>
|
@@ -33,10 +38,15 @@ dependencies:
|
|
33
38
|
version: 0.9.2
|
34
39
|
type: :development
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.9.2
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: bundler
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ~>
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '1.0'
|
45
55
|
type: :development
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: rspec
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ~>
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: 2.10.0
|
56
71
|
type: :development
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.10.0
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: yard
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ~>
|
@@ -66,21 +86,63 @@ dependencies:
|
|
66
86
|
version: 0.8.1
|
67
87
|
type: :development
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.8.1
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: bluecloth
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.2.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
106
|
none: false
|
74
107
|
requirements:
|
75
108
|
- - ~>
|
76
109
|
- !ruby/object:Gem::Version
|
77
110
|
version: 2.2.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sinatra
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.4'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '1.4'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rack-test
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ~>
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: 0.6.1
|
78
135
|
type: :development
|
79
136
|
prerelease: false
|
80
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ~>
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 0.6.1
|
81
143
|
- !ruby/object:Gem::Dependency
|
82
144
|
name: citrus
|
83
|
-
requirement:
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
84
146
|
none: false
|
85
147
|
requirements:
|
86
148
|
- - ~>
|
@@ -88,10 +150,15 @@ dependencies:
|
|
88
150
|
version: 2.4.1
|
89
151
|
type: :runtime
|
90
152
|
prerelease: false
|
91
|
-
version_requirements:
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ~>
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 2.4.1
|
92
159
|
- !ruby/object:Gem::Dependency
|
93
160
|
name: temple
|
94
|
-
requirement:
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
95
162
|
none: false
|
96
163
|
requirements:
|
97
164
|
- - ~>
|
@@ -99,10 +166,15 @@ dependencies:
|
|
99
166
|
version: 0.4.0
|
100
167
|
type: :runtime
|
101
168
|
prerelease: false
|
102
|
-
version_requirements:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ~>
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: 0.4.0
|
103
175
|
- !ruby/object:Gem::Dependency
|
104
176
|
name: quickl
|
105
|
-
requirement:
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
106
178
|
none: false
|
107
179
|
requirements:
|
108
180
|
- - ~>
|
@@ -110,10 +182,15 @@ dependencies:
|
|
110
182
|
version: 0.4.3
|
111
183
|
type: :runtime
|
112
184
|
prerelease: false
|
113
|
-
version_requirements:
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ~>
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: 0.4.3
|
114
191
|
- !ruby/object:Gem::Dependency
|
115
192
|
name: awesome_print
|
116
|
-
requirement:
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
117
194
|
none: false
|
118
195
|
requirements:
|
119
196
|
- - ~>
|
@@ -121,10 +198,15 @@ dependencies:
|
|
121
198
|
version: 1.0.2
|
122
199
|
type: :runtime
|
123
200
|
prerelease: false
|
124
|
-
version_requirements:
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
203
|
+
requirements:
|
204
|
+
- - ~>
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: 1.0.2
|
125
207
|
- !ruby/object:Gem::Dependency
|
126
208
|
name: epath
|
127
|
-
requirement:
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
128
210
|
none: false
|
129
211
|
requirements:
|
130
212
|
- - ! '>='
|
@@ -132,10 +214,15 @@ dependencies:
|
|
132
214
|
version: '0.2'
|
133
215
|
type: :runtime
|
134
216
|
prerelease: false
|
135
|
-
version_requirements:
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ! '>='
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0.2'
|
136
223
|
- !ruby/object:Gem::Dependency
|
137
224
|
name: backports
|
138
|
-
requirement:
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
139
226
|
none: false
|
140
227
|
requirements:
|
141
228
|
- - ~>
|
@@ -143,7 +230,12 @@ dependencies:
|
|
143
230
|
version: '2.6'
|
144
231
|
type: :runtime
|
145
232
|
prerelease: false
|
146
|
-
version_requirements:
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
235
|
+
requirements:
|
236
|
+
- - ~>
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
version: '2.6'
|
147
239
|
description: ! 'WLang is a general-purpose *code generation*/*templating engine*.
|
148
240
|
It''s main aim is to
|
149
241
|
|
@@ -192,10 +284,10 @@ files:
|
|
192
284
|
- lib/wlang/html.rb
|
193
285
|
- lib/wlang/loader.rb
|
194
286
|
- lib/wlang/scope/binding_scope.rb
|
287
|
+
- lib/wlang/scope/null_scope.rb
|
195
288
|
- lib/wlang/scope/object_scope.rb
|
196
289
|
- lib/wlang/scope/proc_scope.rb
|
197
|
-
- lib/wlang/scope/
|
198
|
-
- lib/wlang/scope/root_scope.rb
|
290
|
+
- lib/wlang/scope/sinatra_scope.rb
|
199
291
|
- lib/wlang/scope.rb
|
200
292
|
- lib/wlang/source/front_matter.rb
|
201
293
|
- lib/wlang/source.rb
|
@@ -208,9 +300,11 @@ files:
|
|
208
300
|
- Manifest.txt
|
209
301
|
- Rakefile
|
210
302
|
- README.md
|
303
|
+
- spec/assumptions/test_core.rb
|
211
304
|
- spec/fixtures/dialect/foobar.rb
|
212
305
|
- spec/fixtures/dialect/upcasing.rb
|
213
306
|
- spec/fixtures/templates/hello.wlang
|
307
|
+
- spec/fixtures/templates/hello_from_sinatra.wlang
|
214
308
|
- spec/fixtures/templates/hello_with_data.wlang
|
215
309
|
- spec/fixtures/templates/hello_with_explicit_locals.wlang
|
216
310
|
- spec/fixtures/templates/hello_with_partials.wlang
|
@@ -230,6 +324,7 @@ files:
|
|
230
324
|
- spec/integration/html/test_sharp.rb
|
231
325
|
- spec/integration/html/test_slash.rb
|
232
326
|
- spec/integration/html/test_star.rb
|
327
|
+
- spec/integration/sinatra/test_partials.rb
|
233
328
|
- spec/integration/test_dummy.rb
|
234
329
|
- spec/integration/test_examples.rb
|
235
330
|
- spec/integration/test_readme.rb
|
@@ -249,19 +344,21 @@ files:
|
|
249
344
|
- spec/unit/compiler/test_to_ruby_code.rb
|
250
345
|
- spec/unit/compiler/test_to_ruby_proc.rb
|
251
346
|
- spec/unit/dialect/test_compile.rb
|
347
|
+
- spec/unit/dialect/test_context.rb
|
252
348
|
- spec/unit/dialect/test_evaluate.rb
|
253
349
|
- spec/unit/dialect/test_new.rb
|
254
350
|
- spec/unit/dialect/test_render.rb
|
255
351
|
- spec/unit/dialect/test_tag.rb
|
256
352
|
- spec/unit/dialect/test_tag_dispatching_name.rb
|
257
353
|
- spec/unit/dialect/test_with_scope.rb
|
354
|
+
- spec/unit/scope/sinatra_scope/test_fetch.rb
|
258
355
|
- spec/unit/scope/test_binding_scope.rb
|
259
356
|
- spec/unit/scope/test_chain.rb
|
260
357
|
- spec/unit/scope/test_coerce.rb
|
358
|
+
- spec/unit/scope/test_null_scope.rb
|
261
359
|
- spec/unit/scope/test_object_scope.rb
|
262
360
|
- spec/unit/scope/test_proc_scope.rb
|
263
|
-
- spec/unit/scope/
|
264
|
-
- spec/unit/scope/test_root_scope.rb
|
361
|
+
- spec/unit/scope/test_push.rb
|
265
362
|
- spec/unit/source/front_matter/test_locals.rb
|
266
363
|
- spec/unit/source/front_matter/test_template_content.rb
|
267
364
|
- spec/unit/source/test_locals.rb
|
@@ -269,6 +366,7 @@ files:
|
|
269
366
|
- spec/unit/source/test_template_content.rb
|
270
367
|
- spec/unit/source/test_with_front_matter.rb
|
271
368
|
- spec/unit/template/test_call.rb
|
369
|
+
- spec/unit/template/test_call_args_conventions.rb
|
272
370
|
- spec/unit/template/test_new.rb
|
273
371
|
- spec/unit/template/test_path.rb
|
274
372
|
- spec/unit/template/test_render.rb
|
@@ -297,22 +395,30 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
297
395
|
- - ! '>='
|
298
396
|
- !ruby/object:Gem::Version
|
299
397
|
version: '0'
|
398
|
+
segments:
|
399
|
+
- 0
|
400
|
+
hash: -1010122426012540526
|
300
401
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
402
|
none: false
|
302
403
|
requirements:
|
303
404
|
- - ! '>='
|
304
405
|
- !ruby/object:Gem::Version
|
305
406
|
version: '0'
|
407
|
+
segments:
|
408
|
+
- 0
|
409
|
+
hash: -1010122426012540526
|
306
410
|
requirements: []
|
307
411
|
rubyforge_project:
|
308
|
-
rubygems_version: 1.8.
|
412
|
+
rubygems_version: 1.8.24
|
309
413
|
signing_key:
|
310
414
|
specification_version: 3
|
311
415
|
summary: WLang is a powerful code generation and templating engine
|
312
416
|
test_files:
|
417
|
+
- spec/assumptions/test_core.rb
|
313
418
|
- spec/fixtures/dialect/foobar.rb
|
314
419
|
- spec/fixtures/dialect/upcasing.rb
|
315
420
|
- spec/fixtures/templates/hello.wlang
|
421
|
+
- spec/fixtures/templates/hello_from_sinatra.wlang
|
316
422
|
- spec/fixtures/templates/hello_with_data.wlang
|
317
423
|
- spec/fixtures/templates/hello_with_explicit_locals.wlang
|
318
424
|
- spec/fixtures/templates/hello_with_partials.wlang
|
@@ -332,6 +438,7 @@ test_files:
|
|
332
438
|
- spec/integration/html/test_sharp.rb
|
333
439
|
- spec/integration/html/test_slash.rb
|
334
440
|
- spec/integration/html/test_star.rb
|
441
|
+
- spec/integration/sinatra/test_partials.rb
|
335
442
|
- spec/integration/test_dummy.rb
|
336
443
|
- spec/integration/test_examples.rb
|
337
444
|
- spec/integration/test_readme.rb
|
@@ -351,19 +458,21 @@ test_files:
|
|
351
458
|
- spec/unit/compiler/test_to_ruby_code.rb
|
352
459
|
- spec/unit/compiler/test_to_ruby_proc.rb
|
353
460
|
- spec/unit/dialect/test_compile.rb
|
461
|
+
- spec/unit/dialect/test_context.rb
|
354
462
|
- spec/unit/dialect/test_evaluate.rb
|
355
463
|
- spec/unit/dialect/test_new.rb
|
356
464
|
- spec/unit/dialect/test_render.rb
|
357
465
|
- spec/unit/dialect/test_tag.rb
|
358
466
|
- spec/unit/dialect/test_tag_dispatching_name.rb
|
359
467
|
- spec/unit/dialect/test_with_scope.rb
|
468
|
+
- spec/unit/scope/sinatra_scope/test_fetch.rb
|
360
469
|
- spec/unit/scope/test_binding_scope.rb
|
361
470
|
- spec/unit/scope/test_chain.rb
|
362
471
|
- spec/unit/scope/test_coerce.rb
|
472
|
+
- spec/unit/scope/test_null_scope.rb
|
363
473
|
- spec/unit/scope/test_object_scope.rb
|
364
474
|
- spec/unit/scope/test_proc_scope.rb
|
365
|
-
- spec/unit/scope/
|
366
|
-
- spec/unit/scope/test_root_scope.rb
|
475
|
+
- spec/unit/scope/test_push.rb
|
367
476
|
- spec/unit/source/front_matter/test_locals.rb
|
368
477
|
- spec/unit/source/front_matter/test_template_content.rb
|
369
478
|
- spec/unit/source/test_locals.rb
|
@@ -371,6 +480,7 @@ test_files:
|
|
371
480
|
- spec/unit/source/test_template_content.rb
|
372
481
|
- spec/unit/source/test_with_front_matter.rb
|
373
482
|
- spec/unit/template/test_call.rb
|
483
|
+
- spec/unit/template/test_call_args_conventions.rb
|
374
484
|
- spec/unit/template/test_new.rb
|
375
485
|
- spec/unit/template/test_path.rb
|
376
486
|
- spec/unit/template/test_render.rb
|