zorglub 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +49 -34
- data/lib/zorglub.rb +4 -4
- data/lib/zorglub/app.rb +27 -31
- data/lib/zorglub/engines/file.rb +3 -3
- data/lib/zorglub/engines/haml.rb +3 -3
- data/lib/zorglub/engines/sass.rb +3 -3
- data/lib/zorglub/node.rb +75 -77
- data/lib/zorglub/rack_session.rb +1 -5
- data/lib/zorglub/session.rb +27 -31
- data/spec/app_spec.rb +21 -21
- data/spec/node_spec.rb +162 -154
- data/spec/spec_helper.rb +30 -25
- data/zorglub.gemspec +4 -4
- metadata +3 -4
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'coveralls'
|
5
|
-
Coveralls.wear!
|
6
|
-
#
|
7
|
-
rescue LoadError
|
8
|
-
end
|
2
|
+
|
9
3
|
begin
|
10
4
|
require 'simplecov'
|
11
5
|
SimpleCov.start do
|
@@ -13,14 +7,23 @@ begin
|
|
13
7
|
end
|
14
8
|
rescue LoadError
|
15
9
|
end
|
16
|
-
|
10
|
+
|
11
|
+
begin
|
12
|
+
require 'coveralls'
|
13
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
|
14
|
+
SimpleCov::Formatter::HTMLFormatter,
|
15
|
+
Coveralls::SimpleCov::Formatter
|
16
|
+
]
|
17
|
+
rescue LoadError
|
18
|
+
end
|
19
|
+
|
17
20
|
require 'yaml'
|
18
|
-
|
21
|
+
|
19
22
|
require 'zorglub'
|
20
23
|
require 'zorglub/engines/file'
|
21
24
|
require 'zorglub/engines/haml'
|
22
25
|
require 'zorglub/engines/sass'
|
23
|
-
|
26
|
+
|
24
27
|
HASH_PROC = Proc.new { |path,obj| {:path=>path,:layout=>obj.layout,:view=>obj.view,:args=>obj.args,:map=>obj.map}.to_yaml }
|
25
28
|
STATIC_PROC = Proc.new { |path,obj| ["VAL #{obj.value}",'text/static'] }
|
26
29
|
RENDER_PROC = Proc.new { |path,obj|
|
@@ -36,16 +39,19 @@ RENDER_PROC = Proc.new { |path,obj|
|
|
36
39
|
end
|
37
40
|
}
|
38
41
|
APP_ROOT = File.join Dir.pwd, 'spec', 'data'
|
39
|
-
|
42
|
+
|
40
43
|
class Zorglub::Node
|
41
44
|
def self.my_call uri
|
42
45
|
call( {'PATH_INFO'=>uri} )
|
43
46
|
end
|
47
|
+
def self.my_call_i uri
|
48
|
+
call( {'PATH_INFO'=>uri} ).body[0].to_i
|
49
|
+
end
|
44
50
|
end
|
45
|
-
|
51
|
+
|
46
52
|
class Temp < Zorglub::Node
|
47
53
|
end
|
48
|
-
|
54
|
+
|
49
55
|
class Node0 < Zorglub::Node
|
50
56
|
# default
|
51
57
|
def index
|
@@ -101,7 +107,7 @@ class Node0 < Zorglub::Node
|
|
101
107
|
end
|
102
108
|
end
|
103
109
|
end
|
104
|
-
|
110
|
+
|
105
111
|
class Node1 < Zorglub::Node
|
106
112
|
layout! 'layout-1'
|
107
113
|
engine! 'engine-1'
|
@@ -110,11 +116,11 @@ class Node1 < Zorglub::Node
|
|
110
116
|
engine! 'engine-2'
|
111
117
|
end
|
112
118
|
end
|
113
|
-
|
119
|
+
|
114
120
|
class Node2 < Node1
|
115
121
|
# inherited from Node1
|
116
122
|
end
|
117
|
-
|
123
|
+
|
118
124
|
class Node3 < Zorglub::Node
|
119
125
|
@before=0
|
120
126
|
@after=0
|
@@ -131,17 +137,17 @@ class Node3 < Zorglub::Node
|
|
131
137
|
layout! 'layout-2'
|
132
138
|
engine! 'engine-2'
|
133
139
|
def index
|
134
|
-
|
140
|
+
Node3.before-Node3.after
|
135
141
|
end
|
136
142
|
def do_partial a1, a2
|
137
143
|
view! Node0.r('do_partial')
|
138
144
|
engine! 'real'
|
139
145
|
end
|
140
146
|
end
|
141
|
-
|
147
|
+
|
142
148
|
class Node8 < Node3
|
143
149
|
end
|
144
|
-
|
150
|
+
|
145
151
|
class Node4 < Zorglub::Node
|
146
152
|
no_layout!
|
147
153
|
cli_val :js,'js0'
|
@@ -154,7 +160,7 @@ class Node4 < Zorglub::Node
|
|
154
160
|
cli_val(:js).to_yaml
|
155
161
|
end
|
156
162
|
end
|
157
|
-
|
163
|
+
|
158
164
|
class Node5 < Node4
|
159
165
|
cli_val :js, 'js3'
|
160
166
|
cli_val :css, 'css0', 'css1'
|
@@ -166,7 +172,7 @@ class Node5 < Node4
|
|
166
172
|
js.concat(css).to_yaml
|
167
173
|
end
|
168
174
|
end
|
169
|
-
|
175
|
+
|
170
176
|
class Node6 < Zorglub::Node
|
171
177
|
@static_cpt=0
|
172
178
|
class << self
|
@@ -188,7 +194,7 @@ class Node6 < Zorglub::Node
|
|
188
194
|
@value = Node6.static_cpt
|
189
195
|
end
|
190
196
|
end
|
191
|
-
|
197
|
+
|
192
198
|
class Node7 < Zorglub::Node
|
193
199
|
layout_base_path! File.join APP_ROOT, 'alt','layout'
|
194
200
|
view_base_path! File.join APP_ROOT, 'alt'
|
@@ -196,7 +202,7 @@ class Node7 < Zorglub::Node
|
|
196
202
|
view! 'do_render'
|
197
203
|
end
|
198
204
|
end
|
199
|
-
|
205
|
+
|
200
206
|
APP = Zorglub::App.new do
|
201
207
|
register_engine! :file, nil, Zorglub::Engines::File.method(:proc)
|
202
208
|
register_engine! :haml, 'haml', Zorglub::Engines::Haml.method(:proc)
|
@@ -217,8 +223,7 @@ APP = Zorglub::App.new do
|
|
217
223
|
map '/node7', Node7
|
218
224
|
map '/node8', Node8
|
219
225
|
end
|
220
|
-
|
226
|
+
|
221
227
|
class Node2
|
222
228
|
map APP, '/node2'
|
223
229
|
end
|
224
|
-
#
|
data/zorglub.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
# -*- coding: UTF-8 -*-
|
3
|
-
|
3
|
+
|
4
4
|
$:.push File.expand_path("../lib", __FILE__)
|
5
|
-
|
5
|
+
|
6
6
|
begin
|
7
7
|
require 'zorglub'
|
8
8
|
rescue LoadError
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
Gem::Specification.new do |s|
|
12
12
|
s.name = "zorglub"
|
13
13
|
s.version = Zorglub::VERSION
|
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
23
|
s.require_paths = ["lib"]
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
# EOF
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zorglub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérémy Zurcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This is a very stripped down version of innate.
|
14
14
|
email:
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.7.7
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: a nano web application framework based on rack
|
@@ -93,4 +93,3 @@ test_files:
|
|
93
93
|
- spec/data/view/node0/xml_file.xml
|
94
94
|
- spec/node_spec.rb
|
95
95
|
- spec/spec_helper.rb
|
96
|
-
has_rdoc:
|