wabur 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/wabur +42 -17
- data/export/assets/css/wab.css +365 -1
- data/export/assets/css/wab.css.map +1 -1
- data/lib/wab/controller.rb +14 -10
- data/lib/wab/impl.rb +13 -0
- data/lib/wab/impl/bool_expr.rb +3 -0
- data/lib/wab/impl/configuration.rb +59 -43
- data/lib/wab/impl/data.rb +4 -4
- data/lib/wab/impl/exprs/and.rb +6 -5
- data/lib/wab/impl/exprs/between.rb +2 -2
- data/lib/wab/impl/exprs/eq.rb +2 -2
- data/lib/wab/impl/exprs/gt.rb +2 -2
- data/lib/wab/impl/exprs/gte.rb +2 -2
- data/lib/wab/impl/exprs/has.rb +2 -2
- data/lib/wab/impl/exprs/in.rb +2 -2
- data/lib/wab/impl/exprs/lt.rb +2 -2
- data/lib/wab/impl/exprs/lte.rb +2 -2
- data/lib/wab/impl/exprs/or.rb +6 -5
- data/lib/wab/impl/exprs/regex.rb +2 -2
- data/lib/wab/impl/handler.rb +10 -7
- data/lib/wab/impl/init.rb +135 -73
- data/lib/wab/impl/path_expr.rb +3 -0
- data/lib/wab/impl/shell.rb +10 -3
- data/lib/wab/impl/templates/wabur.conf.template +1 -2
- data/lib/wab/io/engine.rb +2 -2
- data/lib/wab/io/shell.rb +9 -3
- data/lib/wab/ui/flow.rb +3 -2
- data/lib/wab/version.rb +1 -1
- data/test/bench_io_shell.rb +2 -2
- data/test/test_io_shell.rb +2 -2
- data/test/tmp/lib/spawn.rb +44 -0
- data/test/tmp/lib/ui_controller.rb +20 -0
- metadata +6 -2
data/test/test_io_shell.rb
CHANGED
@@ -155,7 +155,7 @@ class TestIoShell < Minitest::Test
|
|
155
155
|
# desired.
|
156
156
|
script.each { |pair|
|
157
157
|
unless pair[0].nil?
|
158
|
-
to_w.puts(WAB::Impl::Data.new(pair[0]
|
158
|
+
to_w.puts(WAB::Impl::Data.new(pair[0]).json)
|
159
159
|
to_w.flush
|
160
160
|
end
|
161
161
|
|
@@ -179,7 +179,7 @@ class TestIoShell < Minitest::Test
|
|
179
179
|
# fail. Thats okay as the write is only to tell the child to shutdown
|
180
180
|
# and it already has.
|
181
181
|
begin
|
182
|
-
to_w.puts(WAB::Impl::Data.new({ api: -2 }
|
182
|
+
to_w.puts(WAB::Impl::Data.new({ api: -2 }).json)
|
183
183
|
to_w.flush
|
184
184
|
rescue Exception
|
185
185
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
$VERBOSE = true
|
5
|
+
|
6
|
+
$: << __dir__
|
7
|
+
while (index = ARGV.index('-I'))
|
8
|
+
_, path = ARGV.slice!(index, 2)
|
9
|
+
$: << path
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'optparse'
|
13
|
+
require 'wab'
|
14
|
+
require 'wab/io'
|
15
|
+
|
16
|
+
# This app is expected to be spawned from a WAB runner. This demonstrates one
|
17
|
+
# possible mode for running WAB applications. It is the least performant of
|
18
|
+
# the WAB run options.
|
19
|
+
|
20
|
+
$verbose = false
|
21
|
+
$thread_count = 1
|
22
|
+
$opts = OptionParser.new("Usage: sample [options]
|
23
|
+
|
24
|
+
Acts as a remote Controller in a WAB deployment. Input is from stdin and output
|
25
|
+
is on stdout. If verbosity is turned on it is sent to stderr.
|
26
|
+
")
|
27
|
+
$opts.on('-v', 'verbose output on stderr') { $verbose = true }
|
28
|
+
$opts.on('-t', '--thread-count Integer', Integer, 'thread count') { |t| $thread_count = t }
|
29
|
+
$opts.on('-h', '--help', 'show this page') { $stderr.puts $opts.help; Process.exit!(0) }
|
30
|
+
|
31
|
+
$opts.parse(ARGV)
|
32
|
+
|
33
|
+
shell = WAB::IO::Shell.new($thread_count, 'kind', 1)
|
34
|
+
shell.logger.level = Logger::INFO if $verbose
|
35
|
+
|
36
|
+
shell.register_controller('ui', UIController.new(shell))
|
37
|
+
shell.register_controller('Entry', WAB::OpenController.new(shell))
|
38
|
+
shell.register_controller('Article', WAB::OpenController.new(shell))
|
39
|
+
|
40
|
+
begin
|
41
|
+
shell.start
|
42
|
+
rescue Interrupt
|
43
|
+
# ignore
|
44
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'wab/ui'
|
4
|
+
|
5
|
+
class UIController < WAB::UI::MultiFlow
|
6
|
+
|
7
|
+
def initialize(shell)
|
8
|
+
super
|
9
|
+
|
10
|
+
add_flow(WAB::UI::RestFlow.new(shell,
|
11
|
+
{
|
12
|
+
kind: 'Entry',
|
13
|
+
}, ['$ref']))
|
14
|
+
add_flow(WAB::UI::RestFlow.new(shell,
|
15
|
+
{
|
16
|
+
kind: 'Article',
|
17
|
+
}, ['$ref']))
|
18
|
+
end
|
19
|
+
|
20
|
+
end # UIController
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wabur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -241,6 +241,8 @@ files:
|
|
241
241
|
- test/test_model.rb
|
242
242
|
- test/test_runner.rb
|
243
243
|
- test/tests.rb
|
244
|
+
- test/tmp/lib/spawn.rb
|
245
|
+
- test/tmp/lib/ui_controller.rb
|
244
246
|
homepage: http://github.com/ohler55/wabur
|
245
247
|
licenses:
|
246
248
|
- MIT
|
@@ -295,3 +297,5 @@ test_files:
|
|
295
297
|
- test/test_model.rb
|
296
298
|
- test/test_runner.rb
|
297
299
|
- test/tests.rb
|
300
|
+
- test/tmp/lib/spawn.rb
|
301
|
+
- test/tmp/lib/ui_controller.rb
|