vedeu 0.6.10 → 0.6.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu/all.rb +17 -103
  3. data/lib/vedeu/api/all.rb +15 -0
  4. data/lib/vedeu/api/internal.rb +4 -0
  5. data/lib/vedeu/application/all.rb +6 -0
  6. data/lib/vedeu/bindings/all.rb +32 -0
  7. data/lib/vedeu/bindings/bindings.rb +0 -14
  8. data/lib/vedeu/bindings/refresh.rb +8 -2
  9. data/lib/vedeu/bindings/system.rb +1 -0
  10. data/lib/vedeu/borders/border.rb +1 -1
  11. data/lib/vedeu/borders/repository.rb +1 -1
  12. data/lib/vedeu/buffers/buffer.rb +2 -4
  13. data/lib/vedeu/buffers/repository.rb +1 -1
  14. data/lib/vedeu/colours/background.rb +1 -1
  15. data/lib/vedeu/colours/backgrounds.rb +1 -1
  16. data/lib/vedeu/colours/foreground.rb +1 -1
  17. data/lib/vedeu/colours/foregrounds.rb +1 -1
  18. data/lib/vedeu/colours/translator.rb +4 -3
  19. data/lib/vedeu/configuration/api.rb +2 -1
  20. data/lib/vedeu/configuration/cli.rb +1 -1
  21. data/lib/vedeu/cursors/cursor.rb +26 -26
  22. data/lib/vedeu/cursors/repository.rb +1 -1
  23. data/lib/vedeu/distributed/all.rb +16 -0
  24. data/lib/vedeu/distributed/test_application.rb +3 -3
  25. data/lib/vedeu/dsl/all.rb +22 -0
  26. data/lib/vedeu/dsl/composition.rb +43 -40
  27. data/lib/vedeu/dsl/dsl.rb +6 -3
  28. data/lib/vedeu/dsl/group.rb +23 -16
  29. data/lib/vedeu/dsl/interface.rb +48 -38
  30. data/lib/vedeu/dsl/keymap.rb +6 -7
  31. data/lib/vedeu/dsl/line.rb +6 -3
  32. data/lib/vedeu/dsl/stream.rb +2 -1
  33. data/lib/vedeu/editor/cursor.rb +1 -3
  34. data/lib/vedeu/editor/document.rb +4 -5
  35. data/lib/vedeu/editor/documents.rb +1 -1
  36. data/lib/vedeu/editor/line.rb +2 -3
  37. data/lib/vedeu/editor/lines.rb +2 -3
  38. data/lib/vedeu/esc/all.rb +14 -0
  39. data/lib/vedeu/esc/colours.rb +8 -4
  40. data/lib/vedeu/esc/esc.rb +89 -84
  41. data/lib/vedeu/events/aliases.rb +1 -2
  42. data/lib/vedeu/events/collection.rb +1 -1
  43. data/lib/vedeu/events/event.rb +1 -1
  44. data/lib/vedeu/events/repository.rb +1 -1
  45. data/lib/vedeu/events/trigger.rb +11 -9
  46. data/lib/vedeu/geometry/dimension.rb +1 -3
  47. data/lib/vedeu/geometry/generic_coordinate.rb +1 -3
  48. data/lib/vedeu/geometry/geometry.rb +1 -1
  49. data/lib/vedeu/geometry/repository.rb +3 -3
  50. data/lib/vedeu/input/all.rb +3 -0
  51. data/lib/vedeu/input/keymap.rb +10 -11
  52. data/lib/vedeu/input/keymaps.rb +1 -1
  53. data/lib/vedeu/input/keys.rb +1 -1
  54. data/lib/vedeu/input/mapper.rb +14 -12
  55. data/lib/vedeu/logging/all.rb +3 -0
  56. data/lib/vedeu/logging/log.rb +4 -2
  57. data/lib/vedeu/menus/menu.rb +2 -4
  58. data/lib/vedeu/menus/repository.rb +1 -1
  59. data/lib/vedeu/models/all.rb +15 -0
  60. data/lib/vedeu/models/cell.rb +1 -1
  61. data/lib/vedeu/models/escape.rb +1 -1
  62. data/lib/vedeu/models/group.rb +4 -3
  63. data/lib/vedeu/models/groups.rb +1 -1
  64. data/lib/vedeu/models/interface.rb +1 -1
  65. data/lib/vedeu/models/interfaces.rb +1 -1
  66. data/lib/vedeu/models/views/char.rb +1 -1
  67. data/lib/vedeu/models/views/collections/chars.rb +1 -1
  68. data/lib/vedeu/models/views/collections/lines.rb +1 -1
  69. data/lib/vedeu/models/views/collections/streams.rb +1 -1
  70. data/lib/vedeu/models/views/collections/view_collection.rb +1 -1
  71. data/lib/vedeu/models/views/composition.rb +1 -1
  72. data/lib/vedeu/models/views/line.rb +8 -6
  73. data/lib/vedeu/models/views/stream.rb +1 -1
  74. data/lib/vedeu/models/views/view.rb +1 -1
  75. data/lib/vedeu/null/all.rb +12 -0
  76. data/lib/vedeu/output/clear/named_group.rb +2 -1
  77. data/lib/vedeu/output/clear/named_interface.rb +5 -4
  78. data/lib/vedeu/output/compressor.rb +1 -0
  79. data/lib/vedeu/output/output.rb +3 -0
  80. data/lib/vedeu/output/presentation/colour.rb +10 -10
  81. data/lib/vedeu/output/presentation/presentation.rb +9 -9
  82. data/lib/vedeu/output/presentation/style.rb +2 -2
  83. data/lib/vedeu/output/refresh/refresh.rb +35 -0
  84. data/lib/vedeu/output/refresh/refresh_group.rb +66 -0
  85. data/lib/vedeu/output/renderers/all.rb +17 -0
  86. data/lib/vedeu/output/renderers/escape_sequence.rb +4 -2
  87. data/lib/vedeu/output/renderers/file.rb +7 -6
  88. data/lib/vedeu/output/renderers/html.rb +9 -7
  89. data/lib/vedeu/output/renderers/null.rb +1 -1
  90. data/lib/vedeu/output/renderers/renderer_options.rb +24 -20
  91. data/lib/vedeu/output/renderers/terminal.rb +1 -1
  92. data/lib/vedeu/output/renderers/text.rb +1 -1
  93. data/lib/vedeu/output/wordwrap.rb +7 -4
  94. data/lib/vedeu/plugins/all.rb +2 -0
  95. data/lib/vedeu/repositories/all.rb +16 -0
  96. data/lib/vedeu/repositories/collection.rb +93 -89
  97. data/lib/vedeu/repositories/model.rb +113 -102
  98. data/lib/vedeu/repositories/registerable.rb +60 -56
  99. data/lib/vedeu/repositories/repository.rb +161 -156
  100. data/lib/vedeu/repositories/store.rb +70 -66
  101. data/lib/vedeu/runtime/all.rb +15 -0
  102. data/lib/vedeu/runtime/launcher.rb +19 -16
  103. data/lib/vedeu/templating/all.rb +6 -0
  104. data/lib/vedeu/terminal/all.rb +14 -0
  105. data/lib/vedeu/terminal/buffer.rb +8 -7
  106. data/lib/vedeu/terminal/mode.rb +11 -10
  107. data/lib/vedeu/terminal/terminal.rb +50 -45
  108. data/lib/vedeu/version.rb +1 -1
  109. data/test/lib/vedeu/cursors/cursor_test.rb +4 -2
  110. data/test/lib/vedeu/editor/cursor_test.rb +0 -3
  111. data/test/lib/vedeu/esc/esc_test.rb +58 -54
  112. data/test/lib/vedeu/events/collection_test.rb +1 -1
  113. data/test/lib/vedeu/input/keys_test.rb +1 -1
  114. data/test/lib/vedeu/input/mapper_test.rb +1 -1
  115. data/test/lib/vedeu/models/views/collections/chars_test.rb +1 -1
  116. data/test/lib/vedeu/models/views/collections/lines_test.rb +1 -1
  117. data/test/lib/vedeu/models/views/collections/streams_test.rb +1 -1
  118. data/test/lib/vedeu/models/views/collections/view_collection_test.rb +1 -1
  119. data/test/lib/vedeu/output/refresh/refresh_group_test.rb +43 -0
  120. data/test/lib/vedeu/output/refresh/refresh_test.rb +50 -0
  121. data/test/lib/vedeu/output/renderers/renderer_options_test.rb +8 -4
  122. data/test/lib/vedeu/output/renderers_test.rb +2 -1
  123. data/test/lib/vedeu/repositories/collection_test.rb +105 -101
  124. data/test/lib/vedeu/repositories/model_test.rb +56 -52
  125. data/test/lib/vedeu/repositories/registerable_test.rb +36 -32
  126. data/test/lib/vedeu/repositories/repository_test.rb +178 -174
  127. data/test/lib/vedeu/repositories/store_test.rb +109 -105
  128. data/test/support/examples/material_colours_app.rb +0 -1
  129. data/test/support/helpers/model_test_class.rb +50 -46
  130. data/test/test_helper.rb +2 -2
  131. metadata +21 -9
  132. data/lib/vedeu/refresh/refresh.rb +0 -31
  133. data/lib/vedeu/refresh/refresh_group.rb +0 -59
  134. data/out_ +0 -50
  135. data/test/lib/vedeu/refresh/refresh_group_test.rb +0 -39
  136. 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
