vedeu 0.4.58 → 0.4.59
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -558
- data/README.md +2 -0
- data/docs/dsl.md +66 -54
- data/lib/vedeu/all.rb +44 -16
- data/lib/vedeu/api.rb +0 -2
- data/lib/vedeu/bindings/drb.rb +0 -1
- data/lib/vedeu/bindings/menus.rb +0 -1
- data/lib/vedeu/bindings/movement.rb +0 -1
- data/lib/vedeu/bindings/system.rb +0 -1
- data/lib/vedeu/bindings/visibility.rb +0 -1
- data/lib/vedeu/bootstrap.rb +2 -2
- data/lib/vedeu/buffers/buffers.rb +0 -4
- data/lib/vedeu/cli/generator/all.rb +0 -4
- data/lib/vedeu/cli/generator/helpers.rb +0 -2
- data/lib/vedeu/cli/generator/templates/application/application.erb +8 -5
- data/lib/vedeu/cli/generator/view.rb +4 -2
- data/lib/vedeu/cli/main.rb +0 -2
- data/lib/vedeu/colours/backgrounds.rb +0 -1
- data/lib/vedeu/colours/colours.rb +0 -1
- data/lib/vedeu/colours/foregrounds.rb +0 -1
- data/lib/vedeu/configuration/api.rb +19 -6
- data/lib/vedeu/configuration/cli.rb +9 -1
- data/lib/vedeu/configuration/configuration.rb +9 -0
- data/lib/vedeu/cursor/cursor.rb +0 -2
- data/lib/vedeu/cursor/cursors.rb +0 -3
- data/lib/vedeu/debug.rb +0 -1
- data/lib/vedeu/dsl.rb +0 -1
- data/lib/vedeu/dsl/border.rb +69 -106
- data/lib/vedeu/dsl/composition.rb +1 -2
- data/lib/vedeu/dsl/geometry.rb +102 -67
- data/lib/vedeu/dsl/group.rb +21 -9
- data/lib/vedeu/dsl/interface.rb +0 -1
- data/lib/vedeu/dsl/keymap.rb +26 -36
- data/lib/vedeu/dsl/line.rb +5 -10
- data/lib/vedeu/dsl/menu.rb +7 -13
- data/lib/vedeu/dsl/presentation.rb +0 -1
- data/lib/vedeu/dsl/stream.rb +0 -1
- data/lib/vedeu/dsl/text.rb +0 -1
- data/lib/vedeu/dsl/use.rb +0 -1
- data/lib/vedeu/dsl/view.rb +28 -31
- data/lib/vedeu/events/event.rb +0 -3
- data/lib/vedeu/events/events.rb +0 -1
- data/lib/vedeu/events/trigger.rb +0 -1
- data/lib/vedeu/geometry/geometries.rb +0 -4
- data/lib/vedeu/geometry/geometry.rb +0 -2
- data/lib/vedeu/geometry/grid.rb +2 -25
- data/lib/vedeu/input/keymap.rb +0 -3
- data/lib/vedeu/input/keymaps.rb +0 -3
- data/lib/vedeu/launcher.rb +0 -1
- data/lib/vedeu/log.rb +0 -1
- data/lib/vedeu/models/char.rb +0 -5
- data/lib/vedeu/models/group.rb +0 -2
- data/lib/vedeu/models/groups.rb +0 -3
- data/lib/vedeu/models/interface.rb +0 -19
- data/lib/vedeu/models/interfaces.rb +0 -4
- data/lib/vedeu/models/menus.rb +0 -3
- data/lib/vedeu/null/interface.rb +6 -7
- data/lib/vedeu/output/border.rb +0 -2
- data/lib/vedeu/output/borders.rb +0 -4
- data/lib/vedeu/output/esc.rb +0 -1
- data/lib/vedeu/output/html_char.rb +0 -2
- data/lib/vedeu/output/refresh.rb +0 -3
- data/lib/vedeu/output/refresh_group.rb +0 -2
- data/lib/vedeu/output/renderers.rb +0 -13
- data/lib/vedeu/repositories.rb +2 -15
- data/lib/vedeu/repositories/model.rb +0 -2
- data/lib/vedeu/repositories/repository.rb +0 -2
- data/lib/vedeu/templating/template.rb +0 -2
- data/lib/vedeu/terminal.rb +0 -3
- data/lib/vedeu/timer.rb +0 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/bootstrap_test.rb +8 -1
- data/test/lib/vedeu/configuration/api_test.rb +14 -0
- data/test/lib/vedeu/configuration/cli_test.rb +15 -0
- data/test/lib/vedeu/cursor/cursor_test.rb +0 -1
- data/test/lib/vedeu/models/interface_test.rb +12 -4
- data/test/lib/vedeu/null/interface_test.rb +3 -12
- data/test/support/helpers/model_test_class.rb +0 -3
- data/test/test_helper.rb +0 -2
- data/vedeu.gemspec +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -41,6 +41,8 @@ to your project here.
|
|
41
41
|
Vedeu is largely documented using Yard. I hope to produce more 'General Usage'
|
42
42
|
documentation shortly. In the meantime, please browse the [RubyDoc](http://rubydoc.info/gems/vedeu).
|
43
43
|
|
44
|
+
- [The Vedeu DSL](http://rubydoc.info/gems/vedeu/file/docs/dsl.md)
|
45
|
+
|
44
46
|
|
45
47
|
## Development / Contributing
|
46
48
|
|
data/docs/dsl.md
CHANGED
@@ -72,77 +72,89 @@ geometry 'main' do
|
|
72
72
|
end
|
73
73
|
```
|
74
74
|
|
75
|
-
|
75
|
+
## Borders
|
76
76
|
|
77
|
-
|
78
|
-
views. They can be enabled or disabled (which controls whether they are
|
79
|
-
rendered or not), they have their own colours and styles, and each aspect of
|
80
|
-
the border can be controlled. The RubyDoc contains information for
|
81
|
-
configuring borders.
|
77
|
+
{include:Vedeu::DSL::Border}
|
82
78
|
|
83
|
-
###
|
79
|
+
### Setting a title for the border
|
84
80
|
|
85
|
-
|
81
|
+
{include:Vedeu::DSL::Border#title}
|
86
82
|
|
87
|
-
|
83
|
+
### Customising the appearance of the border
|
88
84
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
y 10 # Start drawing 10 spaces from top
|
96
|
-
xn 30 # Stop drawing 30 spaces from the left
|
97
|
-
yn 20 # Stop drawing 20 spaces from top
|
98
|
-
end
|
99
|
-
end
|
100
|
-
```
|
85
|
+
{include:Vedeu::DSL::Border#bottom_left}
|
86
|
+
{include:Vedeu::DSL::Border#bottom_right}
|
87
|
+
{include:Vedeu::DSL::Border#horizontal}
|
88
|
+
{include:Vedeu::DSL::Border#top_left}
|
89
|
+
{include:Vedeu::DSL::Border#top_right}
|
90
|
+
{include:Vedeu::DSL::Border#vertical}
|
101
91
|
|
102
|
-
|
103
|
-
available in the terminal will be used. `x` and `y` both default to 0.
|
92
|
+
### Enabling/disabling the border
|
104
93
|
|
105
|
-
|
94
|
+
{include:Vedeu::DSL::Border#enable!}
|
95
|
+
{include:Vedeu::DSL::Border#disable!}
|
106
96
|
|
107
|
-
|
108
|
-
interface 'other_panel' do
|
109
|
-
# other code ...
|
110
|
-
end
|
97
|
+
### Enabling/disabling an aspect of the border
|
111
98
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
99
|
+
{include:Vedeu::DSL::Border#bottom}
|
100
|
+
{include:Vedeu::DSL::Border#left}
|
101
|
+
{include:Vedeu::DSL::Border#right}
|
102
|
+
{include:Vedeu::DSL::Border#top}
|
103
|
+
|
104
|
+
## Geometry
|
105
|
+
|
106
|
+
{include:Vedeu::DSL::Geometry}
|
107
|
+
|
108
|
+
### Setting the interface dimensions
|
109
|
+
|
110
|
+
{include:Vedeu::DSL::Geometry#centred}
|
111
|
+
{include:Vedeu::DSL::Geometry#height}
|
112
|
+
{include:Vedeu::DSL::Geometry#width}
|
113
|
+
{include:Vedeu::DSL::Geometry#columns}
|
114
|
+
{include:Vedeu::DSL::Geometry#rows}
|
115
|
+
{include:Vedeu::DSL::Geometry#x}
|
116
|
+
{include:Vedeu::DSL::Geometry#xn}
|
117
|
+
{include:Vedeu::DSL::Geometry#y}
|
118
|
+
{include:Vedeu::DSL::Geometry#yn}
|
119
|
+
|
120
|
+
## Groups
|
121
|
+
|
122
|
+
{include:Vedeu::DSL::Group}
|
123
|
+
|
124
|
+
### Add interfaces to groups
|
125
|
+
|
126
|
+
{include:Vedeu::DSL::Group.group}
|
127
|
+
|
128
|
+
## Keymaps
|
129
|
+
|
130
|
+
{include:Vedeu::DSL::Keymap}
|
131
|
+
{include:Vedeu::DSL::Keymap.keymap}
|
132
|
+
{include:Vedeu::DSL::Keymap#name}
|
133
|
+
|
134
|
+
## Menus
|
119
135
|
|
120
|
-
|
136
|
+
{include:Vedeu::DSL::Menu}
|
137
|
+
{include:Vedeu::DSL::Menu#item}
|
138
|
+
{include:Vedeu::DSL::Menu#items}
|
139
|
+
{include:Vedeu::DSL::Menu#name}
|
121
140
|
|
122
|
-
|
141
|
+
## Views
|
123
142
|
|
124
|
-
|
125
|
-
member of group, the group can be affected by other controls. For example,
|
126
|
-
assuming the client application is a simple Git client, it may have a group
|
127
|
-
called 'commit'. The 'commit' group will contain the interfaces 'diff' (to show
|
128
|
-
the changes), 'staged' (to show which files are staged) and 'unstaged'. A
|
129
|
-
refresh of the 'commit' group would cause all interfaces belonging to the group
|
130
|
-
to refresh. Similarly, showing or hiding the group would of course, show or
|
131
|
-
hide the interfaces of that group.
|
143
|
+
{include:Vedeu::DSL::View.interface}
|
132
144
|
|
133
|
-
###
|
145
|
+
### Immediate rendering
|
134
146
|
|
135
|
-
|
136
|
-
interface is in focus, keys pressed as part of this definition will affect
|
137
|
-
that interface. This allows you to form context driven behaviour for your
|
138
|
-
application.
|
147
|
+
{include:Vedeu::DSL::View.render}
|
139
148
|
|
149
|
+
### Deferred rendering
|
140
150
|
|
141
|
-
|
151
|
+
{include:Vedeu::DSL::View.view}
|
142
152
|
|
143
|
-
|
153
|
+
### Specifying view content
|
144
154
|
|
145
|
-
|
155
|
+
{include:Vedeu::DSL::Line}
|
156
|
+
{include:Vedeu::DSL::Line#line}
|
157
|
+
{include:Vedeu::DSL::Line#streams}
|
146
158
|
|
147
|
-
|
159
|
+
`@todo` More documentation coming soon.
|
148
160
|
|
data/lib/vedeu/all.rb
CHANGED
@@ -7,12 +7,28 @@ require 'vedeu/debug'
|
|
7
7
|
require 'vedeu/traps'
|
8
8
|
require 'vedeu/common'
|
9
9
|
require 'vedeu/terminal_mode'
|
10
|
+
|
11
|
+
require 'vedeu/configuration/cli'
|
12
|
+
require 'vedeu/configuration/api'
|
13
|
+
require 'vedeu/configuration/configuration'
|
14
|
+
|
10
15
|
require 'vedeu/terminal'
|
11
16
|
require 'vedeu/timer'
|
12
17
|
require 'vedeu/main_loop'
|
13
18
|
require 'vedeu/application'
|
19
|
+
|
20
|
+
require 'vedeu/models/toggleable'
|
21
|
+
|
22
|
+
require 'vedeu/repositories/collection'
|
23
|
+
require 'vedeu/input/keys'
|
24
|
+
require 'vedeu/events/event_collection'
|
14
25
|
require 'vedeu/repositories'
|
15
26
|
|
27
|
+
require 'vedeu/repositories/model'
|
28
|
+
require 'vedeu/repositories/store'
|
29
|
+
require 'vedeu/repositories/registerable'
|
30
|
+
require 'vedeu/repositories/repository'
|
31
|
+
|
16
32
|
require 'vedeu/null'
|
17
33
|
require 'vedeu/null/border'
|
18
34
|
require 'vedeu/null/buffer'
|
@@ -20,11 +36,6 @@ require 'vedeu/null/generic'
|
|
20
36
|
require 'vedeu/null/geometry'
|
21
37
|
require 'vedeu/null/interface'
|
22
38
|
|
23
|
-
require 'vedeu/repositories/collection'
|
24
|
-
require 'vedeu/repositories/store'
|
25
|
-
require 'vedeu/repositories/registerable'
|
26
|
-
require 'vedeu/repositories/repository'
|
27
|
-
|
28
39
|
require 'vedeu/geometry/area'
|
29
40
|
require 'vedeu/geometry/coordinate'
|
30
41
|
require 'vedeu/geometry/dimension'
|
@@ -44,32 +55,48 @@ require 'vedeu/colours/background'
|
|
44
55
|
require 'vedeu/colours/foreground'
|
45
56
|
require 'vedeu/colours/colour'
|
46
57
|
|
47
|
-
require 'vedeu/buffers/buffers'
|
48
58
|
require 'vedeu/buffers/buffer'
|
59
|
+
require 'vedeu/buffers/buffers'
|
60
|
+
|
49
61
|
require 'vedeu/buffers/display_buffer'
|
50
62
|
|
51
|
-
require 'vedeu/cursor/cursors'
|
52
63
|
require 'vedeu/cursor/cursor'
|
64
|
+
require 'vedeu/cursor/cursors'
|
53
65
|
require 'vedeu/cursor/move'
|
54
66
|
require 'vedeu/cursor/refresh_cursor'
|
55
67
|
require 'vedeu/cursor/reposition'
|
56
68
|
|
69
|
+
require 'vedeu/output/renderers/renderer_options'
|
70
|
+
require 'vedeu/output/renderers/escape_sequence'
|
71
|
+
require 'vedeu/output/renderers/file'
|
72
|
+
require 'vedeu/output/renderers/html'
|
73
|
+
require 'vedeu/output/renderers/json'
|
74
|
+
require 'vedeu/output/renderers/null'
|
75
|
+
require 'vedeu/output/renderers/terminal'
|
76
|
+
require 'vedeu/output/renderers/text'
|
57
77
|
require 'vedeu/output/renderers'
|
58
78
|
|
59
|
-
require 'vedeu/events/
|
79
|
+
require 'vedeu/events/trigger'
|
60
80
|
require 'vedeu/events/events'
|
61
81
|
require 'vedeu/events/event'
|
62
|
-
require 'vedeu/events/trigger'
|
63
82
|
|
64
83
|
require 'vedeu/models/cell'
|
65
84
|
require 'vedeu/models/char'
|
85
|
+
require 'vedeu/models/chars'
|
66
86
|
require 'vedeu/models/escape'
|
67
87
|
require 'vedeu/models/stream'
|
88
|
+
require 'vedeu/models/streams'
|
89
|
+
require 'vedeu/models/lines'
|
90
|
+
require 'vedeu/models/line'
|
91
|
+
require 'vedeu/models/interface'
|
68
92
|
require 'vedeu/models/interfaces'
|
93
|
+
require 'vedeu/models/interface_collection'
|
69
94
|
require 'vedeu/models/composition'
|
70
95
|
require 'vedeu/models/focus'
|
71
|
-
require 'vedeu/models/groups'
|
72
96
|
require 'vedeu/models/group'
|
97
|
+
require 'vedeu/models/groups'
|
98
|
+
|
99
|
+
require 'vedeu/models/menu'
|
73
100
|
require 'vedeu/models/menus'
|
74
101
|
|
75
102
|
require 'vedeu/templating/helpers'
|
@@ -84,12 +111,12 @@ require 'vedeu/application/application_controller'
|
|
84
111
|
require 'vedeu/application/application_helper'
|
85
112
|
require 'vedeu/application/application_view'
|
86
113
|
|
114
|
+
require 'vedeu/cli/generator/helpers'
|
115
|
+
require 'vedeu/cli/generator/application'
|
116
|
+
require 'vedeu/cli/generator/view'
|
87
117
|
require 'vedeu/cli/generator/all'
|
88
|
-
require 'vedeu/cli/main'
|
89
118
|
|
90
|
-
require 'vedeu/
|
91
|
-
require 'vedeu/configuration/api'
|
92
|
-
require 'vedeu/configuration/configuration'
|
119
|
+
require 'vedeu/cli/main'
|
93
120
|
|
94
121
|
require 'vedeu/distributed/uri'
|
95
122
|
require 'vedeu/distributed/server'
|
@@ -115,15 +142,16 @@ require 'vedeu/dsl/view'
|
|
115
142
|
require 'vedeu/input/mapper'
|
116
143
|
require 'vedeu/input/key'
|
117
144
|
require 'vedeu/input/input'
|
118
|
-
require 'vedeu/input/keymaps'
|
119
145
|
require 'vedeu/input/keymap'
|
146
|
+
require 'vedeu/input/keymaps'
|
120
147
|
|
121
148
|
require 'vedeu/output/clear/named_group'
|
122
149
|
require 'vedeu/output/clear/named_interface'
|
123
150
|
require 'vedeu/output/esc'
|
124
151
|
require 'vedeu/output/presentation'
|
125
|
-
require 'vedeu/output/
|
152
|
+
require 'vedeu/output/render_border'
|
126
153
|
require 'vedeu/output/border'
|
154
|
+
require 'vedeu/output/borders'
|
127
155
|
require 'vedeu/output/compressor'
|
128
156
|
require 'vedeu/output/style'
|
129
157
|
require 'vedeu/output/text'
|
data/lib/vedeu/api.rb
CHANGED
data/lib/vedeu/bindings/drb.rb
CHANGED
data/lib/vedeu/bindings/menus.rb
CHANGED
data/lib/vedeu/bootstrap.rb
CHANGED
@@ -18,7 +18,7 @@ module Vedeu
|
|
18
18
|
# @param argv [Array<String>]
|
19
19
|
# @param entry_point [void]
|
20
20
|
# @return [Vedeu::Bootstrap]
|
21
|
-
def initialize(argv, entry_point)
|
21
|
+
def initialize(argv, entry_point = nil)
|
22
22
|
@argv = argv
|
23
23
|
@entry_point = entry_point
|
24
24
|
end
|
@@ -48,7 +48,7 @@ module Vedeu
|
|
48
48
|
'app/models/keymaps/**/*',
|
49
49
|
].each { |path| load(File.join(Vedeu::Configuration.base_path, path)) }
|
50
50
|
|
51
|
-
entry_point
|
51
|
+
entry_point || eval(Vedeu::Configuration.root)
|
52
52
|
|
53
53
|
Vedeu::Launcher.execute!(argv)
|
54
54
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative 'config/configuration'
|
2
|
-
|
2
|
+
# Uncomment this, if you are manually setting the entry point below
|
3
|
+
# require_relative 'app/controllers/some_controller'
|
3
4
|
|
4
5
|
module <%= object.name_as_class %>
|
5
6
|
|
@@ -8,11 +9,13 @@ module <%= object.name_as_class %>
|
|
8
9
|
# Change this to be the controller you would like to start the
|
9
10
|
# application from.
|
10
11
|
#
|
11
|
-
def self.entry_point
|
12
|
-
|
13
|
-
end
|
12
|
+
# def self.entry_point
|
13
|
+
# <%= object.name_as_class %>::SomeController.new
|
14
|
+
# end
|
14
15
|
|
15
|
-
Vedeu::Bootstrap.start(ARGV, entry_point)
|
16
|
+
# Vedeu::Bootstrap.start(ARGV, entry_point)
|
17
|
+
|
18
|
+
Vedeu::Bootstrap.start(ARGV)
|
16
19
|
|
17
20
|
end
|
18
21
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
1
|
module Vedeu
|
4
2
|
|
5
3
|
module Generator
|
@@ -37,6 +35,10 @@ module Vedeu
|
|
37
35
|
make_interface_file
|
38
36
|
make_template_file
|
39
37
|
make_view_class_file
|
38
|
+
|
39
|
+
output("Please update the 'root' setting in 'config/configuration.rb'" \
|
40
|
+
" to '#{app_name}::#{name_as_class}Controller.new' if you " \
|
41
|
+
'would like to start Vedeu at this controller.')
|
40
42
|
end
|
41
43
|
|
42
44
|
private
|
data/lib/vedeu/cli/main.rb
CHANGED