vedeu 0.8.20 → 0.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/dsl/by_method/geometry/align_centre.md +3 -0
- data/docs/dsl/by_method/geometry/columns.md +12 -1
- data/docs/dsl/by_method/geometry/height.md +9 -0
- data/docs/dsl/by_method/geometry/horizontal_alignment.md +3 -1
- data/docs/dsl/by_method/geometry/rows.md +12 -1
- data/docs/dsl/by_method/geometry/vertical_alignment.md +3 -1
- data/docs/dsl/by_method/geometry/width.md +9 -0
- data/docs/dsl/by_method/geometry/x.md +11 -1
- data/docs/dsl/by_method/geometry/xn.md +14 -1
- data/docs/dsl/by_method/geometry/y.md +11 -1
- data/docs/dsl/by_method/geometry/yn.md +12 -1
- data/docs/dsl/by_method/geometry/zindex.md +18 -0
- data/docs/dsl/by_method/template_for.md +10 -0
- data/docs/dsl/by_method/use.md +21 -0
- data/integrations/342_streams.rb +3 -1
- data/integrations/dsl_app_001.rb +3 -1
- data/integrations/dsl_app_002.rb +3 -1
- data/integrations/dsl_app_003.rb +3 -1
- data/integrations/dsl_app_004.rb +3 -1
- data/integrations/dsl_app_005.rb +3 -1
- data/integrations/dsl_app_006.rb +3 -1
- data/integrations/dsl_app_007.rb +3 -1
- data/integrations/dsl_app_008.rb +3 -1
- data/integrations/dsl_app_009.rb +3 -1
- data/integrations/dsl_app_010.rb +3 -1
- data/integrations/dsl_app_011.rb +3 -1
- data/integrations/dsl_app_012.rb +3 -1
- data/integrations/dsl_app_013.rb +3 -1
- data/integrations/dsl_app_014.rb +3 -1
- data/integrations/dsl_app_015.rb +3 -1
- data/integrations/dsl_app_016.rb +3 -1
- data/integrations/dsl_app_017.rb +3 -1
- data/integrations/dsl_app_018.rb +3 -1
- data/integrations/dsl_app_019.rb +3 -1
- data/integrations/dsl_app_020.rb +3 -1
- data/integrations/dsl_app_021.rb +3 -1
- data/integrations/dsl_app_022.rb +3 -1
- data/integrations/dsl_app_border_001.rb +3 -1
- data/integrations/dsl_app_border_002.rb +3 -1
- data/integrations/dsl_app_border_003.rb +3 -1
- data/integrations/dsl_app_border_004.rb +3 -1
- data/integrations/dsl_app_border_005.rb +3 -1
- data/integrations/dsl_app_border_006.rb +3 -1
- data/integrations/dsl_app_border_007.rb +3 -1
- data/integrations/dsl_app_border_008.rb +3 -1
- data/integrations/dsl_app_border_009.rb +3 -1
- data/integrations/dsl_app_border_010.rb +3 -1
- data/integrations/dsl_app_border_011.rb +3 -1
- data/integrations/test_runner.rb +20 -10
- data/lib/vedeu/borders/border.rb +3 -0
- data/lib/vedeu/borders/dsl.rb +1 -1
- data/lib/vedeu/borders/refresh.rb +1 -1
- data/lib/vedeu/borders/repository.rb +0 -2
- data/lib/vedeu/buffers/buffer.rb +1 -0
- data/lib/vedeu/buffers/repository.rb +0 -2
- data/lib/vedeu/buffers/view.rb +3 -3
- data/lib/vedeu/cells/empty.rb +3 -0
- data/lib/vedeu/colours/background.rb +3 -8
- data/lib/vedeu/colours/foreground.rb +3 -8
- data/lib/vedeu/configuration/api.rb +1 -1
- data/lib/vedeu/configuration/configuration.rb +3 -2
- data/lib/vedeu/cursors/cursor.rb +1 -1
- data/lib/vedeu/cursors/repository.rb +0 -2
- data/lib/vedeu/dsl/border.rb +1 -1
- data/lib/vedeu/dsl/dsl.rb +1 -1
- data/lib/vedeu/dsl/elements.rb +4 -4
- data/lib/vedeu/dsl/geometry.rb +2 -2
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/use.rb +1 -21
- data/lib/vedeu/dsl/view.rb +3 -13
- data/lib/vedeu/dsl/views.rb +15 -18
- data/lib/vedeu/editor/lines.rb +1 -1
- data/lib/vedeu/editor/repository.rb +0 -2
- data/lib/vedeu/esc/background.rb +17 -17
- data/lib/vedeu/esc/colours.rb +2 -2
- data/lib/vedeu/esc/esc.rb +1 -1
- data/lib/vedeu/esc/foreground.rb +17 -17
- data/lib/vedeu/events/event.rb +1 -3
- data/lib/vedeu/events/repository.rb +0 -2
- data/lib/vedeu/geometries/dsl/dsl.rb +18 -183
- data/lib/vedeu/geometries/move.rb +34 -49
- data/lib/vedeu/geometries/position.rb +1 -1
- data/lib/vedeu/geometries/repository.rb +0 -2
- data/lib/vedeu/groups/dsl.rb +1 -1
- data/lib/vedeu/groups/repository.rb +0 -2
- data/lib/vedeu/input/dsl.rb +2 -3
- data/lib/vedeu/input/key.rb +1 -1
- data/lib/vedeu/input/repository.rb +0 -2
- data/lib/vedeu/interfaces/dsl.rb +2 -3
- data/lib/vedeu/interfaces/interface.rb +3 -0
- data/lib/vedeu/interfaces/null.rb +3 -0
- data/lib/vedeu/interfaces/repository.rb +0 -2
- data/lib/vedeu/logging/debug.rb +1 -1
- data/lib/vedeu/logging/log.rb +19 -5
- data/lib/vedeu/logging/timer.rb +2 -2
- data/lib/vedeu/menus/dsl.rb +2 -3
- data/lib/vedeu/menus/repository.rb +0 -2
- data/lib/vedeu/models/page.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/output/compressor_cache.rb +10 -4
- data/lib/vedeu/output/compressors/simple.rb +7 -3
- data/lib/vedeu/output/write.rb +3 -0
- data/lib/vedeu/presentation/colour.rb +1 -1
- data/lib/vedeu/presentation/position.rb +1 -1
- data/lib/vedeu/presentation/presentation.rb +0 -4
- data/lib/vedeu/presentation/styles.rb +1 -1
- data/lib/vedeu/renderers/all.rb +4 -4
- data/lib/vedeu/repositories/assemblage.rb +2 -2
- data/lib/vedeu/repositories/model.rb +2 -6
- data/lib/vedeu/repositories/registerable.rb +10 -0
- data/lib/vedeu/repositories/store.rb +1 -1
- data/lib/vedeu/runtime/application.rb +3 -3
- data/lib/vedeu/runtime/launcher.rb +1 -1
- data/lib/vedeu/templating/helpers.rb +4 -4
- data/lib/vedeu/terminal/terminal.rb +2 -2
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/composition.rb +3 -0
- data/lib/vedeu/views/line.rb +3 -0
- data/lib/vedeu/views/stream.rb +3 -0
- data/lib/vedeu/views/view.rb +3 -0
- data/lib/vedeu.rb +3 -0
- data/test/lib/vedeu/borders/repository_test.rb +0 -2
- data/test/lib/vedeu/buffers/repository_test.rb +0 -2
- data/test/lib/vedeu/cursors/repository_test.rb +0 -2
- data/test/lib/vedeu/dsl/border_test.rb +26 -16
- data/test/lib/vedeu/editor/repository_test.rb +0 -2
- data/test/lib/vedeu/events/repository_test.rb +0 -2
- data/test/lib/vedeu/geometries/repository_test.rb +0 -4
- data/test/lib/vedeu/groups/repository_test.rb +0 -2
- data/test/lib/vedeu/input/repository_test.rb +0 -2
- data/test/lib/vedeu/interfaces/repository_test.rb +0 -2
- data/test/lib/vedeu/menus/repository_test.rb +0 -2
- data/test/lib/vedeu/presentation/colour_test.rb +6 -0
- data/test/lib/vedeu/presentation/position_test.rb +2 -0
- data/test/lib/vedeu/presentation/presentation_test.rb +10 -1
- data/test/lib/vedeu/presentation/styles_test.rb +6 -0
- data/test/lib/vedeu/repositories/registerable_test.rb +11 -1
- data/test/support/examples/material_colours_app.rb +0 -93
- metadata +5 -2
data/integrations/test_runner.rb
CHANGED
|
@@ -7,21 +7,21 @@ class TestRunner
|
|
|
7
7
|
|
|
8
8
|
# @param (see #initialize)
|
|
9
9
|
# @return [void]
|
|
10
|
-
def self.result(testcase,
|
|
11
|
-
new(testcase,
|
|
10
|
+
def self.result(testcase, filename)
|
|
11
|
+
new(testcase, filename).result
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# @param testcase [String]
|
|
15
|
-
# @param
|
|
15
|
+
# @param filename [String]
|
|
16
16
|
# @return [TestRunner]
|
|
17
|
-
def initialize(testcase,
|
|
17
|
+
def initialize(testcase, filename)
|
|
18
18
|
@testcase = testcase
|
|
19
|
-
@
|
|
19
|
+
@filename = filename
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @return [void]
|
|
23
23
|
def result
|
|
24
|
-
print "\e[36m#{
|
|
24
|
+
print "\e[36m#{filename}: "
|
|
25
25
|
if expected == actual
|
|
26
26
|
print "\e[32mPassed.\e[39m\n"
|
|
27
27
|
exit 0;
|
|
@@ -41,20 +41,30 @@ class TestRunner
|
|
|
41
41
|
# @return [String]
|
|
42
42
|
attr_reader :testcase
|
|
43
43
|
|
|
44
|
-
# @!attribute [r]
|
|
44
|
+
# @!attribute [r] filename
|
|
45
45
|
# @return [String]
|
|
46
|
-
attr_reader :
|
|
46
|
+
attr_reader :filename
|
|
47
47
|
|
|
48
48
|
private
|
|
49
49
|
|
|
50
50
|
# @return [String]
|
|
51
51
|
def actual
|
|
52
|
-
File.read(
|
|
52
|
+
@_actual ||= File.read(actual_path)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
# @return [String]
|
|
56
56
|
def expected
|
|
57
|
-
File.read(File.expand_path(
|
|
57
|
+
@_expected ||= File.read(File.expand_path(expected_path, filename))
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @return [String]
|
|
61
|
+
def actual_path
|
|
62
|
+
"/tmp/#{testcase}.out"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @return [String]
|
|
66
|
+
def expected_path
|
|
67
|
+
"../expected/#{testcase}.out"
|
|
58
68
|
end
|
|
59
69
|
|
|
60
70
|
end # TestRunner
|
data/lib/vedeu/borders/border.rb
CHANGED
|
@@ -21,6 +21,9 @@ module Vedeu
|
|
|
21
21
|
extend Forwardable
|
|
22
22
|
include Vedeu::Repositories::Model
|
|
23
23
|
include Vedeu::Presentation
|
|
24
|
+
include Vedeu::Presentation::Colour
|
|
25
|
+
include Vedeu::Presentation::Position
|
|
26
|
+
include Vedeu::Presentation::Styles
|
|
24
27
|
|
|
25
28
|
# @!attribute [w] bottom_left
|
|
26
29
|
# @return [String] The character to be used for the bottom left
|
data/lib/vedeu/borders/dsl.rb
CHANGED
data/lib/vedeu/buffers/buffer.rb
CHANGED
data/lib/vedeu/buffers/view.rb
CHANGED
|
@@ -10,9 +10,9 @@ module Vedeu
|
|
|
10
10
|
#
|
|
11
11
|
class View
|
|
12
12
|
|
|
13
|
-
include Vedeu::Repositories::Defaults
|
|
14
|
-
include Enumerable
|
|
15
13
|
extend Forwardable
|
|
14
|
+
include Enumerable
|
|
15
|
+
include Vedeu::Repositories::Defaults
|
|
16
16
|
|
|
17
17
|
def_delegators :geometry,
|
|
18
18
|
:bordered_height,
|
|
@@ -31,7 +31,7 @@ module Vedeu
|
|
|
31
31
|
|
|
32
32
|
# Provides iteration over the buffer.
|
|
33
33
|
#
|
|
34
|
-
# @
|
|
34
|
+
# @macro param_block
|
|
35
35
|
# @return [Enumerator]
|
|
36
36
|
def each(&block)
|
|
37
37
|
current.each(&block)
|
data/lib/vedeu/cells/empty.rb
CHANGED
|
@@ -19,15 +19,10 @@ module Vedeu
|
|
|
19
19
|
|
|
20
20
|
# @return [String]
|
|
21
21
|
def to_ast
|
|
22
|
-
return ''
|
|
22
|
+
return '' unless background?
|
|
23
|
+
return ':bg' unless rgb?
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
":bg_#{colour.to_s.slice(1..-1)}"
|
|
26
|
-
|
|
27
|
-
else
|
|
28
|
-
':bg'
|
|
29
|
-
|
|
30
|
-
end
|
|
25
|
+
":bg_#{colour.to_s.slice(1..-1)}"
|
|
31
26
|
end
|
|
32
27
|
|
|
33
28
|
# @return [Hash<Symbol => String>]
|
|
@@ -19,15 +19,10 @@ module Vedeu
|
|
|
19
19
|
|
|
20
20
|
# @return [String]
|
|
21
21
|
def to_ast
|
|
22
|
-
return ''
|
|
22
|
+
return '' unless foreground?
|
|
23
|
+
return ':fg' unless rgb?
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
":fg_#{colour.to_s.slice(1..-1)}"
|
|
26
|
-
|
|
27
|
-
else
|
|
28
|
-
':fg'
|
|
29
|
-
|
|
30
|
-
end
|
|
25
|
+
":fg_#{colour.to_s.slice(1..-1)}"
|
|
31
26
|
end
|
|
32
27
|
|
|
33
28
|
# @return [Hash<Symbol => String>]
|
|
@@ -43,6 +43,7 @@ module Vedeu
|
|
|
43
43
|
yellow: [:light_yellow, :yellow],
|
|
44
44
|
}.freeze
|
|
45
45
|
|
|
46
|
+
# @return [Array<Symbol>]
|
|
46
47
|
LOG_TYPES_KEYS = Vedeu::LOG_TYPES.keys.freeze
|
|
47
48
|
|
|
48
49
|
# Allows the customisation of Vedeu's behaviour through the
|
|
@@ -87,7 +88,7 @@ module Vedeu
|
|
|
87
88
|
# @option opts stdin [File|IO]
|
|
88
89
|
# @option opts stdout [File|IO]
|
|
89
90
|
# @option opts stderr [File|IO]
|
|
90
|
-
# @
|
|
91
|
+
# @macro param_block
|
|
91
92
|
# @return [Hash<Symbol => void>]
|
|
92
93
|
def configure(opts = {}, &block)
|
|
93
94
|
instance.configure(opts, &block)
|
|
@@ -387,7 +388,7 @@ module Vedeu
|
|
|
387
388
|
# Set up default configuration and then allow the client
|
|
388
389
|
# application to modify it via the configuration API.
|
|
389
390
|
#
|
|
390
|
-
# @
|
|
391
|
+
# @macro param_block
|
|
391
392
|
# @return [Hash<Symbol => void>]
|
|
392
393
|
def configure(opts = {}, &block)
|
|
393
394
|
@options.merge!(opts)
|
data/lib/vedeu/cursors/cursor.rb
CHANGED
|
@@ -156,7 +156,7 @@ module Vedeu
|
|
|
156
156
|
# visibility. When passed a block, will position the cursor,
|
|
157
157
|
# yield and return the original position.
|
|
158
158
|
#
|
|
159
|
-
# @
|
|
159
|
+
# @macro param_block
|
|
160
160
|
# @return [String]
|
|
161
161
|
def to_s(&block)
|
|
162
162
|
return escape_sequence.to_s unless block_given?
|
data/lib/vedeu/dsl/border.rb
CHANGED
data/lib/vedeu/dsl/dsl.rb
CHANGED
|
@@ -61,7 +61,7 @@ module Vedeu
|
|
|
61
61
|
# @param method [Symbol] The name of the method sought.
|
|
62
62
|
# @param args [Array] The arguments which the method was to be
|
|
63
63
|
# invoked with.
|
|
64
|
-
# @
|
|
64
|
+
# @macro param_block
|
|
65
65
|
# @return [void]
|
|
66
66
|
def method_missing(method, *args, &block)
|
|
67
67
|
Vedeu.log(type: :debug,
|
data/lib/vedeu/dsl/elements.rb
CHANGED
|
@@ -59,7 +59,7 @@ module Vedeu
|
|
|
59
59
|
# end
|
|
60
60
|
# end
|
|
61
61
|
#
|
|
62
|
-
# @
|
|
62
|
+
# @macro param_block
|
|
63
63
|
# @macro raise_requires_block
|
|
64
64
|
# @macro raise_fatal
|
|
65
65
|
# @return [void]
|
|
@@ -112,7 +112,7 @@ module Vedeu
|
|
|
112
112
|
# block is given.
|
|
113
113
|
# @param opts [Hash]
|
|
114
114
|
# @option opts ... [void]
|
|
115
|
-
# @
|
|
115
|
+
# @macro param_block
|
|
116
116
|
# @macro raise_fatal
|
|
117
117
|
# @return [void]
|
|
118
118
|
def line(value = '', opts = {}, &block)
|
|
@@ -147,7 +147,7 @@ module Vedeu
|
|
|
147
147
|
# block is given.
|
|
148
148
|
# @param opts [Hash]
|
|
149
149
|
# @option opts ... [void]
|
|
150
|
-
# @
|
|
150
|
+
# @macro param_block
|
|
151
151
|
# @macro raise_fatal
|
|
152
152
|
# @return [void]
|
|
153
153
|
def stream(value = '', opts = {}, &block)
|
|
@@ -292,7 +292,7 @@ module Vedeu
|
|
|
292
292
|
|
|
293
293
|
private
|
|
294
294
|
|
|
295
|
-
# @
|
|
295
|
+
# @macro param_block
|
|
296
296
|
# @macro raise_requires_block
|
|
297
297
|
# @return [NilClass]
|
|
298
298
|
def requires_block!(&block)
|
data/lib/vedeu/dsl/geometry.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Vedeu
|
|
|
15
15
|
|
|
16
16
|
# {include:file:docs/dsl/by_method/geometry.md}
|
|
17
17
|
# @macro param_name
|
|
18
|
-
# @
|
|
18
|
+
# @macro param_block
|
|
19
19
|
# @macro raise_requires_block
|
|
20
20
|
# @macro raise_missing_required
|
|
21
21
|
# @return [Vedeu::Geometries::Geometry]
|
|
@@ -46,7 +46,7 @@ module Vedeu
|
|
|
46
46
|
|
|
47
47
|
# {include:file:docs/dsl/by_method/geometry.md}
|
|
48
48
|
# @macro param_name
|
|
49
|
-
# @
|
|
49
|
+
# @macro param_block
|
|
50
50
|
# @macro raise_requires_block
|
|
51
51
|
# @macro raise_missing_required
|
|
52
52
|
# @return [Vedeu::Geometries::Geometry]
|
data/lib/vedeu/dsl/use.rb
CHANGED
|
@@ -8,27 +8,7 @@ module Vedeu
|
|
|
8
8
|
#
|
|
9
9
|
module Use
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# This DSL method provides access to a stored model by name.
|
|
14
|
-
# You can then request an attribute of that model for use within
|
|
15
|
-
# the current model. The models which current support this are
|
|
16
|
-
# Border, Geometry and Interface.
|
|
17
|
-
#
|
|
18
|
-
# @example
|
|
19
|
-
# # Here the character used for :my_border is used in
|
|
20
|
-
# # :my_other_border.
|
|
21
|
-
# Vedeu.border :my_other_border do
|
|
22
|
-
# top_right use(:my_border).top_right
|
|
23
|
-
# end
|
|
24
|
-
#
|
|
25
|
-
# @note
|
|
26
|
-
# - Only models of the same repository can be used in this
|
|
27
|
-
# way.
|
|
28
|
-
# - If the stored model cannot be found, a ModelNotFound
|
|
29
|
-
# exception may be raised, or the request for an attribute
|
|
30
|
-
# may raise a NoMethodError exception.
|
|
31
|
-
#
|
|
11
|
+
# {include:file:docs/dsl/by_method/use.md}
|
|
32
12
|
# @macro param_name
|
|
33
13
|
# @raise
|
|
34
14
|
# [Vedeu::Error::ModelNotFound|Vedeu::Error::NoMethodError]
|
data/lib/vedeu/dsl/view.rb
CHANGED
|
@@ -47,8 +47,7 @@ module Vedeu
|
|
|
47
47
|
|
|
48
48
|
# {include:file:docs/dsl/by_method/view.md}
|
|
49
49
|
# @macro param_name
|
|
50
|
-
# @
|
|
51
|
-
# view.
|
|
50
|
+
# @macro param_block
|
|
52
51
|
# @macro raise_requires_block
|
|
53
52
|
# @macro raise_missing_required
|
|
54
53
|
# @return [Vedeu::Views::Views<Vedeu::Views::View>]
|
|
@@ -63,17 +62,7 @@ module Vedeu
|
|
|
63
62
|
model.add(new_model)
|
|
64
63
|
end
|
|
65
64
|
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
# @example
|
|
69
|
-
# Vedeu.renders do
|
|
70
|
-
# template_for(:my_interface,
|
|
71
|
-
# '/path/to/template.erb',
|
|
72
|
-
# @some_object, options)
|
|
73
|
-
# end
|
|
74
|
-
#
|
|
75
|
-
# @todo More documentation required.
|
|
76
|
-
#
|
|
65
|
+
# {include:file:docs/dsl/by_method/template_for.md}
|
|
77
66
|
# @macro param_name
|
|
78
67
|
# @param filename [String] The filename (including path) to the
|
|
79
68
|
# template to be used. Yoy can use `File.dirname(__FILE__)` to
|
|
@@ -84,6 +73,7 @@ module Vedeu
|
|
|
84
73
|
# {Vedeu::DSL::Wordwrap}
|
|
85
74
|
# @macro raise_missing_required
|
|
86
75
|
# @return [Vedeu::Views::Views<Vedeu::Views::View>]
|
|
76
|
+
# @todo More documentation required.
|
|
87
77
|
def template_for(name, filename, object = nil, options = {})
|
|
88
78
|
raise Vedeu::Error::MissingRequired,
|
|
89
79
|
'Cannot render template without the name of the ' \
|
data/lib/vedeu/dsl/views.rb
CHANGED
|
@@ -94,9 +94,7 @@ module Vedeu
|
|
|
94
94
|
class << self
|
|
95
95
|
|
|
96
96
|
# {include:file:docs/dsl/by_method/renders.md}
|
|
97
|
-
# @
|
|
98
|
-
# render. Typically includes `view` with associated
|
|
99
|
-
# sub-directives.
|
|
97
|
+
# @macro param_block
|
|
100
98
|
# @macro raise_requires_block
|
|
101
99
|
# @return [Vedeu::Views::Composition]
|
|
102
100
|
def renders(&block)
|
|
@@ -107,9 +105,7 @@ module Vedeu
|
|
|
107
105
|
alias render renders
|
|
108
106
|
|
|
109
107
|
# {include:file:docs/dsl/by_method/views.md}
|
|
110
|
-
# @
|
|
111
|
-
# render. Typically includes `view` with associated
|
|
112
|
-
# sub-directives.
|
|
108
|
+
# @macro param_block
|
|
113
109
|
# @macro raise_requires_block
|
|
114
110
|
# @return [Vedeu::Views::Composition]
|
|
115
111
|
def views(&block)
|
|
@@ -120,14 +116,17 @@ module Vedeu
|
|
|
120
116
|
|
|
121
117
|
private
|
|
122
118
|
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
119
|
+
# Handles the directives you wish to send to render. Typically
|
|
120
|
+
# includes `view` with associated sub-directives. The binding
|
|
121
|
+
# of the block is also accessed so that we can ascertain the
|
|
122
|
+
# calling client application class, this is so that if there
|
|
123
|
+
# methods being called inside your views, Vedeu will redirect
|
|
124
|
+
# that call to the client class instance instead. (This
|
|
125
|
+
# actually occurs when Vedeu rescues from method_missing. See
|
|
126
|
+
# {Vedeu::DSL}.)
|
|
127
|
+
#
|
|
128
|
+
# @macro param_block
|
|
129
|
+
# @return [void]
|
|
131
130
|
def client_binding(&block)
|
|
132
131
|
eval('self', block.binding).tap do |client|
|
|
133
132
|
Vedeu.log(type: :debug,
|
|
@@ -139,10 +138,8 @@ module Vedeu
|
|
|
139
138
|
# one or more view {Vedeu::Views::View} objects.
|
|
140
139
|
#
|
|
141
140
|
# @param refresh [Boolean]
|
|
142
|
-
# @
|
|
143
|
-
#
|
|
144
|
-
# sub-directives.
|
|
145
|
-
# # @return [Vedeu::Views::Composition]
|
|
141
|
+
# @macro param_block
|
|
142
|
+
# @return [Vedeu::Views::Composition]
|
|
146
143
|
def composition(refresh = false, &block)
|
|
147
144
|
attrs = {
|
|
148
145
|
client: client_binding(&block),
|
data/lib/vedeu/editor/lines.rb
CHANGED
data/lib/vedeu/esc/background.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Vedeu
|
|
|
12
12
|
|
|
13
13
|
extend self
|
|
14
14
|
|
|
15
|
-
# @
|
|
15
|
+
# @macro param_block
|
|
16
16
|
# @return [String]
|
|
17
17
|
def on_black(&block)
|
|
18
18
|
if block_given?
|
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
# @
|
|
27
|
+
# @macro param_block
|
|
28
28
|
# @return [String]
|
|
29
29
|
def on_red(&block)
|
|
30
30
|
if block_given?
|
|
@@ -36,7 +36,7 @@ module Vedeu
|
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
# @
|
|
39
|
+
# @macro param_block
|
|
40
40
|
# @return [String]
|
|
41
41
|
def on_green(&block)
|
|
42
42
|
if block_given?
|
|
@@ -48,7 +48,7 @@ module Vedeu
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# @
|
|
51
|
+
# @macro param_block
|
|
52
52
|
# @return [String]
|
|
53
53
|
def on_yellow(&block)
|
|
54
54
|
if block_given?
|
|
@@ -60,7 +60,7 @@ module Vedeu
|
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
# @
|
|
63
|
+
# @macro param_block
|
|
64
64
|
# @return [String]
|
|
65
65
|
def on_blue(&block)
|
|
66
66
|
if block_given?
|
|
@@ -72,7 +72,7 @@ module Vedeu
|
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
# @
|
|
75
|
+
# @macro param_block
|
|
76
76
|
# @return [String]
|
|
77
77
|
def on_magenta(&block)
|
|
78
78
|
if block_given?
|
|
@@ -84,7 +84,7 @@ module Vedeu
|
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
-
# @
|
|
87
|
+
# @macro param_block
|
|
88
88
|
# @return [String]
|
|
89
89
|
def on_cyan(&block)
|
|
90
90
|
if block_given?
|
|
@@ -96,7 +96,7 @@ module Vedeu
|
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
-
# @
|
|
99
|
+
# @macro param_block
|
|
100
100
|
# @return [String]
|
|
101
101
|
def on_light_grey(&block)
|
|
102
102
|
if block_given?
|
|
@@ -108,7 +108,7 @@ module Vedeu
|
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
# @
|
|
111
|
+
# @macro param_block
|
|
112
112
|
# @return [String]
|
|
113
113
|
def on_default(&block)
|
|
114
114
|
if block_given?
|
|
@@ -120,7 +120,7 @@ module Vedeu
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
# @
|
|
123
|
+
# @macro param_block
|
|
124
124
|
# @return [String]
|
|
125
125
|
def on_dark_grey(&block)
|
|
126
126
|
if block_given?
|
|
@@ -132,7 +132,7 @@ module Vedeu
|
|
|
132
132
|
end
|
|
133
133
|
end
|
|
134
134
|
|
|
135
|
-
# @
|
|
135
|
+
# @macro param_block
|
|
136
136
|
# @return [String]
|
|
137
137
|
def on_light_red(&block)
|
|
138
138
|
if block_given?
|
|
@@ -144,7 +144,7 @@ module Vedeu
|
|
|
144
144
|
end
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
-
# @
|
|
147
|
+
# @macro param_block
|
|
148
148
|
# @return [String]
|
|
149
149
|
def on_light_green(&block)
|
|
150
150
|
if block_given?
|
|
@@ -156,7 +156,7 @@ module Vedeu
|
|
|
156
156
|
end
|
|
157
157
|
end
|
|
158
158
|
|
|
159
|
-
# @
|
|
159
|
+
# @macro param_block
|
|
160
160
|
# @return [String]
|
|
161
161
|
def on_light_yellow(&block)
|
|
162
162
|
if block_given?
|
|
@@ -168,7 +168,7 @@ module Vedeu
|
|
|
168
168
|
end
|
|
169
169
|
end
|
|
170
170
|
|
|
171
|
-
# @
|
|
171
|
+
# @macro param_block
|
|
172
172
|
# @return [String]
|
|
173
173
|
def on_light_blue(&block)
|
|
174
174
|
if block_given?
|
|
@@ -180,7 +180,7 @@ module Vedeu
|
|
|
180
180
|
end
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
-
# @
|
|
183
|
+
# @macro param_block
|
|
184
184
|
# @return [String]
|
|
185
185
|
def on_light_magenta(&block)
|
|
186
186
|
if block_given?
|
|
@@ -192,7 +192,7 @@ module Vedeu
|
|
|
192
192
|
end
|
|
193
193
|
end
|
|
194
194
|
|
|
195
|
-
# @
|
|
195
|
+
# @macro param_block
|
|
196
196
|
# @return [String]
|
|
197
197
|
def on_light_cyan(&block)
|
|
198
198
|
if block_given?
|
|
@@ -204,7 +204,7 @@ module Vedeu
|
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
206
|
|
|
207
|
-
# @
|
|
207
|
+
# @macro param_block
|
|
208
208
|
# @return [String]
|
|
209
209
|
def on_white(&block)
|
|
210
210
|
if block_given?
|
data/lib/vedeu/esc/colours.rb
CHANGED
|
@@ -23,7 +23,7 @@ module Vedeu
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# @param named_colour [Symbol]
|
|
26
|
-
# @
|
|
26
|
+
# @macro param_block
|
|
27
27
|
# @return [String]
|
|
28
28
|
def background_colour(named_colour, &block)
|
|
29
29
|
return '' unless valid_name?(named_colour)
|
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# @param named_colour [Symbol]
|
|
35
|
-
# @
|
|
35
|
+
# @macro param_block
|
|
36
36
|
# @return [String]
|
|
37
37
|
def colour(named_colour, &block)
|
|
38
38
|
return '' unless valid_name?(named_colour)
|
data/lib/vedeu/esc/esc.rb
CHANGED