- # Provides escape sequence strings for setting the cursor position
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
- # Return the escape sequence to render a border character.
9
+ # Provides escape sequence strings for setting the cursor position
10
+ # and various display related functions.
45
11
  #
46
- # @return [String]
47
- # @yieldreturn [void] The border character to wrap with border on
48
- # and off escape sequences.
49
- def border
50
- return '' unless block_given?
51
-
52
- "#{border_on}#{yield}#{border_off}"
53
- end
54
-
55
- private
56
-
57
- # @return [String]
58
- def clear
59
- "#{colour_reset}\e[2J"
60
- end
61
-
62
- # @return [String]
63
- def clear_line
64
- "#{colour_reset}\e[2K"
65
- end
66
-
67
- # @return [String]
68
- def colour_reset
69
- "#{fg_reset}#{bg_reset}"
70
- end
71
-
72
- # @return [String]
73
- def normal
74
- "#{underline_off}#{bold_off}#{positive}"
75
- end
76
-
77
- # @return [String]
78
- def screen_init
79
- "#{reset}#{clear}#{hide_cursor}"
80
- end
81
-
82
- # @return [String]
83
- def screen_exit
84
- "#{show_cursor}#{colour_reset}#{reset}#{last_character_position}\n"
85
- end
86
-
87
- # @return [String]
88
- def last_character_position
89
- Vedeu::Geometry::Position[Vedeu.height, Vedeu.width].to_s
90
- end
91
-
92
- end # Esc
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
@@ -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
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # A collection of {Vedeu::Events::Event} instances.
6
6
  #
