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/lib/vedeu/logging/debug.rb
CHANGED
|
@@ -37,7 +37,7 @@ module Vedeu
|
|
|
37
37
|
# {include:file:docs/dsl/by_method/profile.md}
|
|
38
38
|
# @param filename [String] Optional, and defaults to being
|
|
39
39
|
# written to the /tmp directory.
|
|
40
|
-
# @
|
|
40
|
+
# @macro param_block
|
|
41
41
|
# @macro raise_requires_block
|
|
42
42
|
# @return [void]
|
|
43
43
|
# @yieldreturn [void] The section of the application to profile.
|
data/lib/vedeu/logging/log.rb
CHANGED
|
@@ -99,12 +99,26 @@ module Vedeu
|
|
|
99
99
|
# @macro vedeu_logging_log_param_message
|
|
100
100
|
# @return [String]
|
|
101
101
|
def log_entry(type, message)
|
|
102
|
-
|
|
102
|
+
log_type(type) + log_message(type, message)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @param type [Symbol] The type of log message.
|
|
106
|
+
# @return [String]
|
|
107
|
+
def log_type(type)
|
|
108
|
+
Vedeu.esc.colour(colours(type)[0]) { "[#{type}]".ljust(11) }
|
|
109
|
+
end
|
|
103
110
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
# @param type [Symbol] The type of log message.
|
|
112
|
+
# @macro vedeu_logging_log_param_message
|
|
113
|
+
# @return [String]
|
|
114
|
+
def log_message(type, message)
|
|
115
|
+
Vedeu.esc.colour(colours(type)[1]) { message }
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# @param type [Symbol] The type of log message.
|
|
119
|
+
# @return [Array<Symbol>]
|
|
120
|
+
def colours(type)
|
|
121
|
+
Vedeu::LOG_TYPES.fetch(type, [:default, :default])
|
|
108
122
|
end
|
|
109
123
|
|
|
110
124
|
end # Eigenclass
|
data/lib/vedeu/logging/timer.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Vedeu
|
|
|
14
14
|
|
|
15
15
|
# {include:file:docs/dsl/by_method/timer.md}
|
|
16
16
|
# @param message [String]
|
|
17
|
-
# @
|
|
17
|
+
# @macro param_block
|
|
18
18
|
# @macro raise_requires_block
|
|
19
19
|
# @return [void] The return value of the executed block.
|
|
20
20
|
def timer(message = '', &block)
|
|
@@ -36,7 +36,7 @@ module Vedeu
|
|
|
36
36
|
# code took in milliseconds when debugging is enabled and a
|
|
37
37
|
# block was Useful for debugging performance.
|
|
38
38
|
#
|
|
39
|
-
# @
|
|
39
|
+
# @macro param_block
|
|
40
40
|
# @macro raise_requires_block
|
|
41
41
|
# @return [void|NilClass] The return value of the executed
|
|
42
42
|
# block if given, or nil if debugging is disabled.
|
data/lib/vedeu/menus/dsl.rb
CHANGED
|
@@ -18,8 +18,7 @@ module Vedeu
|
|
|
18
18
|
# within your application.
|
|
19
19
|
#
|
|
20
20
|
# @macro param_name
|
|
21
|
-
# @
|
|
22
|
-
# features of the menu.
|
|
21
|
+
# @macro param_block
|
|
23
22
|
#
|
|
24
23
|
# @example
|
|
25
24
|
# Vedeu.menu :my_interface do
|
|
@@ -49,7 +48,7 @@ module Vedeu
|
|
|
49
48
|
|
|
50
49
|
# Returns the client object which called the DSL method.
|
|
51
50
|
#
|
|
52
|
-
# @
|
|
51
|
+
# @macro param_block
|
|
53
52
|
# @return [Object]
|
|
54
53
|
def client(&block)
|
|
55
54
|
eval('self', block.binding)
|
data/lib/vedeu/models/page.rb
CHANGED
data/lib/vedeu/models/row.rb
CHANGED
|
@@ -17,9 +17,10 @@ module Vedeu
|
|
|
17
17
|
extend Vedeu::Repositories::Storage
|
|
18
18
|
|
|
19
19
|
# @param content [Array<void>]
|
|
20
|
+
# @param compression [Boolean]
|
|
20
21
|
# @return [String]
|
|
21
22
|
def cache(content, compression = false)
|
|
22
|
-
write(content) unless empty?(content) || cached?(content)
|
|
23
|
+
write(content, compression) unless empty?(content) || cached?(content)
|
|
23
24
|
|
|
24
25
|
compression ? read(:compress) : read(:uncompress)
|
|
25
26
|
end
|
|
@@ -78,13 +79,18 @@ module Vedeu
|
|
|
78
79
|
end
|
|
79
80
|
|
|
80
81
|
# @param content [Array<void>]
|
|
82
|
+
# @param compression [Boolean]
|
|
81
83
|
# @return [Hash<Symbol => Array<void>>]
|
|
82
|
-
def write(content)
|
|
84
|
+
def write(content, compression)
|
|
83
85
|
storage[:original] = content
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
if compression
|
|
88
|
+
storage[:compress] = compress(content)
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
else
|
|
91
|
+
storage[:uncompress] = uncompress(content)
|
|
92
|
+
|
|
93
|
+
end
|
|
88
94
|
end
|
|
89
95
|
|
|
90
96
|
end # CompressorCache
|
|
@@ -28,9 +28,7 @@ module Vedeu
|
|
|
28
28
|
|
|
29
29
|
# @return [String]
|
|
30
30
|
def with
|
|
31
|
-
Vedeu.log(type:
|
|
32
|
-
message: "No compression for #{original_size} objects -> " \
|
|
33
|
-
"#{compress_size} characters")
|
|
31
|
+
Vedeu.log(type: :compress, message: message)
|
|
34
32
|
|
|
35
33
|
compress
|
|
36
34
|
end
|
|
@@ -53,6 +51,12 @@ module Vedeu
|
|
|
53
51
|
compress.size
|
|
54
52
|
end
|
|
55
53
|
|
|
54
|
+
# @return [String]
|
|
55
|
+
def message
|
|
56
|
+
"No compression for #{original_size} objects " \
|
|
57
|
+
"-> #{compress_size} characters"
|
|
58
|
+
end
|
|
59
|
+
|
|
56
60
|
# @return [Fixnum]
|
|
57
61
|
def original_size
|
|
58
62
|
content.size
|
data/lib/vedeu/output/write.rb
CHANGED
|
@@ -4,10 +4,6 @@ module Vedeu
|
|
|
4
4
|
|
|
5
5
|
module Presentation
|
|
6
6
|
|
|
7
|
-
include Vedeu::Presentation::Colour
|
|
8
|
-
include Vedeu::Presentation::Position
|
|
9
|
-
include Vedeu::Presentation::Styles
|
|
10
|
-
|
|
11
7
|
# Converts the colours and styles to escape sequences, and when
|
|
12
8
|
# the parent model has previously set the colour and style,
|
|
13
9
|
# reverts back to that for consistent formatting.
|
|
@@ -57,7 +57,7 @@ module Vedeu
|
|
|
57
57
|
# Renders the style attributes of the receiver and yields (to
|
|
58
58
|
# then render the next model, or finally, the content).
|
|
59
59
|
#
|
|
60
|
-
# @
|
|
60
|
+
# @macro param_block
|
|
61
61
|
# @return [String]
|
|
62
62
|
def render_style(&block)
|
|
63
63
|
"#{style}#{yield}"
|
data/lib/vedeu/renderers/all.rb
CHANGED
|
@@ -73,7 +73,7 @@ module Vedeu
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
# @param renderer [void]
|
|
76
|
-
# @
|
|
76
|
+
# @macro param_block
|
|
77
77
|
def perform(renderer, &block)
|
|
78
78
|
if Vedeu.config.threaded?
|
|
79
79
|
threaded(renderer) { yield }
|
|
@@ -89,7 +89,7 @@ module Vedeu
|
|
|
89
89
|
@_mutex ||= Mutex.new
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
# @
|
|
92
|
+
# @macro param_block
|
|
93
93
|
# @return [void]
|
|
94
94
|
def threaded(renderer, &block)
|
|
95
95
|
Thread.new(renderer) do
|
|
@@ -101,7 +101,7 @@ module Vedeu
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
# @
|
|
104
|
+
# @macro param_block
|
|
105
105
|
# @return [void]
|
|
106
106
|
def toggle_cursor(&block)
|
|
107
107
|
Vedeu.trigger(:_hide_cursor_)
|
|
@@ -111,7 +111,7 @@ module Vedeu
|
|
|
111
111
|
Vedeu.trigger(:_show_cursor_)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
# @
|
|
114
|
+
# @macro param_block
|
|
115
115
|
# @return [void]
|
|
116
116
|
def unthreaded(&block)
|
|
117
117
|
toggle_cursor do
|
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
|
24
24
|
# Returns a boolean indicating whether the collection is not
|
|
25
25
|
# empty.
|
|
26
26
|
#
|
|
27
|
-
# @
|
|
27
|
+
# @macro param_block
|
|
28
28
|
# @return [Boolean]
|
|
29
29
|
def any?(&block)
|
|
30
30
|
collection.any?(&block)
|
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
|
32
32
|
|
|
33
33
|
# Provides iteration over the collection.
|
|
34
34
|
#
|
|
35
|
-
# @
|
|
35
|
+
# @macro param_block
|
|
36
36
|
# @return [Enumerator]
|
|
37
37
|
def each(&block)
|
|
38
38
|
collection.each(&block)
|
|
@@ -9,9 +9,6 @@ module Vedeu
|
|
|
9
9
|
#
|
|
10
10
|
module Model
|
|
11
11
|
|
|
12
|
-
# This is used by including classes.
|
|
13
|
-
include Vedeu::Common
|
|
14
|
-
|
|
15
12
|
# @!attribute [rw] repository
|
|
16
13
|
# @return [Vedeu::Repositories::Repository]
|
|
17
14
|
attr_accessor :repository
|
|
@@ -29,7 +26,7 @@ module Vedeu
|
|
|
29
26
|
#
|
|
30
27
|
# @param attributes [Hash] A collection of attributes specific
|
|
31
28
|
# to the model.
|
|
32
|
-
# @
|
|
29
|
+
# @macro param_block
|
|
33
30
|
# @return [Object] An instance of the model.
|
|
34
31
|
def build(attributes = {}, &block)
|
|
35
32
|
model = new(attributes)
|
|
@@ -56,8 +53,7 @@ module Vedeu
|
|
|
56
53
|
#
|
|
57
54
|
# @param attributes [Hash] A collection of attributes specific
|
|
58
55
|
# to the model.
|
|
59
|
-
# @
|
|
60
|
-
# storing.
|
|
56
|
+
# @macro param_block
|
|
61
57
|
# @return [Object] An instance of the model.
|
|
62
58
|
def store(attributes = {}, &block)
|
|
63
59
|
new(attributes).store(&block)
|
|
@@ -53,6 +53,16 @@ module Vedeu
|
|
|
53
53
|
def repository
|
|
54
54
|
@models ||= reset!
|
|
55
55
|
end
|
|
56
|
+
alias borders repository
|
|
57
|
+
alias buffers repository
|
|
58
|
+
alias cursors repository
|
|
59
|
+
alias documents repository
|
|
60
|
+
alias events repository
|
|
61
|
+
alias geometries repository
|
|
62
|
+
alias groups repository
|
|
63
|
+
alias interfaces repository
|
|
64
|
+
alias keymaps repository
|
|
65
|
+
alias menus repository
|
|
56
66
|
|
|
57
67
|
# Remove all stored models from the repository.
|
|
58
68
|
#
|
|
@@ -79,7 +79,7 @@ module Vedeu
|
|
|
79
79
|
# Runs the application loop either once, or forever (exceptions
|
|
80
80
|
# and signals permitting).
|
|
81
81
|
#
|
|
82
|
-
# @
|
|
82
|
+
# @macro param_block
|
|
83
83
|
# @return [void]
|
|
84
84
|
def runner(&block)
|
|
85
85
|
if Vedeu.config.once?
|
|
@@ -115,7 +115,7 @@ module Vedeu
|
|
|
115
115
|
# stopped when an uncaught exception occurs or when either the
|
|
116
116
|
# `:_mode_switch_` or `:_exit_` event is triggered.
|
|
117
117
|
#
|
|
118
|
-
# @
|
|
118
|
+
# @macro param_block
|
|
119
119
|
# @return [void]
|
|
120
120
|
def run_many(&block)
|
|
121
121
|
Vedeu::Runtime::MainLoop.start! { yield }
|
|
@@ -124,7 +124,7 @@ module Vedeu
|
|
|
124
124
|
Vedeu::Runtime::Application.restart
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
-
# @
|
|
127
|
+
# @macro param_block
|
|
128
128
|
# @return [void]
|
|
129
129
|
def run_once(&block)
|
|
130
130
|
# Vedeu.debug(binding)
|
|
@@ -11,7 +11,7 @@ module Vedeu
|
|
|
11
11
|
include Vedeu::View
|
|
12
12
|
|
|
13
13
|
# @param value [String] The HTML/CSS colour.
|
|
14
|
-
# @
|
|
14
|
+
# @macro param_block
|
|
15
15
|
# @macro raise_requires_block
|
|
16
16
|
# @return [Vedeu::Views::Stream]
|
|
17
17
|
def background(value, &block)
|
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
|
24
24
|
# colour.
|
|
25
25
|
# @option attributes background [String] The HTML/CSS background
|
|
26
26
|
# colour.
|
|
27
|
-
# @
|
|
27
|
+
# @macro param_block
|
|
28
28
|
# @macro raise_requires_block
|
|
29
29
|
# @return [Vedeu::Views::Stream]
|
|
30
30
|
def colour(attributes = {}, &block)
|
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# @param value [String] The HTML/CSS colour.
|
|
35
|
-
# @
|
|
35
|
+
# @macro param_block
|
|
36
36
|
# @macro raise_requires_block
|
|
37
37
|
# @return [Vedeu::Views::Stream]
|
|
38
38
|
def foreground(value, &block)
|
|
@@ -41,7 +41,7 @@ module Vedeu
|
|
|
41
41
|
alias fg foreground
|
|
42
42
|
|
|
43
43
|
# @param value [Symbol]
|
|
44
|
-
# @
|
|
44
|
+
# @macro param_block
|
|
45
45
|
# @return [Vedeu::Views::Stream]
|
|
46
46
|
def style(value, &block)
|
|
47
47
|
define_stream(style: value, &block)
|
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
|
24
24
|
# exit, attempts to restore the screen. See
|
|
25
25
|
# {Vedeu::Terminal#restore_screen}.
|
|
26
26
|
#
|
|
27
|
-
# @
|
|
27
|
+
# @macro param_block
|
|
28
28
|
# @macro raise_requires_block
|
|
29
29
|
# @return [Array]
|
|
30
30
|
def open(&block)
|
|
@@ -65,7 +65,7 @@ module Vedeu
|
|
|
65
65
|
true
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
# @
|
|
68
|
+
# @macro param_block
|
|
69
69
|
# @param mode [Symbol]
|
|
70
70
|
# @return [void]
|
|
71
71
|
def initialize_screen(mode, &block)
|
data/lib/vedeu/version.rb
CHANGED
|
@@ -12,6 +12,9 @@ module Vedeu
|
|
|
12
12
|
|
|
13
13
|
include Vedeu::Repositories::Model
|
|
14
14
|
include Vedeu::Presentation
|
|
15
|
+
include Vedeu::Presentation::Colour
|
|
16
|
+
include Vedeu::Presentation::Position
|
|
17
|
+
include Vedeu::Presentation::Styles
|
|
15
18
|
include Vedeu::Views::Value
|
|
16
19
|
|
|
17
20
|
collection Vedeu::Views::Views
|
data/lib/vedeu/views/line.rb
CHANGED
|
@@ -27,6 +27,9 @@ module Vedeu
|
|
|
27
27
|
include Vedeu::Views::DefaultAttributes
|
|
28
28
|
include Vedeu::Repositories::Model
|
|
29
29
|
include Vedeu::Presentation
|
|
30
|
+
include Vedeu::Presentation::Colour
|
|
31
|
+
include Vedeu::Presentation::Position
|
|
32
|
+
include Vedeu::Presentation::Styles
|
|
30
33
|
include Vedeu::Views::Value
|
|
31
34
|
|
|
32
35
|
collection Vedeu::Views::Streams
|
data/lib/vedeu/views/stream.rb
CHANGED
|
@@ -28,6 +28,9 @@ module Vedeu
|
|
|
28
28
|
include Vedeu::Views::DefaultAttributes
|
|
29
29
|
include Vedeu::Repositories::Model
|
|
30
30
|
include Vedeu::Presentation
|
|
31
|
+
include Vedeu::Presentation::Colour
|
|
32
|
+
include Vedeu::Presentation::Position
|
|
33
|
+
include Vedeu::Presentation::Styles
|
|
31
34
|
|
|
32
35
|
include Vedeu::Views::Value
|
|
33
36
|
collection Vedeu::Views::Chars
|
data/lib/vedeu/views/view.rb
CHANGED
|
@@ -29,6 +29,9 @@ module Vedeu
|
|
|
29
29
|
extend Forwardable
|
|
30
30
|
include Vedeu::Repositories::Model
|
|
31
31
|
include Vedeu::Presentation
|
|
32
|
+
include Vedeu::Presentation::Colour
|
|
33
|
+
include Vedeu::Presentation::Position
|
|
34
|
+
include Vedeu::Presentation::Styles
|
|
32
35
|
include Vedeu::Views::Value
|
|
33
36
|
|
|
34
37
|
collection Vedeu::Views::Lines
|
data/lib/vedeu.rb
CHANGED
|
@@ -65,6 +65,9 @@ end # Vedeu
|
|
|
65
65
|
# Provide additional behaviour as singleton methods to the including
|
|
66
66
|
# class or module.
|
|
67
67
|
#
|
|
68
|
+
# @!macro [new] param_block
|
|
69
|
+
# @param block [Proc]
|
|
70
|
+
#
|
|
68
71
|
# @!macro [new] param_name
|
|
69
72
|
# @param name [NilClass|Symbol|String] The name of the model or
|
|
70
73
|
# target model to act upon. May default to `Vedeu.focus`.
|
|
@@ -8,6 +8,14 @@ module Vedeu
|
|
|
8
8
|
|
|
9
9
|
include Vedeu::DSL::Border
|
|
10
10
|
|
|
11
|
+
def model
|
|
12
|
+
self
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def name
|
|
16
|
+
:vedeu_dsl_border_test_class
|
|
17
|
+
end
|
|
18
|
+
|
|
11
19
|
end # DSLBorderTestClass
|
|
12
20
|
|
|
13
21
|
module DSL
|
|
@@ -16,7 +24,7 @@ module Vedeu
|
|
|
16
24
|
|
|
17
25
|
let(:described) { Vedeu::DSL::Border }
|
|
18
26
|
let(:included_described) { Vedeu::DSLBorderTestClass }
|
|
19
|
-
let(:instance) {
|
|
27
|
+
let(:instance) { included_described.new }
|
|
20
28
|
let(:_name) { :vedeu_dsl_border }
|
|
21
29
|
|
|
22
30
|
describe '.included' do
|
|
@@ -28,18 +36,6 @@ module Vedeu
|
|
|
28
36
|
describe '#border' do
|
|
29
37
|
subject { instance.border(_name) {} }
|
|
30
38
|
|
|
31
|
-
context 'when the name is not given' do
|
|
32
|
-
let(:_name) {}
|
|
33
|
-
|
|
34
|
-
it 'uses the name of the model' do
|
|
35
|
-
# @todo Add more tests.
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
context 'when the name is given' do
|
|
40
|
-
# @todo Add more tests.
|
|
41
|
-
end
|
|
42
|
-
|
|
43
39
|
context 'when the block is not given' do
|
|
44
40
|
subject { instance.border(_name) }
|
|
45
41
|
|
|
@@ -47,16 +43,30 @@ module Vedeu
|
|
|
47
43
|
end
|
|
48
44
|
|
|
49
45
|
context 'when the block is given' do
|
|
50
|
-
|
|
46
|
+
context 'when the name is not given' do
|
|
47
|
+
let(:_name) {}
|
|
48
|
+
|
|
49
|
+
it 'uses the name of the model' do
|
|
50
|
+
subject.must_be_instance_of(Vedeu::Borders::Border)
|
|
51
|
+
subject.name.must_equal(:vedeu_dsl_border_test_class)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
context 'when the name is given' do
|
|
56
|
+
it 'uses the given name' do
|
|
57
|
+
subject.must_be_instance_of(Vedeu::Borders::Border)
|
|
58
|
+
subject.name.must_equal(:vedeu_dsl_border)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
53
61
|
end
|
|
54
62
|
end
|
|
55
63
|
|
|
56
64
|
describe '#border!' do
|
|
57
65
|
subject { instance.border! }
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
it 'builds and stores a default border' do
|
|
68
|
+
subject.must_be_instance_of(Vedeu::Borders::Border)
|
|
69
|
+
end
|
|
60
70
|
end
|
|
61
71
|
|
|
62
72
|
end # Border
|