vedeu 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/all.rb +17 -103
- data/lib/vedeu/api/all.rb +15 -0
- data/lib/vedeu/api/internal.rb +4 -0
- data/lib/vedeu/application/all.rb +6 -0
- data/lib/vedeu/bindings/all.rb +32 -0
- data/lib/vedeu/bindings/bindings.rb +0 -14
- data/lib/vedeu/bindings/refresh.rb +8 -2
- data/lib/vedeu/bindings/system.rb +1 -0
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/repository.rb +1 -1
- data/lib/vedeu/buffers/buffer.rb +2 -4
- data/lib/vedeu/buffers/repository.rb +1 -1
- data/lib/vedeu/colours/background.rb +1 -1
- data/lib/vedeu/colours/backgrounds.rb +1 -1
- data/lib/vedeu/colours/foreground.rb +1 -1
- data/lib/vedeu/colours/foregrounds.rb +1 -1
- data/lib/vedeu/colours/translator.rb +4 -3
- data/lib/vedeu/configuration/api.rb +2 -1
- data/lib/vedeu/configuration/cli.rb +1 -1
- data/lib/vedeu/cursors/cursor.rb +26 -26
- data/lib/vedeu/cursors/repository.rb +1 -1
- data/lib/vedeu/distributed/all.rb +16 -0
- data/lib/vedeu/distributed/test_application.rb +3 -3
- data/lib/vedeu/dsl/all.rb +22 -0
- data/lib/vedeu/dsl/composition.rb +43 -40
- data/lib/vedeu/dsl/dsl.rb +6 -3
- data/lib/vedeu/dsl/group.rb +23 -16
- data/lib/vedeu/dsl/interface.rb +48 -38
- data/lib/vedeu/dsl/keymap.rb +6 -7
- data/lib/vedeu/dsl/line.rb +6 -3
- data/lib/vedeu/dsl/stream.rb +2 -1
- data/lib/vedeu/editor/cursor.rb +1 -3
- data/lib/vedeu/editor/document.rb +4 -5
- data/lib/vedeu/editor/documents.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -3
- data/lib/vedeu/editor/lines.rb +2 -3
- data/lib/vedeu/esc/all.rb +14 -0
- data/lib/vedeu/esc/colours.rb +8 -4
- data/lib/vedeu/esc/esc.rb +89 -84
- data/lib/vedeu/events/aliases.rb +1 -2
- data/lib/vedeu/events/collection.rb +1 -1
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/events/trigger.rb +11 -9
- data/lib/vedeu/geometry/dimension.rb +1 -3
- data/lib/vedeu/geometry/generic_coordinate.rb +1 -3
- data/lib/vedeu/geometry/geometry.rb +1 -1
- data/lib/vedeu/geometry/repository.rb +3 -3
- data/lib/vedeu/input/all.rb +3 -0
- data/lib/vedeu/input/keymap.rb +10 -11
- data/lib/vedeu/input/keymaps.rb +1 -1
- data/lib/vedeu/input/keys.rb +1 -1
- data/lib/vedeu/input/mapper.rb +14 -12
- data/lib/vedeu/logging/all.rb +3 -0
- data/lib/vedeu/logging/log.rb +4 -2
- data/lib/vedeu/menus/menu.rb +2 -4
- data/lib/vedeu/menus/repository.rb +1 -1
- data/lib/vedeu/models/all.rb +15 -0
- data/lib/vedeu/models/cell.rb +1 -1
- data/lib/vedeu/models/escape.rb +1 -1
- data/lib/vedeu/models/group.rb +4 -3
- data/lib/vedeu/models/groups.rb +1 -1
- data/lib/vedeu/models/interface.rb +1 -1
- data/lib/vedeu/models/interfaces.rb +1 -1
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/collections/chars.rb +1 -1
- data/lib/vedeu/models/views/collections/lines.rb +1 -1
- data/lib/vedeu/models/views/collections/streams.rb +1 -1
- data/lib/vedeu/models/views/collections/view_collection.rb +1 -1
- data/lib/vedeu/models/views/composition.rb +1 -1
- data/lib/vedeu/models/views/line.rb +8 -6
- data/lib/vedeu/models/views/stream.rb +1 -1
- data/lib/vedeu/models/views/view.rb +1 -1
- data/lib/vedeu/null/all.rb +12 -0
- data/lib/vedeu/output/clear/named_group.rb +2 -1
- data/lib/vedeu/output/clear/named_interface.rb +5 -4
- data/lib/vedeu/output/compressor.rb +1 -0
- data/lib/vedeu/output/output.rb +3 -0
- data/lib/vedeu/output/presentation/colour.rb +10 -10
- data/lib/vedeu/output/presentation/presentation.rb +9 -9
- data/lib/vedeu/output/presentation/style.rb +2 -2
- data/lib/vedeu/output/refresh/refresh.rb +35 -0
- data/lib/vedeu/output/refresh/refresh_group.rb +66 -0
- data/lib/vedeu/output/renderers/all.rb +17 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +4 -2
- data/lib/vedeu/output/renderers/file.rb +7 -6
- data/lib/vedeu/output/renderers/html.rb +9 -7
- data/lib/vedeu/output/renderers/null.rb +1 -1
- data/lib/vedeu/output/renderers/renderer_options.rb +24 -20
- data/lib/vedeu/output/renderers/terminal.rb +1 -1
- data/lib/vedeu/output/renderers/text.rb +1 -1
- data/lib/vedeu/output/wordwrap.rb +7 -4
- data/lib/vedeu/plugins/all.rb +2 -0
- data/lib/vedeu/repositories/all.rb +16 -0
- data/lib/vedeu/repositories/collection.rb +93 -89
- data/lib/vedeu/repositories/model.rb +113 -102
- data/lib/vedeu/repositories/registerable.rb +60 -56
- data/lib/vedeu/repositories/repository.rb +161 -156
- data/lib/vedeu/repositories/store.rb +70 -66
- data/lib/vedeu/runtime/all.rb +15 -0
- data/lib/vedeu/runtime/launcher.rb +19 -16
- data/lib/vedeu/templating/all.rb +6 -0
- data/lib/vedeu/terminal/all.rb +14 -0
- data/lib/vedeu/terminal/buffer.rb +8 -7
- data/lib/vedeu/terminal/mode.rb +11 -10
- data/lib/vedeu/terminal/terminal.rb +50 -45
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -2
- data/test/lib/vedeu/editor/cursor_test.rb +0 -3
- data/test/lib/vedeu/esc/esc_test.rb +58 -54
- data/test/lib/vedeu/events/collection_test.rb +1 -1
- data/test/lib/vedeu/input/keys_test.rb +1 -1
- data/test/lib/vedeu/input/mapper_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/chars_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/lines_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/streams_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/view_collection_test.rb +1 -1
- data/test/lib/vedeu/output/refresh/refresh_group_test.rb +43 -0
- data/test/lib/vedeu/output/refresh/refresh_test.rb +50 -0
- data/test/lib/vedeu/output/renderers/renderer_options_test.rb +8 -4
- data/test/lib/vedeu/output/renderers_test.rb +2 -1
- data/test/lib/vedeu/repositories/collection_test.rb +105 -101
- data/test/lib/vedeu/repositories/model_test.rb +56 -52
- data/test/lib/vedeu/repositories/registerable_test.rb +36 -32
- data/test/lib/vedeu/repositories/repository_test.rb +178 -174
- data/test/lib/vedeu/repositories/store_test.rb +109 -105
- data/test/support/examples/material_colours_app.rb +0 -1
- data/test/support/helpers/model_test_class.rb +50 -46
- data/test/test_helper.rb +2 -2
- metadata +21 -9
- data/lib/vedeu/refresh/refresh.rb +0 -31
- data/lib/vedeu/refresh/refresh_group.rb +0 -59
- data/out_ +0 -50
- data/test/lib/vedeu/refresh/refresh_group_test.rb +0 -39
- data/test/lib/vedeu/refresh/refresh_test.rb +0 -46
data/lib/vedeu/esc/esc.rb
CHANGED
@@ -4,91 +4,96 @@ require 'vedeu/esc/colours'
|
|
4
4
|
|
5
5
|
module Vedeu
|
6
6
|
|
7
|
-
|
8
|
-
# and various display related functions.
|
9
|
-
#
|
10
|
-
module Esc
|
11
|
-
|
12
|
-
include Vedeu::EscapeSequences::Actions
|
13
|
-
include Vedeu::EscapeSequences::Borders
|
14
|
-
include Vedeu::EscapeSequences::Colours
|
15
|
-
extend self
|
16
|
-
|
17
|
-
# Return the stream with the escape sequences escaped so that they
|
18
|
-
# can be printed to the terminal instead of being interpreted by
|
19
|
-
# the terminal which will render them. This way we can see what
|
20
|
-
# escape sequences are being sent along with the content.
|
21
|
-
#
|
22
|
-
# @param stream [String]
|
23
|
-
# @return [String]
|
24
|
-
def escape(stream = '')
|
25
|
-
return stream if stream.nil? || stream.empty?
|
26
|
-
|
27
|
-
stream.gsub(/\e/, '\\e')
|
28
|
-
end
|
29
|
-
|
30
|
-
# Return the escape sequence string from the list of recognised
|
31
|
-
# sequence 'commands', or an empty string when the 'command'
|
32
|
-
# cannot be found.
|
33
|
-
#
|
34
|
-
# @param value [String|Symbol]
|
35
|
-
# @return [String]
|
36
|
-
def string(value = '')
|
37
|
-
return '' if value.empty?
|
38
|
-
|
39
|
-
send(value.to_sym)
|
40
|
-
rescue NoMethodError
|
41
|
-
''
|
42
|
-
end
|
7
|
+
module EscapeSequences
|
43
8
|
|
44
|
-
#
|
9
|
+
# Provides escape sequence strings for setting the cursor position
|
10
|
+
# and various display related functions.
|
45
11
|
#
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
12
|
+
module Esc
|
13
|
+
|
14
|
+
include Vedeu::EscapeSequences::Actions
|
15
|
+
include Vedeu::EscapeSequences::Borders
|
16
|
+
include Vedeu::EscapeSequences::Colours
|
17
|
+
extend self
|
18
|
+
|
19
|
+
# Return the stream with the escape sequences escaped so that
|
20
|
+
# they can be printed to the terminal instead of being
|
21
|
+
# interpreted by the terminal which will render them. This way
|
22
|
+
# we can see what escape sequences are being sent along with
|
23
|
+
# the content.
|
24
|
+
#
|
25
|
+
# @param stream [String]
|
26
|
+
# @return [String]
|
27
|
+
def escape(stream = '')
|
28
|
+
return stream if stream.nil? || stream.empty?
|
29
|
+
|
30
|
+
stream.gsub(/\e/, '\\e')
|
31
|
+
end
|
32
|
+
|
33
|
+
# Return the escape sequence string from the list of recognised
|
34
|
+
# sequence 'commands', or an empty string when the 'command'
|
35
|
+
# cannot be found.
|
36
|
+
#
|
37
|
+
# @param value [String|Symbol]
|
38
|
+
# @return [String]
|
39
|
+
def string(value = '')
|
40
|
+
return '' if value.empty?
|
41
|
+
|
42
|
+
send(value.to_sym)
|
43
|
+
rescue NoMethodError
|
44
|
+
''
|
45
|
+
end
|
46
|
+
|
47
|
+
# Return the escape sequence to render a border character.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
# @yieldreturn [void] The border character to wrap with border
|
51
|
+
# on and off escape sequences.
|
52
|
+
def border
|
53
|
+
return '' unless block_given?
|
54
|
+
|
55
|
+
"#{border_on}#{yield}#{border_off}"
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
# @return [String]
|
61
|
+
def clear
|
62
|
+
"#{colour_reset}\e[2J"
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [String]
|
66
|
+
def clear_line
|
67
|
+
"#{colour_reset}\e[2K"
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [String]
|
71
|
+
def colour_reset
|
72
|
+
"#{fg_reset}#{bg_reset}"
|
73
|
+
end
|
74
|
+
|
75
|
+
# @return [String]
|
76
|
+
def normal
|
77
|
+
"#{underline_off}#{bold_off}#{positive}"
|
78
|
+
end
|
79
|
+
|
80
|
+
# @return [String]
|
81
|
+
def screen_init
|
82
|
+
"#{reset}#{clear}#{hide_cursor}"
|
83
|
+
end
|
84
|
+
|
85
|
+
# @return [String]
|
86
|
+
def screen_exit
|
87
|
+
"#{show_cursor}#{colour_reset}#{reset}#{last_character_position}\n"
|
88
|
+
end
|
89
|
+
|
90
|
+
# @return [String]
|
91
|
+
def last_character_position
|
92
|
+
Vedeu::Geometry::Position[Vedeu.height, Vedeu.width].to_s
|
93
|
+
end
|
94
|
+
|
95
|
+
end # Esc
|
96
|
+
|
97
|
+
end # EscapeSequences
|
93
98
|
|
94
99
|
end # Vedeu
|
data/lib/vedeu/events/aliases.rb
CHANGED
@@ -48,8 +48,7 @@ module Vedeu
|
|
48
48
|
# @param alias_name [Symbol]
|
49
49
|
# @return [Boolean]
|
50
50
|
def registered?(alias_name)
|
51
|
-
return false if alias_name.nil? || alias_name.empty?
|
52
|
-
return false if empty?
|
51
|
+
return false if empty? || alias_name.nil? || alias_name.empty?
|
53
52
|
|
54
53
|
storage.include?(alias_name)
|
55
54
|
end
|
data/lib/vedeu/events/event.rb
CHANGED
data/lib/vedeu/events/trigger.rb
CHANGED
@@ -2,10 +2,10 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Events
|
4
4
|
|
5
|
-
# Trigger a registered or system event by name with arguments. If
|
6
|
-
# event stored returns a value, that is returned. If multiple
|
7
|
-
# registered for a name, then the result of each event
|
8
|
-
# part of a collection.
|
5
|
+
# Trigger a registered or system event by name with arguments. If
|
6
|
+
# the event stored returns a value, that is returned. If multiple
|
7
|
+
# events are registered for a name, then the result of each event
|
8
|
+
# will be returned as part of a collection.
|
9
9
|
#
|
10
10
|
class Trigger
|
11
11
|
|
@@ -14,9 +14,10 @@ module Vedeu
|
|
14
14
|
# @example
|
15
15
|
# Vedeu.trigger(:my_event, :oxidize, 'nitrogen')
|
16
16
|
#
|
17
|
-
# @param name [Symbol] The name of the event you wish to
|
18
|
-
# event does not have to exist.
|
19
|
-
# @param args [Array] Any arguments the event needs to execute
|
17
|
+
# @param name [Symbol] The name of the event you wish to
|
18
|
+
# trigger. The event does not have to exist.
|
19
|
+
# @param args [Array] Any arguments the event needs to execute
|
20
|
+
# correctly.
|
20
21
|
# @return [Array]
|
21
22
|
def self.trigger(name, *args)
|
22
23
|
new(name, *args).trigger
|
@@ -32,7 +33,8 @@ module Vedeu
|
|
32
33
|
@repository = Vedeu.events
|
33
34
|
end
|
34
35
|
|
35
|
-
# Trigger the event and return the result or an array of
|
36
|
+
# Trigger the event and return the result or an array of
|
37
|
+
# results.
|
36
38
|
#
|
37
39
|
# @return [Array]
|
38
40
|
def trigger
|
@@ -56,7 +58,7 @@ module Vedeu
|
|
56
58
|
attr_reader :args
|
57
59
|
|
58
60
|
# @!attribute [r]
|
59
|
-
# @return [Vedeu::Repository]
|
61
|
+
# @return [Vedeu::Repositories::Repository]
|
60
62
|
attr_reader :repository
|
61
63
|
|
62
64
|
private
|
@@ -23,9 +23,7 @@ module Vedeu
|
|
23
23
|
# @option attributes options [Hash]
|
24
24
|
# @return [Vedeu::Geometry::Dimension]
|
25
25
|
def initialize(attributes = {})
|
26
|
-
|
27
|
-
|
28
|
-
@attributes.each do |key, value|
|
26
|
+
defaults.merge!(attributes).each do |key, value|
|
29
27
|
instance_variable_set("@#{key}", value)
|
30
28
|
end
|
31
29
|
end
|
@@ -14,9 +14,7 @@ module Vedeu
|
|
14
14
|
# @option attributes offset [Fixnum]
|
15
15
|
# @return [Vedeu::Geometry::GenericCoordinate]
|
16
16
|
def initialize(attributes = {})
|
17
|
-
|
18
|
-
|
19
|
-
@attributes.each do |key, value|
|
17
|
+
defaults.merge!(attributes).each do |key, value|
|
20
18
|
instance_variable_set("@#{key}", value)
|
21
19
|
end
|
22
20
|
end
|
@@ -2,10 +2,10 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Geometry
|
4
4
|
|
5
|
-
# Allows the storing of interface/view geometry independent of the
|
6
|
-
# instance.
|
5
|
+
# Allows the storing of interface/view geometry independent of the
|
6
|
+
# interface instance.
|
7
7
|
#
|
8
|
-
class Repository < Vedeu::Repository
|
8
|
+
class Repository < Vedeu::Repositories::Repository
|
9
9
|
|
10
10
|
singleton_class.send(:alias_method, :geometries, :repository)
|
11
11
|
|
data/lib/vedeu/input/all.rb
CHANGED
data/lib/vedeu/input/keymap.rb
CHANGED
@@ -2,11 +2,12 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Input
|
4
4
|
|
5
|
-
# A container class for keys associated with a particular
|
5
|
+
# A container class for keys associated with a particular
|
6
|
+
# interface.
|
6
7
|
#
|
7
8
|
class Keymap
|
8
9
|
|
9
|
-
include Vedeu::Model
|
10
|
+
include Vedeu::Repositories::Model
|
10
11
|
|
11
12
|
collection Vedeu::Input::Keys
|
12
13
|
member Vedeu::Input::Key
|
@@ -21,13 +22,11 @@ module Vedeu
|
|
21
22
|
# @option attributes name [String] The name of the keymap.
|
22
23
|
# @option attributes keys [Vedeu::Input::Keys|Array]
|
23
24
|
# A collection of keys.
|
24
|
-
# @option attributes repository
|
25
|
-
# This model's storage.
|
25
|
+
# @option attributes repository
|
26
|
+
# [Vedeu::Repositories::Repository] This model's storage.
|
26
27
|
# @return [Vedeu::Input::Keymap]
|
27
28
|
def initialize(attributes = {})
|
28
|
-
|
29
|
-
|
30
|
-
@attributes.each do |key, value|
|
29
|
+
defaults.merge!(attributes).each do |key, value|
|
31
30
|
instance_variable_set("@#{key}", value)
|
32
31
|
end
|
33
32
|
end
|
@@ -58,8 +57,8 @@ module Vedeu
|
|
58
57
|
keys.any? { |key| key.input == input }
|
59
58
|
end
|
60
59
|
|
61
|
-
# When the given input is registered with this keymap, this
|
62
|
-
# triggers the action associated with the key.
|
60
|
+
# When the given input is registered with this keymap, this
|
61
|
+
# method triggers the action associated with the key.
|
63
62
|
#
|
64
63
|
# @param input [String|Symbol]
|
65
64
|
# @return [Array|FalseClass]
|
@@ -86,8 +85,8 @@ module Vedeu
|
|
86
85
|
}
|
87
86
|
end
|
88
87
|
|
89
|
-
# Checks that the provided key is not already registered with
|
90
|
-
# keymap.
|
88
|
+
# Checks that the provided key is not already registered with
|
89
|
+
# this keymap.
|
91
90
|
#
|
92
91
|
# @param key [Vedeu::Input::Key]
|
93
92
|
# @return [Boolean]
|
data/lib/vedeu/input/keymaps.rb
CHANGED
data/lib/vedeu/input/keys.rb
CHANGED
data/lib/vedeu/input/mapper.rb
CHANGED
@@ -6,9 +6,9 @@ module Vedeu
|
|
6
6
|
#
|
7
7
|
class Mapper
|
8
8
|
|
9
|
-
# Takes a key as a keypress and sends it to registered keymaps.
|
10
|
-
# the associated action is fired, otherwise, we move
|
11
|
-
# return false.
|
9
|
+
# Takes a key as a keypress and sends it to registered keymaps.
|
10
|
+
# If found, the associated action is fired, otherwise, we move
|
11
|
+
# to the next keymap or return false.
|
12
12
|
#
|
13
13
|
# @example
|
14
14
|
# Vedeu.keypress(key_name, keymap_name)
|
@@ -23,8 +23,9 @@ module Vedeu
|
|
23
23
|
new(key, name).keypress
|
24
24
|
end
|
25
25
|
|
26
|
-
# Checks a key is valid; i.e. not already registered to a
|
27
|
-
# key is registered, then the key is invalid
|
26
|
+
# Checks a key is valid; i.e. not already registered to a
|
27
|
+
# keymap. When the key is registered, then the key is invalid
|
28
|
+
# and cannot be used again.
|
28
29
|
#
|
29
30
|
# @param (see #initialize)
|
30
31
|
# @return [Boolean]
|
@@ -38,7 +39,7 @@ module Vedeu
|
|
38
39
|
#
|
39
40
|
# @param key [NilClass|String|Symbol]
|
40
41
|
# @param name [NilClass|String]
|
41
|
-
# @param repository [NilClass|Vedeu::Repository]
|
42
|
+
# @param repository [NilClass|Vedeu::Repositories::Repository]
|
42
43
|
# @return [Vedeu::Input::Mapper]
|
43
44
|
def initialize(key = nil, name = nil, repository = nil)
|
44
45
|
@key = key
|
@@ -46,8 +47,8 @@ module Vedeu
|
|
46
47
|
@repository = repository || Vedeu.keymaps
|
47
48
|
end
|
48
49
|
|
49
|
-
# Returns a boolean indicating that the key is registered to the
|
50
|
-
# keymap, or the global keymap.
|
50
|
+
# Returns a boolean indicating that the key is registered to the
|
51
|
+
# current keymap, or the global keymap.
|
51
52
|
#
|
52
53
|
# @return [Boolean]
|
53
54
|
def keypress
|
@@ -79,7 +80,7 @@ module Vedeu
|
|
79
80
|
attr_reader :key
|
80
81
|
|
81
82
|
# @!attribute [r] repository
|
82
|
-
# @return [Vedeu::Repository]
|
83
|
+
# @return [Vedeu::Repositories::Repository]
|
83
84
|
attr_reader :repository
|
84
85
|
|
85
86
|
private
|
@@ -107,7 +108,8 @@ module Vedeu
|
|
107
108
|
repository.find(named)
|
108
109
|
end
|
109
110
|
|
110
|
-
# Does the keymaps repository have the named keymap already
|
111
|
+
# Does the keymaps repository have the named keymap already
|
112
|
+
# registered?
|
111
113
|
#
|
112
114
|
# @param named [NilClass|String]
|
113
115
|
# @return [Boolean]
|
@@ -115,8 +117,8 @@ module Vedeu
|
|
115
117
|
repository.registered?(named)
|
116
118
|
end
|
117
119
|
|
118
|
-
# With a name, we check the keymap with that name, otherwise we
|
119
|
-
# name of the interface currently in focus.
|
120
|
+
# With a name, we check the keymap with that name, otherwise we
|
121
|
+
# use the name of the interface currently in focus.
|
120
122
|
#
|
121
123
|
# @return [String|NilClass]
|
122
124
|
def name
|
data/lib/vedeu/logging/all.rb
CHANGED
data/lib/vedeu/logging/log.rb
CHANGED
@@ -103,7 +103,8 @@ module Vedeu
|
|
103
103
|
# @param body [String] The log message itself.
|
104
104
|
# @return [String]
|
105
105
|
def message_body(type, body)
|
106
|
-
Vedeu::Esc
|
106
|
+
Vedeu::EscapeSequences::Esc
|
107
|
+
.send(message_types.fetch(type, :default)[-1]) do
|
107
108
|
body
|
108
109
|
end
|
109
110
|
end
|
@@ -114,7 +115,8 @@ module Vedeu
|
|
114
115
|
# @param type [Symbol] The type of log message.
|
115
116
|
# @return [String]
|
116
117
|
def message_type(type)
|
117
|
-
Vedeu::Esc
|
118
|
+
Vedeu::EscapeSequences::Esc
|
119
|
+
.send(message_types.fetch(type, :default)[0]) do
|
118
120
|
"[#{type}]".ljust(9)
|
119
121
|
end
|
120
122
|
end
|
data/lib/vedeu/menus/menu.rb
CHANGED
@@ -7,7 +7,7 @@ module Vedeu
|
|
7
7
|
#
|
8
8
|
class Menu
|
9
9
|
|
10
|
-
include Vedeu::Model
|
10
|
+
include Vedeu::Repositories::Model
|
11
11
|
|
12
12
|
# @!attribute [rw] collection
|
13
13
|
# @return [Array]
|
@@ -73,9 +73,7 @@ module Vedeu
|
|
73
73
|
# @option attributes selected [Fixnum|NilClass]
|
74
74
|
# @return [Vedeu::Menus::Menu]
|
75
75
|
def initialize(attributes = {})
|
76
|
-
|
77
|
-
|
78
|
-
@attributes.each do |key, value|
|
76
|
+
defaults.merge!(attributes).each do |key, value|
|
79
77
|
instance_variable_set("@#{key}", value)
|
80
78
|
end
|
81
79
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
module Models
|
4
|
+
|
5
|
+
end # Models
|
6
|
+
|
7
|
+
end # Vedeu
|
8
|
+
|
9
|
+
require 'vedeu/models/cell'
|
10
|
+
require 'vedeu/models/escape'
|
11
|
+
require 'vedeu/models/focus'
|
12
|
+
require 'vedeu/models/group'
|
13
|
+
require 'vedeu/models/groups'
|
14
|
+
require 'vedeu/models/row'
|
15
|
+
require 'vedeu/models/page'
|
data/lib/vedeu/models/cell.rb
CHANGED
data/lib/vedeu/models/escape.rb
CHANGED
data/lib/vedeu/models/group.rb
CHANGED
@@ -7,7 +7,7 @@ module Vedeu
|
|
7
7
|
#
|
8
8
|
class Group
|
9
9
|
|
10
|
-
include Vedeu::Model
|
10
|
+
include Vedeu::Repositories::Model
|
11
11
|
include Vedeu::Toggleable
|
12
12
|
|
13
13
|
# @!attribute [rw] name
|
@@ -24,8 +24,9 @@ module Vedeu
|
|
24
24
|
# @option attributes members [Set] A collection of names of
|
25
25
|
# interfaces belonging to this group.
|
26
26
|
# @option attributes name [String] The name of the group.
|
27
|
-
# @option attributes repository
|
28
|
-
#
|
27
|
+
# @option attributes repository
|
28
|
+
# [Vedeu::Repositories::Repository]
|
29
|
+
# The storage for all Group models.
|
29
30
|
# @option attributes visible [Boolean] Whether the group is
|
30
31
|
# visible or not.
|
31
32
|
# @return [Vedeu::Models::Group]
|
data/lib/vedeu/models/groups.rb
CHANGED