7
7
  # @api private
8
- class Collection < Vedeu::Collection
8
+ class Collection < Vedeu::Repositories::Collection
9
9
 
10
10
  end # Collection
11
11
 
@@ -32,7 +32,7 @@ module Vedeu
32
32
  #
33
33
  class Event
34
34
 
35
- include Vedeu::Model
35
+ include Vedeu::Repositories::Model
36
36
 
37
37
  class << self
38
38
 
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of events.
6
6
  #
7
- class Repository < Vedeu::Repository
7
+ class Repository < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :events, :repository)
10
10
 
@@ -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 the
6
- # event stored returns a value, that is returned. If multiple events are
7
- # registered for a name, then the result of each event will be returned as
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 trigger. The
18
- # event does not have to exist.
19
- # @param args [Array] Any arguments the event needs to execute correctly.
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 results.
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
- @attributes = defaults.merge!(attributes)
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
- @attributes = defaults.merge!(attributes)
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
@@ -12,7 +12,7 @@ module Vedeu
12
12
  class Geometry
13
13
 
14
14
  extend Forwardable
15
- include Vedeu::Model
15
+ include Vedeu::Repositories::Model
16
16
 
17
17
  def_delegators :area,
18
18
  :north,
@@ -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 interface
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
 
@@ -1,5 +1,8 @@
1
1
  module Vedeu
2
2
 
