vedeu 0.8.9 → 0.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -0
- data/docs/configuration/drb.md +6 -0
- data/docs/configuration/drb_host.md +6 -0
- data/docs/configuration/drb_port.md +6 -0
- data/docs/configuration/interactive.md +21 -0
- data/docs/configuration/run_once.md +8 -0
- data/docs/configuration/standalone.md +20 -0
- data/docs/dsl.md +1 -1
- data/lib/vedeu.rb +15 -5
- data/lib/vedeu/application/controller.rb +5 -6
- data/lib/vedeu/borders/border.rb +1 -5
- data/lib/vedeu/borders/title.rb +6 -1
- data/lib/vedeu/buffers/buffer.rb +1 -3
- data/lib/vedeu/buffers/empty.rb +1 -3
- data/lib/vedeu/buffers/refresh.rb +1 -1
- data/lib/vedeu/buffers/view.rb +1 -1
- data/lib/vedeu/cells/border.rb +1 -1
- data/lib/vedeu/cells/borders/edges/bottom_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/edges/left_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/edges/right_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/edges/top_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/vertical.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/bottom_left.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/bottom_right.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/top_left.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/top_right.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +1 -1
- data/lib/vedeu/cells/empty.rb +1 -1
- data/lib/vedeu/coercers/coercer.rb +8 -0
- data/lib/vedeu/coercers/colour.rb +6 -4
- data/lib/vedeu/coercers/editor_line.rb +4 -1
- data/lib/vedeu/coercers/editor_lines.rb +18 -3
- data/lib/vedeu/coercers/lines.rb +2 -1
- data/lib/vedeu/coercers/page.rb +2 -6
- data/lib/vedeu/coercers/position.rb +1 -3
- data/lib/vedeu/coercers/row.rb +0 -1
- data/lib/vedeu/colours/colour.rb +1 -2
- data/lib/vedeu/configuration/api.rb +6 -69
- data/lib/vedeu/configuration/configuration.rb +1 -4
- data/lib/vedeu/cursors/coordinate.rb +1 -3
- data/lib/vedeu/cursors/cursor.rb +4 -7
- data/lib/vedeu/cursors/reposition.rb +1 -1
- data/lib/vedeu/distributed/test_application.rb +1 -3
- data/lib/vedeu/dsl/border.rb +3 -4
- data/lib/vedeu/dsl/geometry.rb +6 -7
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +2 -2
- data/lib/vedeu/dsl/helpers/truncate.rb +1 -2
- data/lib/vedeu/dsl/helpers/wordwrap.rb +1 -3
- data/lib/vedeu/dsl/presentation.rb +18 -0
- data/lib/vedeu/editor/cursor.rb +1 -3
- data/lib/vedeu/editor/document.rb +1 -3
- data/lib/vedeu/editor/line.rb +4 -12
- data/lib/vedeu/editor/lines.rb +3 -29
- data/lib/vedeu/events/event.rb +1 -3
- data/lib/vedeu/geometries/area/dimension.rb +1 -3
- data/lib/vedeu/geometries/area/x_dimension.rb +1 -1
- data/lib/vedeu/geometries/area/y_dimension.rb +1 -1
- data/lib/vedeu/geometries/geometry.rb +1 -4
- data/lib/vedeu/geometries/move.rb +1 -1
- data/lib/vedeu/groups/group.rb +4 -7
- data/lib/vedeu/input/keymap.rb +1 -3
- data/lib/vedeu/input/keys.rb +2 -0
- data/lib/vedeu/input/mapper.rb +2 -0
- data/lib/vedeu/input/mouse.rb +2 -0
- data/lib/vedeu/input/read.rb +1 -7
- data/lib/vedeu/interfaces/clear.rb +1 -1
- data/lib/vedeu/interfaces/interface.rb +11 -6
- data/lib/vedeu/logging/lockless_log_device.rb +18 -2
- data/lib/vedeu/logging/timer.rb +17 -9
- data/lib/vedeu/menus/menu.rb +1 -3
- data/lib/vedeu/models/toggleable.rb +5 -6
- data/lib/vedeu/output/all.rb +3 -0
- data/lib/vedeu/output/compressor.rb +1 -1
- data/lib/vedeu/output/output.rb +2 -3
- data/lib/vedeu/output/refresh.rb +1 -1
- data/lib/vedeu/output/write.rb +3 -2
- data/lib/vedeu/renderers/options.rb +1 -3
- data/lib/vedeu/repositories/defaults.rb +1 -1
- data/lib/vedeu/repositories/model.rb +5 -6
- data/lib/vedeu/repositories/registerable.rb +6 -8
- data/lib/vedeu/runtime/flags.rb +2 -2
- data/lib/vedeu/support/y_coordinate.rb +1 -1
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/composition.rb +1 -3
- data/lib/vedeu/views/default_attributes.rb +2 -4
- data/lib/vedeu/views/value.rb +6 -8
- data/lib/vedeu/views/view.rb +9 -3
- data/test/lib/vedeu/application/application_helper_test.rb +3 -2
- data/test/lib/vedeu/application/controller_test.rb +10 -11
- data/test/lib/vedeu/application/helper_test.rb +3 -2
- data/test/lib/vedeu/application/view_test.rb +4 -3
- data/test/lib/vedeu/coercers/editor_line_test.rb +21 -0
- data/test/lib/vedeu/coercers/editor_lines_test.rb +41 -0
- data/test/lib/vedeu/coercers/page_test.rb +1 -1
- data/test/lib/vedeu/cursors/dsl_test.rb +11 -10
- data/test/lib/vedeu/dsl/dsl_test.rb +3 -2
- data/test/lib/vedeu/dsl/elements_test.rb +19 -21
- data/test/lib/vedeu/dsl/presentation_test.rb +42 -0
- data/test/lib/vedeu/editor/collection_test.rb +5 -4
- data/test/lib/vedeu/editor/line_test.rb +4 -27
- data/test/lib/vedeu/editor/lines_test.rb +4 -54
- data/test/lib/vedeu/logging/timer_test.rb +11 -1
- data/test/lib/vedeu/models/toggleable_test.rb +27 -25
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -3
- data/test/lib/vedeu/presentation/colour_test.rb +13 -12
- data/test/lib/vedeu/presentation/presentation_test.rb +4 -2
- data/test/lib/vedeu/presentation/styles_test.rb +5 -3
- data/test/lib/vedeu/renderers/options_test.rb +10 -12
- data/test/lib/vedeu/repositories/assemblage_test.rb +11 -10
- data/test/lib/vedeu/repositories/collection_test.rb +1 -1
- data/test/lib/vedeu/repositories/defaults_test.rb +9 -7
- data/test/lib/vedeu/repositories/model_test.rb +10 -9
- data/test/lib/vedeu/repositories/registerable_test.rb +19 -18
- data/test/lib/vedeu/repositories/repository_test.rb +7 -7
- data/test/lib/vedeu/repositories/store_test.rb +14 -13
- data/test/lib/vedeu/templating/helpers_test.rb +9 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +17 -17
- data/test/lib/vedeu/views/value_test.rb +0 -1
- data/test/support/helpers/model_test_class.rb +1 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b0005acf22666df61aa974c5fa63a7a2efe5e8b
|
4
|
+
data.tar.gz: 1534526ad0f0118be2c7d56513bc879a8d3da466
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ef391ed3888dde03e08ca67767adb96d46a623d1b7a472b53eb55dc3bf6835caaf790610a88275b16162c79bad110e0338a122dff7ebb2bdd648fd530c7af2
|
7
|
+
data.tar.gz: 7cae3f72bfc99f04dbd03dc9b6f4b20e620bb18d3850395da822b506856b6a61b2c98095fa33f338825d90c87d4203887212d66abcef100e321b7f008dad6e86
|
data/.codeclimate.yml
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
Sets boolean to allow user input. The default behaviour of Vedeu is to
|
2
|
+
be interactive. This is the same as setting
|
3
|
+
{Vedeu::Config::API#standalone} to false.
|
4
|
+
|
5
|
+
# same as `interactive true` or `standalone false`.
|
6
|
+
Vedeu.configure do
|
7
|
+
interactive!
|
8
|
+
# ...
|
9
|
+
end
|
10
|
+
|
11
|
+
# => Allow user input.
|
12
|
+
Vedeu.configure do
|
13
|
+
interactive true
|
14
|
+
# ...
|
15
|
+
end
|
16
|
+
|
17
|
+
# => Disallow user input.
|
18
|
+
Vedeu.configure do
|
19
|
+
interactive false
|
20
|
+
# ...
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Sets boolean to prevent user intervention. This is the same as setting
|
2
|
+
{Vedeu::Config::API#interactive} to false.
|
3
|
+
|
4
|
+
# Same as `standalone true` or `interactive false`.
|
5
|
+
Vedeu.configure do
|
6
|
+
standalone!
|
7
|
+
# ...
|
8
|
+
end
|
9
|
+
|
10
|
+
# => Disallow user input.
|
11
|
+
Vedeu.configure do
|
12
|
+
standalone true
|
13
|
+
# ...
|
14
|
+
end
|
15
|
+
|
16
|
+
# => Allow user input.
|
17
|
+
Vedeu.configure do
|
18
|
+
standalone false
|
19
|
+
# ...
|
20
|
+
end
|
data/docs/dsl.md
CHANGED
data/lib/vedeu.rb
CHANGED
@@ -46,14 +46,24 @@ end # Vedeu
|
|
46
46
|
|
47
47
|
# Define some Yard macros used throughout the project.
|
48
48
|
#
|
49
|
-
# @!macro [new]
|
50
|
-
#
|
49
|
+
# @!macro [new] defaults_method
|
50
|
+
# The default options/attributes for a new instance of this class.
|
51
|
+
#
|
52
|
+
# @return [Hash<Symbol => void>]
|
51
53
|
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
# class or instance methods to the including class or module.
|
54
|
+
# @!macro [new] module_included
|
55
|
+
# Provide additional behaviour to a class or module.
|
55
56
|
#
|
56
57
|
# @param klass [Class]
|
57
58
|
# @return [void]
|
59
|
+
#
|
60
|
+
# @!macro [new] module_instance_methods
|
61
|
+
# Provide additional behaviour as instance methods to the including
|
62
|
+
# class or module.
|
63
|
+
#
|
64
|
+
# @!macro [new] module_singleton_methods
|
65
|
+
# Provide additional behaviour as singleton methods to the including
|
66
|
+
# class or module.
|
67
|
+
#
|
58
68
|
|
59
69
|
require 'vedeu/all'
|
@@ -6,9 +6,8 @@ module Vedeu
|
|
6
6
|
#
|
7
7
|
module Controller
|
8
8
|
|
9
|
-
#
|
10
|
-
|
11
|
-
module ClassMethods
|
9
|
+
# @macro module_singleton_methods
|
10
|
+
module SingletonMethods
|
12
11
|
|
13
12
|
attr_writer :controller_name
|
14
13
|
|
@@ -73,11 +72,11 @@ module Vedeu
|
|
73
72
|
alias action_name action
|
74
73
|
alias actions action
|
75
74
|
|
76
|
-
end #
|
75
|
+
end # SingletonMethods
|
77
76
|
|
78
|
-
# @macro
|
77
|
+
# @macro module_included
|
79
78
|
def self.included(klass)
|
80
|
-
klass.extend(Vedeu::Controller::
|
79
|
+
klass.extend(Vedeu::Controller::SingletonMethods)
|
81
80
|
end
|
82
81
|
|
83
82
|
end # Controller
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -304,11 +304,7 @@ module Vedeu
|
|
304
304
|
}
|
305
305
|
end
|
306
306
|
|
307
|
-
#
|
308
|
-
#
|
309
|
-
# @return [Hash<Symbol => Boolean|Hash|NilClass|String|Symbol|
|
310
|
-
# Vedeu::Borders::Repository|Vedeu::Presentation::Style>]
|
311
|
-
# @see Vedeu::EscapeSequences::Borders
|
307
|
+
# @macro defaults_method
|
312
308
|
def defaults
|
313
309
|
{
|
314
310
|
bottom_horizontal: nil,
|
data/lib/vedeu/borders/title.rb
CHANGED
@@ -52,7 +52,7 @@ module Vedeu
|
|
52
52
|
def render
|
53
53
|
return horizontal if empty?
|
54
54
|
|
55
|
-
horizontal[start_index..
|
55
|
+
horizontal[start_index..end_index] = chars
|
56
56
|
|
57
57
|
horizontal
|
58
58
|
end
|
@@ -121,6 +121,11 @@ module Vedeu
|
|
121
121
|
value.empty?
|
122
122
|
end
|
123
123
|
|
124
|
+
# @return [Fixnum]
|
125
|
+
def end_index
|
126
|
+
start_index + (size - 1)
|
127
|
+
end
|
128
|
+
|
124
129
|
# @return [Vedeu::Geometries::Geometry]
|
125
130
|
def geometry
|
126
131
|
@_geometry ||= Vedeu.geometries.by_name(name)
|
data/lib/vedeu/buffers/buffer.rb
CHANGED
data/lib/vedeu/buffers/empty.rb
CHANGED
data/lib/vedeu/buffers/view.rb
CHANGED
data/lib/vedeu/cells/border.rb
CHANGED
data/lib/vedeu/cells/cursor.rb
CHANGED
data/lib/vedeu/cells/empty.rb
CHANGED
@@ -46,6 +46,14 @@ module Vedeu
|
|
46
46
|
value.is_a?(klass)
|
47
47
|
end
|
48
48
|
|
49
|
+
# @macro raise_fatal
|
50
|
+
# @return [void]
|
51
|
+
def incoercible!
|
52
|
+
fail Vedeu::Error::Fatal,
|
53
|
+
"Vedeu cannot coerce a '#{value.class.name}' into a " \
|
54
|
+
"'#{klass}'."
|
55
|
+
end
|
56
|
+
|
49
57
|
# @macro raise_not_implemented
|
50
58
|
# @return [Class]
|
51
59
|
def klass
|
@@ -11,8 +11,6 @@ module Vedeu
|
|
11
11
|
#
|
12
12
|
class Colour < Vedeu::Coercers::Coercer
|
13
13
|
|
14
|
-
include Vedeu::Common
|
15
|
-
|
16
14
|
# @macro raise_fatal
|
17
15
|
# @return [void]
|
18
16
|
def coerce
|
@@ -29,17 +27,21 @@ module Vedeu
|
|
29
27
|
klass.new(foreground: value)
|
30
28
|
|
31
29
|
elsif hash?(value)
|
32
|
-
attributes = Vedeu::Coercers::ColourAttributes.coerce(value)
|
33
30
|
klass.new(attributes)
|
34
31
|
|
35
32
|
else
|
36
|
-
|
33
|
+
incoercible!
|
37
34
|
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
41
38
|
private
|
42
39
|
|
40
|
+
# @return [Hash]
|
41
|
+
def attributes
|
42
|
+
Vedeu::Coercers::ColourAttributes.coerce(value)
|
43
|
+
end
|
44
|
+
|
43
45
|
# @return [Boolean]
|
44
46
|
def background?
|
45
47
|
value.is_a?(Vedeu::Colours::Background)
|
@@ -11,13 +11,28 @@ module Vedeu
|
|
11
11
|
#
|
12
12
|
class EditorLines < Vedeu::Coercers::Coercer
|
13
13
|
|
14
|
-
# @
|
14
|
+
# @macro raise_fatal
|
15
|
+
# @return [Vedeu::Editor::Lines]
|
15
16
|
def coerce
|
16
17
|
if coerced?
|
17
|
-
value
|
18
|
+
klass.new(value.lines)
|
18
19
|
|
19
|
-
|
20
|
+
elsif value.is_a?(Array)
|
21
|
+
collection = value.map do |line|
|
22
|
+
Vedeu::Editor::Line.coerce(line)
|
23
|
+
end
|
24
|
+
|
25
|
+
klass.new(collection)
|
26
|
+
|
27
|
+
elsif string?(value)
|
28
|
+
collection = value.lines.map(&:chomp).map do |line|
|
29
|
+
Vedeu::Editor::Line.coerce(line)
|
30
|
+
end
|
20
31
|
|
32
|
+
klass.new(collection)
|
33
|
+
|
34
|
+
else
|
35
|
+
klass.new
|
21
36
|
|
22
37
|
end
|
23
38
|
end
|