vedeu 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/.travis.yml +2 -1
- data/Guardfile +6 -5
- data/README.md +3 -30
- data/Rakefile +5 -5
- data/bin/vedeu_drb_client +1 -1
- data/bin/vedeu_drb_server +91 -89
- data/bin/vedeu_test +4 -0
- data/config/rubocop_enabled.yml +5 -10
- data/examples/borders_app.rb +2 -1
- data/examples/colours_app.rb +13 -8
- data/examples/configuration_app.rb +3 -2
- data/examples/cursor_app.rb +16 -11
- data/examples/drb_app.rb +88 -89
- data/examples/focus_app.rb +31 -32
- data/examples/geometry_app.rb +2 -1
- data/examples/hello_world.rb +2 -1
- data/examples/lines_app.rb +2 -1
- data/examples/material_colours_app.rb +126 -0
- data/examples/typed_commands/typed_commands_app.rb +5 -1
- data/examples/view_templates_app/view_templates_app.rb +6 -3
- data/lib/vedeu/all.rb +1 -1
- data/lib/vedeu/api.rb +18 -10
- data/lib/vedeu/application.rb +0 -1
- data/lib/vedeu/bindings.rb +77 -16
- data/lib/vedeu/buffers/all.rb +2 -5
- data/lib/vedeu/buffers/buffer.rb +69 -25
- data/lib/vedeu/buffers/display_buffer.rb +3 -7
- data/lib/vedeu/configuration/all.rb +3 -6
- data/lib/vedeu/configuration/api.rb +28 -4
- data/lib/vedeu/configuration/cli.rb +9 -9
- data/lib/vedeu/configuration/configuration.rb +11 -7
- data/lib/vedeu/cursor/all.rb +3 -6
- data/lib/vedeu/cursor/cursor.rb +22 -14
- data/lib/vedeu/cursor/move.rb +32 -22
- data/lib/vedeu/cursor/refresh_cursor.rb +1 -1
- data/lib/vedeu/debug.rb +2 -1
- data/lib/vedeu/distributed/client.rb +1 -7
- data/lib/vedeu/distributed/server.rb +0 -4
- data/lib/vedeu/distributed/subprocess.rb +1 -1
- data/lib/vedeu/distributed/templates/default_configuration.vedeu +1 -1
- data/lib/vedeu/distributed/test_application.rb +3 -5
- data/lib/vedeu/distributed/uri.rb +2 -2
- data/lib/vedeu/dsl/all.rb +6 -6
- data/lib/vedeu/dsl/components/all.rb +0 -3
- data/lib/vedeu/dsl/components/border.rb +20 -12
- data/lib/vedeu/dsl/components/geometry.rb +68 -3
- data/lib/vedeu/dsl/components/keymap.rb +1 -2
- data/lib/vedeu/dsl/composition.rb +8 -1
- data/lib/vedeu/dsl/interface.rb +61 -11
- data/lib/vedeu/dsl/line.rb +12 -12
- data/lib/vedeu/dsl/shared/all.rb +4 -7
- data/lib/vedeu/dsl/shared/colour.rb +2 -2
- data/lib/vedeu/dsl/shared/text.rb +2 -35
- data/lib/vedeu/dsl/shared/use.rb +2 -2
- data/lib/vedeu/dsl/view.rb +4 -4
- data/lib/vedeu/events/all.rb +3 -5
- data/lib/vedeu/events/event.rb +5 -5
- data/lib/vedeu/geometry/all.rb +11 -16
- data/lib/vedeu/geometry/area.rb +2 -5
- data/lib/vedeu/geometry/canvas.rb +12 -16
- data/lib/vedeu/geometry/dimension.rb +20 -22
- data/lib/vedeu/geometry/geometry.rb +28 -30
- data/lib/vedeu/geometry/grid.rb +1 -1
- data/lib/vedeu/geometry/index_position.rb +7 -0
- data/lib/vedeu/geometry/null_geometry.rb +61 -0
- data/lib/vedeu/geometry/position.rb +0 -3
- data/lib/vedeu/geometry/position_index.rb +7 -0
- data/lib/vedeu/geometry/position_validator.rb +44 -33
- data/lib/vedeu/input/all.rb +5 -4
- data/lib/vedeu/input/keymap.rb +0 -1
- data/lib/vedeu/input/mapper.rb +1 -3
- data/lib/vedeu/launcher.rb +6 -7
- data/lib/vedeu/main_loop.rb +1 -2
- data/lib/vedeu/models/all.rb +1 -0
- data/lib/vedeu/models/cell.rb +5 -8
- data/lib/vedeu/models/char.rb +50 -15
- data/lib/vedeu/models/composition.rb +8 -1
- data/lib/vedeu/models/focus.rb +4 -4
- data/lib/vedeu/models/group.rb +3 -3
- data/lib/vedeu/models/interface.rb +62 -46
- data/lib/vedeu/models/line.rb +1 -1
- data/lib/vedeu/models/null.rb +48 -0
- data/lib/vedeu/models/stream.rb +5 -5
- data/lib/vedeu/output/all.rb +20 -30
- data/lib/vedeu/output/border.rb +93 -40
- data/lib/vedeu/output/clear.rb +100 -15
- data/lib/vedeu/output/colour.rb +56 -12
- data/lib/vedeu/output/compressor.rb +59 -0
- data/lib/vedeu/output/html_char.rb +4 -2
- data/lib/vedeu/output/null_border.rb +16 -4
- data/lib/vedeu/output/output.rb +13 -21
- data/lib/vedeu/output/presentation.rb +28 -23
- data/lib/vedeu/output/refresh.rb +2 -2
- data/lib/vedeu/output/renderers/all.rb +80 -3
- data/lib/vedeu/output/renderers/file_renderer.rb +38 -2
- data/lib/vedeu/output/renderers/html_renderer.rb +6 -4
- data/lib/vedeu/output/renderers/json_renderer.rb +52 -0
- data/lib/vedeu/output/renderers/null_renderer.rb +14 -0
- data/lib/vedeu/output/renderers/terminal_renderer.rb +2 -12
- data/lib/vedeu/output/style.rb +33 -3
- data/lib/vedeu/output/text.rb +98 -1
- data/lib/vedeu/output/translator.rb +30 -7
- data/lib/vedeu/output/viewport.rb +43 -79
- data/lib/vedeu/output/wordwrap.rb +4 -4
- data/lib/vedeu/repositories/all.rb +22 -179
- data/lib/vedeu/repositories/collection.rb +11 -13
- data/lib/vedeu/repositories/collections/all.rb +8 -0
- data/lib/vedeu/repositories/collections/chars.rb +9 -0
- data/lib/vedeu/repositories/collections/events.rb +9 -0
- data/lib/vedeu/repositories/collections/interfaces.rb +9 -0
- data/lib/vedeu/repositories/collections/keys.rb +9 -0
- data/lib/vedeu/repositories/collections/lines.rb +9 -0
- data/lib/vedeu/repositories/collections/streams.rb +9 -0
- data/lib/vedeu/repositories/model.rb +7 -2
- data/lib/vedeu/repositories/repositories/all.rb +14 -0
- data/lib/vedeu/repositories/repositories/background_colours.rb +14 -0
- data/lib/vedeu/repositories/repositories/borders.rb +38 -0
- data/lib/vedeu/repositories/repositories/buffers.rb +36 -0
- data/lib/vedeu/repositories/repositories/colours.rb +63 -0
- data/lib/vedeu/repositories/repositories/cursors.rb +29 -0
- data/lib/vedeu/repositories/repositories/events_repository.rb +24 -0
- data/lib/vedeu/repositories/repositories/foreground_colours.rb +14 -0
- data/lib/vedeu/repositories/repositories/geometries.rb +37 -0
- data/lib/vedeu/repositories/repositories/groups.rb +24 -0
- data/lib/vedeu/repositories/repositories/interfaces_repository.rb +24 -0
- data/lib/vedeu/repositories/repositories/keymaps.rb +24 -0
- data/lib/vedeu/repositories/repositories/menus.rb +24 -0
- data/lib/vedeu/repositories/repository.rb +29 -47
- data/lib/vedeu/storage/all.rb +6 -0
- data/lib/vedeu/storage/associative_store.rb +47 -0
- data/lib/vedeu/storage/conveyor_store.rb +69 -0
- data/lib/vedeu/storage/fifo_store.rb +37 -0
- data/lib/vedeu/storage/store.rb +58 -0
- data/lib/vedeu/support/all.rb +5 -10
- data/lib/vedeu/support/common.rb +0 -8
- data/lib/vedeu/support/log.rb +13 -24
- data/lib/vedeu/support/template.rb +4 -1
- data/lib/vedeu/support/terminal.rb +10 -10
- data/lib/vedeu/support/trace.rb +15 -88
- data/lib/vedeu/support/visibility.rb +73 -0
- data/lib/vedeu.rb +37 -0
- data/test/lib/vedeu/api_test.rb +7 -3
- data/test/lib/vedeu/application_test.rb +9 -3
- data/test/lib/vedeu/bindings_test.rb +21 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +110 -134
- data/test/lib/vedeu/buffers/display_buffer_test.rb +8 -0
- data/test/lib/vedeu/configuration/api_test.rb +5 -1
- data/test/lib/vedeu/configuration/configuration_test.rb +4 -6
- data/test/lib/vedeu/cursor/cursor_test.rb +25 -17
- data/test/lib/vedeu/cursor/move_test.rb +7 -7
- data/test/lib/vedeu/distributed/client_test.rb +1 -1
- data/test/lib/vedeu/distributed/subprocess_test.rb +3 -1
- data/test/lib/vedeu/distributed/uri_test.rb +5 -5
- data/test/lib/vedeu/dsl/components/geometry_test.rb +43 -0
- data/test/lib/vedeu/dsl/components/keymap_test.rb +1 -1
- data/test/lib/vedeu/dsl/composition_test.rb +6 -5
- data/test/lib/vedeu/dsl/interface_test.rb +81 -16
- data/test/lib/vedeu/dsl/shared/colour_test.rb +4 -4
- data/test/lib/vedeu/dsl/shared/text_test.rb +87 -9
- data/test/lib/vedeu/dsl/stream_test.rb +1 -1
- data/test/lib/vedeu/events/event_test.rb +3 -1
- data/test/lib/vedeu/events/trigger_test.rb +8 -4
- data/test/lib/vedeu/geometry/dimension_test.rb +1 -1
- data/test/lib/vedeu/geometry/geometry_test.rb +5 -3
- data/test/lib/vedeu/geometry/index_position_test.rb +30 -7
- data/test/lib/vedeu/geometry/null_geometry_test.rb +57 -0
- data/test/lib/vedeu/geometry/position_index_test.rb +14 -0
- data/test/lib/vedeu/geometry/position_validator_test.rb +17 -3
- data/test/lib/vedeu/input/keymap_test.rb +3 -1
- data/test/lib/vedeu/input/mapper_test.rb +8 -4
- data/test/lib/vedeu/launcher_test.rb +1 -1
- data/test/lib/vedeu/models/cell_test.rb +10 -8
- data/test/lib/vedeu/models/char_test.rb +52 -28
- data/test/lib/vedeu/models/composition_test.rb +26 -4
- data/test/lib/vedeu/models/group_test.rb +11 -5
- data/test/lib/vedeu/models/interface_test.rb +32 -19
- data/test/lib/vedeu/models/line_test.rb +21 -25
- data/test/lib/vedeu/models/menu_test.rb +10 -6
- data/test/lib/vedeu/models/null_test.rb +66 -0
- data/test/lib/vedeu/models/stream_test.rb +13 -10
- data/test/lib/vedeu/output/border_test.rb +29 -8
- data/test/lib/vedeu/output/clear_test.rb +23 -4
- data/test/lib/vedeu/output/colour_test.rb +20 -4
- data/test/lib/vedeu/output/compressor_test.rb +43 -0
- data/test/lib/vedeu/output/html_char_test.rb +29 -17
- data/test/lib/vedeu/output/null_border_test.rb +2 -1
- data/test/lib/vedeu/output/output_test.rb +20 -30
- data/test/lib/vedeu/output/presentation_test.rb +39 -16
- data/test/lib/vedeu/output/refresh_test.rb +14 -10
- data/test/lib/vedeu/output/renderers/all_test.rb +96 -0
- data/test/lib/vedeu/output/renderers/file_renderer_test.rb +1 -1
- data/test/lib/vedeu/output/renderers/html_renderer_test.rb +13 -9
- data/test/lib/vedeu/output/renderers/json_renderer_test.rb +52 -0
- data/test/lib/vedeu/output/renderers/null_renderer_test.rb +19 -0
- data/test/lib/vedeu/output/style_test.rb +41 -1
- data/test/lib/vedeu/output/text_test.rb +61 -10
- data/test/lib/vedeu/output/translator_test.rb +14 -0
- data/test/lib/vedeu/output/viewport_test.rb +22 -3
- data/test/lib/vedeu/output/virtual_terminal_test.rb +3 -3
- data/test/lib/vedeu/output/wordwrap_test.rb +58 -45
- data/test/lib/vedeu/repositories/collections/chars_test.rb +16 -0
- data/test/lib/vedeu/repositories/collections/events_test.rb +16 -0
- data/test/lib/vedeu/repositories/collections/interfaces_test.rb +16 -0
- data/test/lib/vedeu/repositories/collections/keys_test.rb +16 -0
- data/test/lib/vedeu/repositories/collections/lines_test.rb +16 -0
- data/test/lib/vedeu/repositories/collections/streams_test.rb +16 -0
- data/test/lib/vedeu/repositories/repositories/background_colours_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/borders_test.rb +51 -0
- data/test/lib/vedeu/repositories/repositories/buffers_test.rb +52 -0
- data/test/lib/vedeu/repositories/repositories/colours_test.rb +16 -0
- data/test/lib/vedeu/repositories/repositories/cursors_test.rb +39 -0
- data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/foreground_colours_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/geometries_test.rb +42 -0
- data/test/lib/vedeu/repositories/repositories/groups_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +17 -0
- data/test/lib/vedeu/repositories/repositories/menus_test.rb +17 -0
- data/test/lib/vedeu/repositories/repository_test.rb +16 -36
- data/test/lib/vedeu/storage/associative_store_test.rb +69 -0
- data/test/lib/vedeu/storage/conveyor_store_test.rb +135 -0
- data/test/lib/vedeu/storage/fifo_store_test.rb +47 -0
- data/test/lib/vedeu/storage/store_test.rb +123 -0
- data/test/lib/vedeu/support/common_test.rb +0 -9
- data/test/lib/vedeu/support/terminal_test.rb +78 -55
- data/test/lib/vedeu/support/visibility_test.rb +80 -0
- data/test/test_helper.rb +13 -11
- data/vedeu.gemspec +4 -3
- metadata +92 -32
- data/lib/vedeu/cursor/toggle.rb +0 -55
- data/lib/vedeu/exceptions.rb +0 -37
- data/lib/vedeu/geometry/centre.rb +0 -85
- data/lib/vedeu/geometry/content.rb +0 -70
- data/lib/vedeu/geometry/limit.rb +0 -58
- data/lib/vedeu/output/compositor.rb +0 -62
- data/lib/vedeu/repositories/collections.rb +0 -41
- data/lib/vedeu/support/coercions.rb +0 -60
- data/lib/vedeu/support/sentence.rb +0 -91
- data/lib/vedeu/support/visible.rb +0 -90
- data/test/lib/vedeu/cursor/toggle_test.rb +0 -63
- data/test/lib/vedeu/geometry/centre_test.rb +0 -58
- data/test/lib/vedeu/geometry/content_test.rb +0 -98
- data/test/lib/vedeu/geometry/limit_test.rb +0 -30
- data/test/lib/vedeu/output/compositor_test.rb +0 -48
- data/test/lib/vedeu/repositories/all_test.rb +0 -135
- data/test/lib/vedeu/repositories/collections_test.rb +0 -71
- data/test/lib/vedeu/support/coercions_test.rb +0 -84
- data/test/lib/vedeu/support/sentence_test.rb +0 -56
- data/test/lib/vedeu/support/visible_test.rb +0 -161
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c54da4b2eda5de86cde144c882a63a2699475f
|
4
|
+
data.tar.gz: d3477590f4f488e40117aa284a57702e039df523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5868261a9d78a1fee37410fdc2eda682a90c4f631384fff07be495f83993869b5e6be62b246656c9ef6b6ea97389646d190295095c993c39f3fde1071322e5c
|
7
|
+
data.tar.gz: 7faf1541d7b987ace4a81d94714be0c5bec7a97e750e7dac8bf8cb0c8016fccc6a3e3ac99dd9a7df357629e659069473c6c463ef07e0e8a6a53762242b5b1a6c
|
data/.rubocop.yml
CHANGED
@@ -25,6 +25,7 @@ AllCops:
|
|
25
25
|
- '**/Cheffile'
|
26
26
|
- '**/Vagabondfile'
|
27
27
|
Exclude:
|
28
|
+
- 'test/**/*'
|
28
29
|
- 'vendor/**/*'
|
29
30
|
# By default, the rails cops are not run. Override in project or home
|
30
31
|
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
@@ -642,7 +643,7 @@ Metrics/LineLength:
|
|
642
643
|
|
643
644
|
Metrics/MethodLength:
|
644
645
|
CountComments: false # count full line comments?
|
645
|
-
Max:
|
646
|
+
Max: 70
|
646
647
|
|
647
648
|
Metrics/ParameterLists:
|
648
649
|
Max: 5
|
data/.travis.yml
CHANGED
data/Guardfile
CHANGED
@@ -6,12 +6,13 @@
|
|
6
6
|
# end
|
7
7
|
# end
|
8
8
|
|
9
|
-
guard :minitest, all_after_pass: true,
|
9
|
+
guard :minitest, all_after_pass: true,
|
10
|
+
focus_on_failed: true,
|
11
|
+
env: { 'no_simplecov' => true } do
|
10
12
|
watch(%r{^test/(.*)_test\.rb})
|
11
|
-
watch(%r{^lib/(.+)\.rb})
|
12
|
-
|
13
|
-
|
14
|
-
watch(%r{^test/test_helper\.rb}) { 'test' }
|
13
|
+
watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
|
14
|
+
watch(%r{^test/test_helper\.rb}) { 'test' }
|
15
|
+
watch(%r{^lib/(.+)all\.rb}) { 'test' }
|
15
16
|
end
|
16
17
|
|
17
18
|
guard :bundler do
|
data/README.md
CHANGED
@@ -9,7 +9,8 @@ Vedeu (vee-dee-you; aka VDU) is my attempt at creating a terminal based applicat
|
|
9
9
|
|
10
10
|
## Requirements
|
11
11
|
|
12
|
-
Vedeu has been built on MacOSX 10.9/10.10 (Mavericks/Yosemite) with
|
12
|
+
Vedeu has been built primarily on MacOSX 10.9/10.10 (Mavericks/Yosemite) with
|
13
|
+
Ruby v2.1.
|
13
14
|
|
14
15
|
Note: You may have trouble running Vedeu with Windows installations. (Pull requests welcome!)
|
15
16
|
|
@@ -107,7 +108,7 @@ Referring to the above example, interfaces have a name, and various default attr
|
|
107
108
|
|
108
109
|
Note: not setting a width or height will set the values to the terminal's reported width and height.
|
109
110
|
|
110
|
-
- `foreground` sets the default foreground colour.
|
111
|
+
- `foreground` sets the default foreground colour.
|
111
112
|
- `background` sets the default background colour.
|
112
113
|
|
113
114
|
|
@@ -121,34 +122,6 @@ More information about events can be found in the [RubyDoc](http://rubydoc.info/
|
|
121
122
|
Geometry for Vedeu, as the same for ANSI terminals, is set top-left, which is cell/point 1, 1. Interfaces themselves have internal geometry which is handled automatically. Unless you are doing something special, you will probably only set it on a per-interface basis.
|
122
123
|
|
123
124
|
|
124
|
-
### Colours
|
125
|
-
|
126
|
-
Vedeu uses HTML/CSS style notation (i.e. '#aadd00'), they can be used at the stream level, the line level or for the whole interface. Terminals generally support either 8, 16 or 256 colours, with few supporting full 24-bit colour. Vedeu attempts to detect the colour depth using the `$TERM` environment variable.
|
127
|
-
|
128
|
-
To set your `$TERM` variable to allow 256 colour support:
|
129
|
-
|
130
|
-
```bash
|
131
|
-
echo "export TERM=xterm-256color" >> ~/.bashrc
|
132
|
-
```
|
133
|
-
|
134
|
-
or, if you wish not to tamper with `$TERM`:
|
135
|
-
|
136
|
-
```bash
|
137
|
-
echo "export VEDEU_TERM=xterm-256color" >> ~/.bashrc
|
138
|
-
```
|
139
|
-
|
140
|
-
If you know your terminal supports full 24-bit colour, set the `$VEDEU_TERM` environment variable:
|
141
|
-
|
142
|
-
```bash
|
143
|
-
echo "export VEDEU_TERM=xterm-truecolor" >> ~/.bashrc
|
144
|
-
```
|
145
|
-
|
146
|
-
|
147
|
-
### Styles
|
148
|
-
|
149
|
-
Vedeu has a range of symbol styles which are compatible with most terminals which are ANSI compatible. Like colours, they can be defined in either interfaces, for specific lines or within streams. Styles are applied as encountered.
|
150
|
-
|
151
|
-
|
152
125
|
## Debugging & Environment Variables
|
153
126
|
|
154
127
|
Vedeu has two types of debugging; `VEDEU_DEBUG` and `VEDEU_TRACE`. Both of these can be configured at run-time using the arguments you pass to your application. They can also be enabled/disabled globally by setting environment variables (see below). These messages are written to `~/.vedeu/vedeu.log`.
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'yard'
|
|
7
7
|
require 'rubocop/rake_task'
|
8
8
|
|
9
9
|
Cucumber::Rake::Task.new(:cucumber) do |t|
|
10
|
-
t.cucumber_opts =
|
10
|
+
t.cucumber_opts = 'features --format progress'
|
11
11
|
end
|
12
12
|
|
13
13
|
Rake::TestTask.new(:test) do |t|
|
@@ -23,13 +23,13 @@ YARD::Rake::YardocTask.new(:yard) do |t|
|
|
23
23
|
'-',
|
24
24
|
'docs/api.md',
|
25
25
|
'docs/getting_started.md',
|
26
|
-
'docs/views.md'
|
26
|
+
'docs/views.md',
|
27
27
|
]
|
28
28
|
end
|
29
29
|
|
30
30
|
Inch::Rake::Suggest.new(:inch) do |suggest|
|
31
|
-
suggest.args <<
|
32
|
-
suggest.args <<
|
31
|
+
suggest.args << '--pedantic'
|
32
|
+
suggest.args << '--all'
|
33
33
|
end
|
34
34
|
|
35
35
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
@@ -38,4 +38,4 @@ RuboCop::RakeTask.new(:rubocop) do |task|
|
|
38
38
|
task.fail_on_error = false
|
39
39
|
end
|
40
40
|
|
41
|
-
task :
|
41
|
+
task default: :test
|
data/bin/vedeu_drb_client
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
5
5
|
|
6
6
|
require 'vedeu'
|
7
7
|
|
8
|
-
client = Vedeu::Distributed::Client.new(
|
8
|
+
client = Vedeu::Distributed::Client.new('druby://localhost:21420')
|
9
9
|
client.input('l')
|
10
10
|
sleep 1
|
11
11
|
client.shutdown
|
data/bin/vedeu_drb_server
CHANGED
@@ -1,113 +1,115 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
lib_dir =
|
3
|
+
lib_dir = '/Users/gavinlaking/Source/vedeu/lib/vedeu/distributed/../../../lib'
|
4
4
|
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
5
5
|
|
6
6
|
require 'vedeu'
|
7
7
|
|
8
|
+
# A simple test application for Vedeu.
|
9
|
+
#
|
8
10
|
class VedeuTestApplication
|
9
|
-
# include Vedeu
|
10
|
-
|
11
|
-
Vedeu.configure do
|
12
|
-
colour_mode 16_777_216
|
13
|
-
log '/tmp/vedeu_test_helper.log'
|
14
|
-
debug!
|
15
|
-
drb!
|
16
|
-
drb_host 'localhost'
|
17
|
-
drb_port 21420
|
18
|
-
drb_width 80
|
19
|
-
drb_height 25
|
20
|
-
|
21
|
-
# cooked!
|
22
|
-
# raw!
|
23
|
-
|
24
|
-
# run_once!
|
25
|
-
|
26
|
-
# interactive!
|
27
|
-
# standalone!
|
28
|
-
|
29
|
-
# trace!
|
30
|
-
|
31
|
-
# System keys can be redefined
|
32
|
-
# exit_key 'q'
|
33
|
-
# focus_next_key :tab
|
34
|
-
# focus_prev_key :shift_tab
|
35
|
-
# mode_switch_key :escape
|
36
|
-
|
37
|
-
# Not used yet
|
38
|
-
# stdin File.open("/dev/tty", "r")
|
39
|
-
# stdout File.open("/dev/tty", "w")
|
40
|
-
# stderr File.open("/tmp/vedeu_error.log", "w+")
|
41
|
-
end
|
42
11
|
|
43
|
-
Vedeu.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
show_left!
|
53
|
-
show_right!
|
54
|
-
show_top!
|
55
|
-
|
56
|
-
# Define characters used to draw border
|
57
|
-
bottom_right '+'
|
58
|
-
bottom_left '+'
|
59
|
-
horizontal '-'
|
60
|
-
top_right '+'
|
61
|
-
top_left '+'
|
62
|
-
vertical '|'
|
63
|
-
end
|
12
|
+
Vedeu.configure do
|
13
|
+
colour_mode 16_777_216
|
14
|
+
log '/tmp/vedeu_test_helper.log'
|
15
|
+
debug!
|
16
|
+
drb!
|
17
|
+
drb_host 'localhost'
|
18
|
+
drb_port 21_420
|
19
|
+
drb_width 80
|
20
|
+
drb_height 25
|
64
21
|
|
65
|
-
|
66
|
-
|
67
|
-
height 6
|
68
|
-
width 26
|
69
|
-
x 4
|
70
|
-
y 4
|
71
|
-
end
|
22
|
+
# cooked!
|
23
|
+
# raw!
|
72
24
|
|
73
|
-
|
74
|
-
colour foreground: '#ff0000', background: '#000000'
|
75
|
-
cursor!
|
76
|
-
end
|
25
|
+
# run_once!
|
77
26
|
|
78
|
-
|
79
|
-
|
80
|
-
key(:right, 'l') { Vedeu.trigger(:_cursor_right_) }
|
81
|
-
key(:down, 'j') { Vedeu.trigger(:_cursor_down_) }
|
82
|
-
key(:left, 'h') { Vedeu.trigger(:_cursor_left_) }
|
83
|
-
end
|
27
|
+
# interactive!
|
28
|
+
# standalone!
|
84
29
|
|
85
|
-
|
86
|
-
|
87
|
-
|
30
|
+
# trace!
|
31
|
+
|
32
|
+
# System keys can be redefined
|
33
|
+
# exit_key 'q'
|
34
|
+
# focus_next_key :tab
|
35
|
+
# focus_prev_key :shift_tab
|
36
|
+
# mode_switch_key :escape
|
37
|
+
|
38
|
+
# Not used yet
|
39
|
+
# stdin File.open("/dev/tty", "r")
|
40
|
+
# stdout File.open("/dev/tty", "w")
|
41
|
+
# stderr File.open("/tmp/vedeu_error.log", "w+")
|
42
|
+
end
|
43
|
+
|
44
|
+
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
45
|
+
|
46
|
+
Vedeu.border 'test_interface' do
|
47
|
+
# Define colour and style of border
|
48
|
+
colour foreground: '#ffff00', background: '#0000ff'
|
49
|
+
style 'normal'
|
50
|
+
|
51
|
+
# Define visibility of border
|
52
|
+
show_bottom!
|
53
|
+
show_left!
|
54
|
+
show_right!
|
55
|
+
show_top!
|
56
|
+
|
57
|
+
# Define characters used to draw border
|
58
|
+
bottom_right '+'
|
59
|
+
bottom_left '+'
|
60
|
+
horizontal '-'
|
61
|
+
top_right '+'
|
62
|
+
top_left '+'
|
63
|
+
vertical '|'
|
64
|
+
end
|
88
65
|
|
89
|
-
Vedeu.
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
66
|
+
Vedeu.geometry 'test_interface' do
|
67
|
+
# centred!
|
68
|
+
height 6
|
69
|
+
width 26
|
70
|
+
x 4
|
71
|
+
y 4
|
72
|
+
end
|
73
|
+
|
74
|
+
Vedeu.interface 'test_interface' do
|
75
|
+
colour foreground: '#ff0000', background: '#000000'
|
76
|
+
cursor!
|
77
|
+
end
|
78
|
+
|
79
|
+
Vedeu.keymap 'test_interface' do
|
80
|
+
key(:up, 'k') { Vedeu.trigger(:_cursor_up_) }
|
81
|
+
key(:right, 'l') { Vedeu.trigger(:_cursor_right_) }
|
82
|
+
key(:down, 'j') { Vedeu.trigger(:_cursor_down_) }
|
83
|
+
key(:left, 'h') { Vedeu.trigger(:_cursor_left_) }
|
84
|
+
end
|
85
|
+
|
86
|
+
Vedeu.menu 'test_interface' do
|
87
|
+
# ...
|
88
|
+
end
|
89
|
+
|
90
|
+
Vedeu.renders do
|
91
|
+
view 'test_interface' do
|
92
|
+
lines do
|
93
|
+
line 'a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1'
|
94
|
+
line 'a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2q2r2s2t2u2v2w2x2y2z2'
|
95
|
+
line 'a3b3c3d3e3f3g3h3i3j3k3l3m3n3o3p3q3r3s3t3u3v3w3x3y3z3'
|
96
|
+
line 'a4b4c4d4e4f4g4h4i4j4k4l4m4n4o4p4q4r4s4t4u4v4w4x4y4z4'
|
97
|
+
line 'a5b5c5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5s5t5u5v5w5x5y5z5'
|
98
|
+
line 'a6b6c6d6e6f6g6h6i6j6k6l6m6n6o6p6q6r6s6t6u6v6w6x6y6z6'
|
99
|
+
line 'a7b7c7d7e7f7g7h7i7j7k7l7m7n7o7p7q7r7s7t7u7v7w7x7y7z7'
|
100
|
+
line 'a8b8c8d8e8f8g8h8i8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8'
|
101
|
+
end
|
100
102
|
end
|
101
103
|
end
|
102
|
-
end
|
103
104
|
|
104
|
-
def self.start(argv
|
105
|
-
stdin
|
105
|
+
def self.start(argv = ARGV,
|
106
|
+
stdin = STDIN,
|
106
107
|
stdout = STDOUT,
|
107
108
|
stderr = STDERR,
|
108
109
|
kernel = Kernel)
|
109
110
|
Vedeu::Launcher.execute!(argv, stdin, stdout, stderr, kernel)
|
110
111
|
end
|
112
|
+
|
111
113
|
end
|
112
114
|
|
113
115
|
VedeuTestApplication.start(ARGV)
|
data/bin/vedeu_test
CHANGED
@@ -5,10 +5,14 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
5
5
|
|
6
6
|
require 'vedeu'
|
7
7
|
|
8
|
+
# A simple test application for Vedeu.
|
9
|
+
#
|
8
10
|
class VedeuTestApp
|
11
|
+
|
9
12
|
def self.start(argv = ARGV)
|
10
13
|
Vedeu::Launcher.execute!(argv)
|
11
14
|
end
|
15
|
+
|
12
16
|
end
|
13
17
|
|
14
18
|
VedeuTestApp.start(ARGV)
|
data/config/rubocop_enabled.yml
CHANGED
@@ -47,7 +47,7 @@ Style/ArrayJoin:
|
|
47
47
|
Style/AsciiComments:
|
48
48
|
Description: 'Use only ascii symbols in comments.'
|
49
49
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
50
|
-
Enabled:
|
50
|
+
Enabled: false
|
51
51
|
|
52
52
|
Style/AsciiIdentifiers:
|
53
53
|
Description: 'Use only ascii symbols in identifiers.'
|
@@ -74,18 +74,13 @@ Style/BlockComments:
|
|
74
74
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
75
75
|
Enabled: true
|
76
76
|
|
77
|
+
Style/BlockDelimiters:
|
78
|
+
Enabled: false
|
79
|
+
|
77
80
|
Style/BlockEndNewline:
|
78
81
|
Description: 'Put end statement of multiline block on its own line.'
|
79
82
|
Enabled: true
|
80
83
|
|
81
|
-
Style/Blocks:
|
82
|
-
Description: >-
|
83
|
-
Avoid using {...} for multi-line blocks (multiline chaining is
|
84
|
-
always ugly).
|
85
|
-
Prefer {...} over do...end for single-line blocks.
|
86
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
87
|
-
Enabled: true
|
88
|
-
|
89
84
|
Style/BracesAroundHashParameters:
|
90
85
|
Description: 'Enforce braces style around hash parameters.'
|
91
86
|
Enabled: true
|
@@ -759,7 +754,7 @@ Metrics/BlockNesting:
|
|
759
754
|
|
760
755
|
Metrics/ClassLength:
|
761
756
|
Description: 'Avoid classes longer than 100 lines of code.'
|
762
|
-
Enabled:
|
757
|
+
Enabled: false
|
763
758
|
|
764
759
|
Metrics/CyclomaticComplexity:
|
765
760
|
Description: >-
|
data/examples/borders_app.rb
CHANGED
@@ -8,10 +8,10 @@ require 'vedeu'
|
|
8
8
|
# An example application to demonstrate borders.
|
9
9
|
#
|
10
10
|
class VedeuBordersApp
|
11
|
+
|
11
12
|
include Vedeu
|
12
13
|
|
13
14
|
configure do
|
14
|
-
colour_mode 16_777_216
|
15
15
|
debug!
|
16
16
|
log '/tmp/vedeu_borders_app.log'
|
17
17
|
end
|
@@ -309,6 +309,7 @@ class VedeuBordersApp
|
|
309
309
|
def self.start(argv = ARGV)
|
310
310
|
Vedeu::Launcher.execute!(argv)
|
311
311
|
end
|
312
|
+
|
312
313
|
end
|
313
314
|
|
314
315
|
VedeuBordersApp.start(ARGV)
|
data/examples/colours_app.rb
CHANGED
@@ -8,30 +8,35 @@ require 'vedeu'
|
|
8
8
|
# An example application to demonstrate colours.
|
9
9
|
#
|
10
10
|
class VedeuColoursApp
|
11
|
+
|
11
12
|
include Vedeu
|
12
13
|
|
13
14
|
configure do
|
14
|
-
colour_mode 16_777_216
|
15
15
|
debug!
|
16
16
|
log '/tmp/vedeu_colours_app.log'
|
17
17
|
end
|
18
18
|
|
19
19
|
bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
20
20
|
|
21
|
-
interface '
|
21
|
+
interface 'colours_256' do
|
22
22
|
geometry do
|
23
23
|
centred!
|
24
|
-
height
|
25
|
-
width
|
24
|
+
height 16
|
25
|
+
width 80
|
26
26
|
end
|
27
|
-
colour foreground: '#000000', background: '#000000'
|
28
27
|
end
|
29
28
|
|
30
29
|
renders do
|
31
|
-
view('
|
32
|
-
border!
|
30
|
+
view('colours_256') do
|
33
31
|
lines do
|
34
|
-
|
32
|
+
0.upto(16) do |row|
|
33
|
+
line do
|
34
|
+
0.upto(15) do |column|
|
35
|
+
code = (row * 15) + column
|
36
|
+
right "#{code}", width: 5, background: code, foreground: '#ffffff'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|
@@ -16,10 +16,10 @@ require 'vedeu'
|
|
16
16
|
#
|
17
17
|
# Use 'space' to refresh, 'q' to exit.
|
18
18
|
class VedeuConfigurationApp
|
19
|
+
|
19
20
|
include Vedeu
|
20
21
|
|
21
22
|
configure do
|
22
|
-
colour_mode 16_777_216
|
23
23
|
debug!
|
24
24
|
log '/tmp/vedeu_configuration_app.log'
|
25
25
|
end
|
@@ -35,7 +35,7 @@ class VedeuConfigurationApp
|
|
35
35
|
renders do
|
36
36
|
view 'config' do
|
37
37
|
lines do
|
38
|
-
line Configuration.log.inspect +
|
38
|
+
line Configuration.log.inspect + ' ' + Process.pid.to_s
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -47,6 +47,7 @@ class VedeuConfigurationApp
|
|
47
47
|
def self.start(argv = ARGV)
|
48
48
|
Vedeu::Launcher.execute!(argv)
|
49
49
|
end
|
50
|
+
|
50
51
|
end
|
51
52
|
|
52
53
|
VedeuConfigurationApp.start(ARGV)
|
data/examples/cursor_app.rb
CHANGED
@@ -9,10 +9,10 @@ require 'vedeu'
|
|
9
9
|
# the viewport of the interface in focus.
|
10
10
|
#
|
11
11
|
class VedeuCursorApp
|
12
|
+
|
12
13
|
include Vedeu
|
13
14
|
|
14
15
|
configure do
|
15
|
-
colour_mode 16_777_216
|
16
16
|
debug!
|
17
17
|
log '/tmp/vedeu_cursor_app.log'
|
18
18
|
end
|
@@ -25,8 +25,8 @@ class VedeuCursorApp
|
|
25
25
|
|
26
26
|
geometry do
|
27
27
|
centred true
|
28
|
-
height
|
29
|
-
width
|
28
|
+
height 20
|
29
|
+
width 20
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -45,7 +45,7 @@ class VedeuCursorApp
|
|
45
45
|
end
|
46
46
|
lines do
|
47
47
|
streams do
|
48
|
-
text 'A.
|
48
|
+
text 'A.3 '
|
49
49
|
end
|
50
50
|
streams do
|
51
51
|
background '#550000'
|
@@ -58,33 +58,37 @@ class VedeuCursorApp
|
|
58
58
|
end
|
59
59
|
lines do
|
60
60
|
streams do
|
61
|
-
text 'B.
|
61
|
+
text 'B.34 '
|
62
|
+
text 'lithium ', colour: { foreground: '#63d48e' }
|
63
|
+
text 'beryllium '
|
64
|
+
text 'boron', colour: { background: '#770033' }
|
65
|
+
text ' nitrogen'
|
62
66
|
end
|
63
67
|
end
|
64
68
|
lines do
|
65
69
|
streams do
|
66
|
-
text 'C.
|
70
|
+
text 'C.345'
|
67
71
|
text ' carbon oxygen '
|
68
72
|
end
|
69
73
|
streams do
|
70
74
|
background '#aadd00'
|
71
|
-
foreground '#
|
75
|
+
foreground '#00ddaa'
|
72
76
|
text 'fluorine'
|
73
77
|
end
|
74
78
|
end
|
75
79
|
lines do
|
76
80
|
streams do
|
77
|
-
text 'D.
|
81
|
+
text 'D.3456'
|
78
82
|
end
|
79
83
|
end
|
80
84
|
lines do
|
81
85
|
streams do
|
82
|
-
text 'E.
|
86
|
+
text 'E.34567 neon sodium', colour: { foreground: '#ffffff' }
|
83
87
|
end
|
84
88
|
end
|
85
89
|
lines do
|
86
90
|
streams do
|
87
|
-
text 'F.
|
91
|
+
text 'F.345678 magnesium '
|
88
92
|
end
|
89
93
|
streams do
|
90
94
|
foreground '#00aaff'
|
@@ -100,7 +104,7 @@ class VedeuCursorApp
|
|
100
104
|
streams do
|
101
105
|
background '#550000'
|
102
106
|
foreground '#ff00ff'
|
103
|
-
text 'H.
|
107
|
+
text 'H.34567890'
|
104
108
|
end
|
105
109
|
end
|
106
110
|
end
|
@@ -111,6 +115,7 @@ class VedeuCursorApp
|
|
111
115
|
def self.start(argv = ARGV)
|
112
116
|
Vedeu::Launcher.execute!(argv)
|
113
117
|
end
|
118
|
+
|
114
119
|
end
|
115
120
|
|
116
121
|
VedeuCursorApp.start(ARGV)
|