3
+ # Classes within the Input namespace handle various aspects of
4
+ # user input.
5
+ #
3
6
  module Input
4
7
 
5
8
  end # Input
@@ -2,11 +2,12 @@ module Vedeu
2
2
 
3
3
  module Input
4
4
 
5
- # A container class for keys associated with a particular interface.
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 [Vedeu::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
- @attributes = defaults.merge!(attributes)
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 method
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 this
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]
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of keymaps.
6
6
  #
7
- class Keymaps < Vedeu::Repository
7
+ class Keymaps < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :keymaps, :repository)
10
10
 
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # A collection of {Vedeu::Input::Key} instances.
6
6
  #
7
- class Keys < Vedeu::Collection
7
+ class Keys < Vedeu::Repositories::Collection
8
8
 
9
9
  end # Keys
10
10
 
@@ -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. If found,
10
- # the associated action is fired, otherwise, we move to the next keymap or
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 keymap. When the
27
- # key is registered, then the key is invalid and cannot be used again.
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 current
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 registered?
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 use the
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
@@ -1,5 +1,8 @@
1
1
  module Vedeu
2
2
 
3
+ # Classes within the Logging namespace handle various aspects of
4
+ # logging for Vedeu.
5
+ #
3
6
  module Logging
4
7
 
5
8
  end # Logging
@@ -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.send(message_types.fetch(type, :default)[-1]) do
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.send(message_types.fetch(type, :default)[0]) do
118
+ Vedeu::EscapeSequences::Esc
119
+ .send(message_types.fetch(type, :default)[0]) do
118
120
  "[#{type}]".ljust(9)
119
121
  end
120
122
  end
@@ -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
- @attributes = defaults.merge!(attributes)
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
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of menus by name.
6
6
  #
7
- class Repository < Vedeu::Repository
7
+ class Repository < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :menus, :repository)
10
10
 
@@ -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'
@@ -59,7 +59,7 @@ module Vedeu
59
59
  }
60
60
  end
61
61
 
62
- # @param options [Hash] Ignored.
62
+ # @param _options [Hash] Ignored.
63
63
  # @return [String]
64
64
  def to_html(_options = {})
65
65
  ''
@@ -57,7 +57,7 @@ module Vedeu
57
57
  # Return an empty string as most escape sequences won't make
58
58
  # sense as HTML.
59
59
  #
60
- # @param options [Hash] Ignored.
60
+ # @param _options [Hash] Ignored.
61
61
  # @return [String]
62
62
  def to_html(_options = {})
63
63
  ''
@@ -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 [Vedeu::Repository] The storage
28
- # for all Group models.
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]
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of view groups.
6
6
  #
7
- class Groups < Vedeu::Repository
7
+ class Groups < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :groups, :repository)
10
10
 
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Interface
9
9
 
10
- include Vedeu::Model
10
+ include Vedeu::Repositories::Model
11
11
  include Vedeu::Presentation
12
12
  include Vedeu::Toggleable
13
13
 
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of interfaces and views.
6
6
  #
7
- class Interfaces < Vedeu::Repository
7
+ class Interfaces < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :interfaces, :repository)
10
10
 
@@ -85,7 +85,7 @@ module Vedeu
85
85
  # @return [String]
86
86
  def value
87
87
  if border
88
- Vedeu::Esc.border { @value }
88
+ Vedeu::EscapeSequences::Esc.border { @value }
89
89
 
90
90
  else
91
91
  @value
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # A collection of {Vedeu::Views::Char} instances.
6
6
  #
7
7
  # @api private
8
- class Chars < Vedeu::Collection
8
+ class Chars < Vedeu::Repositories::Collection
9
9
 
10
10
  end # Chars
11
11
 
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # A collection of {Vedeu::Views::Line} instances.
6
6
  #
7
7
  # @api private
8
- class Lines < Vedeu::Collection
8
+ class Lines < Vedeu::Repositories::Collection
9
9
 
10
10
  end # Lines
11
11
 
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # A collection of {Vedeu::Views::Stream} instances.
6
6
  #
7
7
  # @api private
8
- class Streams < Vedeu::Collection
8
+ class Streams < Vedeu::Repositories::Collection
9
9
 
10
10
  end # Streams
11
11