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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c164a962e662469f503fd1e4a7c263e6d4c3eace
4
- data.tar.gz: 8e28eb50a3e7c7c0f708ec2b118fc8537ecfdf6f
3
+ metadata.gz: fd5d4c600e6a615165182a1f701d54b8f073b33a
4
+ data.tar.gz: 30af16d08fc9b2d86a2a4aa998b205cb15f32bd1
5
5
  SHA512:
6
- metadata.gz: 793c0295ed02d41e9e03b6e61417938f3c715464f4a765ed70f04fa386a9034389f659d9b058b565871d15707418dce5802024283797bcd41ea699570c04b30c
7
- data.tar.gz: f15f247cb1fcd786e7479e2851234f38d3c7900de8ad0c6a3c691e6970eeaa91de583adfe01a395614cacf5f9373f870716db6751c18159e9931d677d4200a46
6
+ metadata.gz: f3b9d230aa8dea217cb114e762be87c5cac80008dc7530522efe51c419358415e5e839139005d8bb2bd898531c1688a03f1e0a8762294e12fd56ae4232349151
7
+ data.tar.gz: f5f59df013fe45ee4d7aa4241768cea05acd733b45e2a999a235a8916f95beae94bd8137fdd70fbe297a4eae931d01fa14b9510bcf4cfb3622a07f69f2d3ea78
data/lib/vedeu/all.rb CHANGED
@@ -1,139 +1,53 @@
1
1
  require 'vedeu/version'
2
2
  require 'vedeu/options'
3
3
 
4
- require 'vedeu/runtime/launcher'
5
- require 'vedeu/runtime/bootstrap'
6
4
  require 'vedeu/error'
7
-
8
- require 'vedeu/logging/all'
9
-
10
- require 'vedeu/runtime/traps'
11
5
  require 'vedeu/common'
12
- require 'vedeu/runtime/router'
6
+ require 'vedeu/logging/all'
7
+ require 'vedeu/runtime/all'
13
8
 
14
9
  require 'vedeu/configuration/cli'
15
10
  require 'vedeu/configuration/api'
16
11
  require 'vedeu/configuration/configuration'
17
12
 
18
- require 'vedeu/terminal/mode'
19
- require 'vedeu/terminal/terminal'
20
- require 'vedeu/terminal/buffer'
21
-
22
- require 'vedeu/runtime/main_loop'
23
- require 'vedeu/runtime/flags'
24
- require 'vedeu/runtime/application'
13
+ require 'vedeu/terminal/all'
14
+ require 'vedeu/repositories/all'
25
15
 
26
- require 'vedeu/repositories/collection'
27
16
  require 'vedeu/input/keys'
28
- require 'vedeu/repositories/repositories'
29
-
30
- require 'vedeu/repositories/model'
31
- require 'vedeu/repositories/store'
32
- require 'vedeu/repositories/registerable'
33
- require 'vedeu/repositories/repository'
34
-
35
- require 'vedeu/null/null'
36
- require 'vedeu/null/generic'
37
- require 'vedeu/null/interface'
38
- require 'vedeu/null/view'
39
-
40
- require 'vedeu/refresh/refresh'
41
- require 'vedeu/refresh/refresh_group'
42
17
 
43
18
  require 'vedeu/models/toggleable'
44
19
 
45
- require 'vedeu/esc/actions'
46
- require 'vedeu/esc/borders'
47
- require 'vedeu/esc/colours'
48
- require 'vedeu/esc/esc'
49
-
20
+ require 'vedeu/esc/all'
21
+ require 'vedeu/null/all'
50
22
  require 'vedeu/models/views/all'
51
-
52
- require 'vedeu/models/cell'
53
- require 'vedeu/models/escape'
54
- require 'vedeu/models/focus'
55
- require 'vedeu/models/group'
56
- require 'vedeu/models/groups'
57
- require 'vedeu/models/row'
58
- require 'vedeu/models/page'
59
-
60
- require 'vedeu/templating/all'
61
- require 'vedeu/templating/encoder'
62
- require 'vedeu/templating/decoder'
63
- require 'vedeu/templating/helpers'
64
- require 'vedeu/templating/template'
65
- require 'vedeu/templating/view_template'
66
-
67
- require 'vedeu/application/controller'
68
- require 'vedeu/application/helper'
69
- require 'vedeu/application/view'
70
- require 'vedeu/application/application_controller'
71
- require 'vedeu/application/application_helper'
72
- require 'vedeu/application/application_view'
73
-
74
- require 'vedeu/distributed/uri'
75
- require 'vedeu/distributed/server'
76
- require 'vedeu/distributed/client'
77
- require 'vedeu/distributed/subprocess'
78
- require 'vedeu/distributed/test_application'
79
-
80
- require 'vedeu/dsl/dsl'
81
- require 'vedeu/dsl/shared'
82
- require 'vedeu/dsl/use'
83
- require 'vedeu/dsl/presentation'
84
- require 'vedeu/dsl/composition'
85
- require 'vedeu/dsl/group'
86
- require 'vedeu/dsl/keymap'
87
- require 'vedeu/dsl/text'
88
- require 'vedeu/dsl/interface'
89
- require 'vedeu/dsl/line'
90
- require 'vedeu/dsl/stream'
91
- require 'vedeu/dsl/view'
92
-
23
+ require 'vedeu/models/all'
24
+ require 'vedeu/application/all'
25
+ require 'vedeu/dsl/all'
93
26
  require 'vedeu/borders/all'
94
27
  require 'vedeu/buffers/all'
95
28
  require 'vedeu/colours/all'
96
29
  require 'vedeu/cursors/all'
30
+ require 'vedeu/distributed/all'
97
31
  require 'vedeu/editor/all'
98
32
  require 'vedeu/events/all'
99
33
  require 'vedeu/geometry/all'
100
34
  require 'vedeu/input/all'
101
35
  require 'vedeu/menus/all'
36
+ require 'vedeu/templating/all'
102
37
 
103
38
  require 'vedeu/output/presentation/presentation'
104
-
105
39
  require 'vedeu/output/direct'
106
40
  require 'vedeu/output/clear/named_group'
107
41
  require 'vedeu/output/clear/named_interface'
108
-
109
42
  require 'vedeu/output/compressor'
110
43
  require 'vedeu/output/text'
111
44
  require 'vedeu/output/output'
112
45
  require 'vedeu/output/viewport'
113
46
  require 'vedeu/output/wordwrap'
114
- require 'vedeu/output/renderers/renderer_options'
115
- require 'vedeu/output/renderers/escape_sequence'
116
- require 'vedeu/output/renderers/file'
117
- require 'vedeu/output/renderers/html'
118
- require 'vedeu/output/renderers/json'
119
- require 'vedeu/output/renderers/null'
120
- require 'vedeu/output/renderers/terminal'
121
- require 'vedeu/output/renderers/text'
122
- require 'vedeu/output/renderers'
123
-
124
- require 'vedeu/api/external'
125
- require 'vedeu/api/internal'
126
-
127
- require 'vedeu/bindings/application'
128
- require 'vedeu/bindings/document'
129
- require 'vedeu/bindings/drb'
130
- require 'vedeu/bindings/menus'
131
- require 'vedeu/bindings/movement'
132
- require 'vedeu/bindings/focus'
133
- require 'vedeu/bindings/refresh'
134
- require 'vedeu/bindings/system'
135
- require 'vedeu/bindings/visibility'
136
- require 'vedeu/bindings/bindings'
47
+ require 'vedeu/output/refresh/refresh'
48
+ require 'vedeu/output/refresh/refresh_group'
49
+ require 'vedeu/output/renderers/all'
137
50
 
138
- require 'vedeu/plugins/plugins'
139
- require 'vedeu/plugins/plugin'
51
+ require 'vedeu/api/all'
52
+ require 'vedeu/bindings/all'
53
+ require 'vedeu/plugins/all'
@@ -0,0 +1,15 @@
1
+ module Vedeu
2
+
3
+ # The API namespace provides the internal and external API methods
4
+ # for Vedeu. These methods are convenient ways to perform many
5
+ # actions and control the behaviour of Vedeu without needing to
6
+ # know the specific implementations.
7
+ #
8
+ module API
9
+
10
+ end # API
11
+
12
+ end # Vedeu
13
+
14
+ require 'vedeu/api/external'
15
+ require 'vedeu/api/internal'
@@ -2,6 +2,10 @@ module Vedeu
2
2
 
3
3
  module API
4
4
 
5
+ # The internal API methods allow Vedeu to function and change
6
+ # without major refactoring. The methods listed here will rarely
7
+ # be used by client applications.
8
+ #
5
9
  module Internal
6
10
 
7
11
  extend Forwardable
@@ -0,0 +1,6 @@
1
+ require 'vedeu/application/controller'
2
+ require 'vedeu/application/helper'
3
+ require 'vedeu/application/view'
4
+ require 'vedeu/application/application_controller'
5
+ require 'vedeu/application/application_helper'
6
+ require 'vedeu/application/application_view'
@@ -0,0 +1,32 @@
1
+ module Vedeu
2
+
3
+ # Binds various events for running and manipulating Vedeu. When
4
+ # called provide a variety of core functions and behaviours.
5
+ # They are soft-namespaced using underscores.
6
+ #
7
+ # @note
8
+ # The methods these modules use are private, and should not be
9
+ # called directly, however the produced events are all public and
10
+ # are highly recommended to be used.
11
+ #
12
+ # Unbinding any of these events is likely to cause problems, so I
13
+ # would advise leaving them alone. A safe rule: when the name
14
+ # starts and ends with an underscore, it's probably used by Vedeu
15
+ # internally.
16
+ #
17
+ module Bindings
18
+
19
+ end # Bindings
20
+
21
+ end # Vedeu
22
+
23
+ require 'vedeu/bindings/application'
24
+ require 'vedeu/bindings/document'
25
+ require 'vedeu/bindings/drb'
26
+ require 'vedeu/bindings/menus'
27
+ require 'vedeu/bindings/movement'
28
+ require 'vedeu/bindings/focus'
29
+ require 'vedeu/bindings/refresh'
30
+ require 'vedeu/bindings/system'
31
+ require 'vedeu/bindings/visibility'
32
+ require 'vedeu/bindings/bindings'
@@ -1,19 +1,5 @@
1
1
  module Vedeu
2
2
 
3
- # Binds various events for running and manipulating Vedeu. When
4
- # called provide a variety of core functions and behaviours.
5
- # They are soft-namespaced using underscores.
6
- #
7
- # @note
8
- # The methods these modules use are private, and should not be
9
- # called directly, however the produced events are all public and
10
- # are highly recommended to be used.
11
- #
12
- # Unbinding any of these events is likely to cause problems, so I
13
- # would advise leaving them alone. A safe rule: when the name
14
- # starts and ends with an underscore, it's probably used by Vedeu
15
- # internally.
16
- #
17
3
  module Bindings
18
4
 
19
5
  extend self
@@ -21,7 +21,13 @@ module Vedeu
21
21
  # See {file:docs/events/refresh.md#\_refresh_}
22
22
  def refresh!
23
23
  Vedeu.bind(:_refresh_) do |name|
24
- name ? Vedeu::Buffers::Refresh.by_name(name) : Vedeu::Refresh.all
24
+ if name
25
+ Vedeu::Buffers::Refresh.by_name(name)
26
+
27
+ else
28
+ Vedeu::Output::Refresh.all
29
+
30
+ end
25
31
  end
26
32
  end
27
33
 
@@ -35,7 +41,7 @@ module Vedeu
35
41
  # See {file:docs/events/refresh.md#\_refresh_group_}
36
42
  def refresh_group!
37
43
  Vedeu.bind(:_refresh_group_) do |name|
38
- Vedeu::RefreshGroup.by_name(name)
44
+ Vedeu::Output::RefreshGroup.by_name(name)
39
45
  end
40
46
  end
41
47
 
@@ -43,6 +43,7 @@ module Vedeu
43
43
 
44
44
  else
45
45
  Vedeu::Terminal.clear
46
+ Vedeu::Terminal::Buffer.clear
46
47
 
47
48
  end
48
49
  end
@@ -16,7 +16,7 @@ module Vedeu
16
16
 
17
17
  extend Forwardable
18
18
  include Vedeu::Common
19
- include Vedeu::Model
19
+ include Vedeu::Repositories::Model
20
20
  include Vedeu::Presentation
21
21
 
22
22
  def_delegators :geometry,
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # Allows the storing of interface/view borders independent of the
6
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, :borders, :repository)
11
11
 
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Buffer
9
9
 
10
- include Vedeu::Model
10
+ include Vedeu::Repositories::Model
11
11
 
12
12
  # The next buffer to be displayed; contains the content which
13
13
  # will be shown on next refresh.
@@ -45,9 +45,7 @@ module Vedeu
45
45
  # @option attributes repository [Vedeu::Buffers::Repository]
46
46
  # @return [Vedeu::Buffers::Buffer]
47
47
  def initialize(attributes = {})
48
- @attributes = defaults.merge!(attributes)
49
-
50
- @attributes.each do |key, value|
48
+ defaults.merge!(attributes).each do |key, value|
51
49
  instance_variable_set("@#{key}", value)
52
50
  end
53
51
  end
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of view buffers.
6
6
  #
7
- class Repository < Vedeu::Repository
7
+ class Repository < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :buffers, :repository)
10
10
 
@@ -12,7 +12,7 @@ module Vedeu
12
12
 
13
13
  # @return [String]
14
14
  def named_codes
15
- Vedeu::Esc.background_codes[colour]
15
+ Vedeu::EscapeSequences::Esc.background_codes[colour]
16
16
  end
17
17
 
18
18
  # @return [String]
@@ -7,7 +7,7 @@ module Vedeu
7
7
  class Backgrounds < Vedeu::Colours::Repository
8
8
 
9
9
  # @return [Vedeu::Colours::Backgrounds]
10
- # @see Vedeu::Repository
10
+ # @see Vedeu::Repositories::Repository
11
11
  def self.background_colours
12
12
  @background_colours ||= new
13
13
  end
@@ -12,7 +12,7 @@ module Vedeu
12
12
 
13
13
  # @return [String]
14
14
  def named_codes
15
- Vedeu::Esc.foreground_codes[colour]
15
+ Vedeu::EscapeSequences::Esc.foreground_codes[colour]
16
16
  end
17
17
 
18
18
  # @return [String]
@@ -7,7 +7,7 @@ module Vedeu
7
7
  class Foregrounds < Vedeu::Colours::Repository
8
8
 
9
9
  # @return [Vedeu::Colours::Foregrounds]
10
- # @see Vedeu::Repository
10
+ # @see Vedeu::Repositories::Repository
11
11
  def self.foreground_colours
12
12
  @foreground_colours ||= new
13
13
  end
@@ -96,7 +96,7 @@ module Vedeu
96
96
  alias_method :to_s, :escape_sequence
97
97
  alias_method :to_str, :escape_sequence
98
98
 
99
- # @param options [Hash] Ignored.
99
+ # @param _options [Hash] Ignored.
100
100
  # @return [String]
101
101
  def to_html(_options = {})
102
102
  return colour if rgb?
@@ -142,7 +142,8 @@ module Vedeu
142
142
  # Returns an escape sequence for a named background colour.
143
143
  #
144
144
  # @note
145
- # Valid names can be found at {Vedeu::Esc#codes}
145
+ # Valid names can be found at
146
+ # {Vedeu::EscapeSequences::Esc#codes}
146
147
  #
147
148
  # @return [String]
148
149
  def named
@@ -154,7 +155,7 @@ module Vedeu
154
155
  #
155
156
  # @return [Boolean]
156
157
  def valid_name?
157
- Vedeu::Esc.codes.keys.include?(colour)
158
+ Vedeu::EscapeSequences::Esc.codes.keys.include?(colour)
158
159
  end
159
160
 
160
161
  # Returns a boolean indicating whether the colour provided is a
@@ -35,7 +35,8 @@ module Vedeu
35
35
  #
36
36
  # @return [Hash<Symbol => Boolean, Fixnum, String>]
37
37
  def configuration
38
- Vedeu::Config.log(Esc.green { '[api]' }, options)
38
+ Vedeu::Config
39
+ .log(Vedeu::EscapeSequences::Esc.green { '[api]' }, options)
39
40
  end
40
41
 
41
42
  # Sets boolean to allow user input. The default behaviour of
@@ -35,7 +35,7 @@ module Vedeu
35
35
 
36
36
  parser.parse!(args)
37
37
 
38
- Vedeu::Config.log(Esc.blue { '[cli]' }, options)
38
+ Vedeu::Config.log(Vedeu::EscapeSequences::Esc.blue { '[cli]' }, options)
39
39
  end
40
40
 
41
41
  protected
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Cursor
9
9
 
10
- include Vedeu::Model
10
+ include Vedeu::Repositories::Model
11
11
  include Vedeu::Toggleable
12
12
  extend Forwardable
13
13
 
@@ -52,7 +52,8 @@ module Vedeu
52
52
  # this cursor belongs to.
53
53
  # @option attributes ox [Fixnum] The offset x coordinate.
54
54
  # @option attributes oy [Fixnum] The offset y coordinate.
55
- # @option attributes repository [Vedeu::Repository]
55
+ # @option attributes repository
56
+ # [Vedeu::Repositories::Repository]
56
57
  # @option attributes visible [Boolean] The visibility of the
57
58
  # cursor.
58
59
  # @option attributes x [Fixnum] The terminal x coordinate for
@@ -75,10 +76,7 @@ module Vedeu
75
76
  def move_down
76
77
  @oy += 1
77
78
 
78
- @attributes = attributes.merge!(x: x,
79
- y: coordinate.y_position,
80
- ox: ox,
81
- oy: oy)
79
+ @attributes = new_attributes(coordinate.y_position, x, oy, ox)
82
80
 
83
81
  Vedeu::Cursors::Cursor.new(@attributes).store
84
82
  end
@@ -89,10 +87,7 @@ module Vedeu
89
87
  def move_left
90
88
  @ox -= 1
91
89
 
92
- @attributes = attributes.merge!(x: coordinate.x_position,
93
- y: y,
94
- ox: ox,
95
- oy: oy)
90
+ @attributes = new_attributes(y, coordinate.x_position, oy, ox)
96
91
 
97
92
  Vedeu::Cursors::Cursor.new(@attributes).store
98
93
  end
@@ -112,10 +107,7 @@ module Vedeu
112
107
  def move_right
113
108
  @ox += 1
114
109
 
115
- @attributes = attributes.merge!(x: coordinate.x_position,
116
- y: y,
117
- ox: ox,
118
- oy: oy)
110
+ @attributes = new_attributes(y, coordinate.x_position, oy, ox)
119
111
 
120
112
  Vedeu::Cursors::Cursor.new(@attributes).store
121
113
  end
@@ -126,10 +118,7 @@ module Vedeu
126
118
  def move_up
127
119
  @oy -= 1
128
120
 
129
- @attributes = attributes.merge!(x: x,
130
- y: coordinate.y_position,
131
- ox: ox,
132
- oy: oy)
121
+ @attributes = new_attributes(coordinate.y_position, x, oy, ox)
133
122
 
134
123
  Vedeu::Cursors::Cursor.new(@attributes).store
135
124
  end
@@ -143,14 +132,14 @@ module Vedeu
143
132
 
144
133
  # Arbitrarily move the cursor to a given position.
145
134
  #
146
- # @param new_y [Fixnum] The row/line position.
147
- # @param new_x [Fixnum] The column/character position.
135
+ # @param new_oy [Fixnum] The row/line position.
136
+ # @param new_ox [Fixnum] The column/character position.
148
137
  # @return [Vedeu::Cursors::Cursor]
149
- def reposition(new_y, new_x)
150
- @attributes = attributes.merge!(x: coordinate.x_position,
151
- y: coordinate.y_position,
152
- ox: new_x,
153
- oy: new_y)
138
+ def reposition(new_oy, new_ox)
139
+ @attributes = new_attributes(coordinate.y_position,
140
+ coordinate.x_position,
141
+ new_oy,
142
+ new_ox)
154
143
 
155
144
  Vedeu::Cursors::Cursor.new(@attributes).store
156
145
  end
@@ -280,12 +269,23 @@ module Vedeu
280
269
  }
281
270
  end
282
271
 
272
+ # @return [Hash]
273
+ def new_attributes(new_y = y, new_x = x, new_oy = oy, new_ox = ox)
274
+ attributes.merge!(x: new_x, y: new_y, ox: new_ox, oy: new_oy)
275
+ end
276
+
283
277
  # Returns the escape sequence for setting the visibility of the
284
278
  # cursor.
285
279
  #
286
280
  # @return [String]
287
281
  def visibility
288
- value = visible? ? Vedeu::Esc.show_cursor : Vedeu::Esc.hide_cursor
282
+ value = if visible?
283
+ Vedeu::EscapeSequences::Esc.show_cursor
284
+
285
+ else
286
+ Vedeu::EscapeSequences::Esc.hide_cursor
287
+
288
+ end
289
289
 
290
290
  Vedeu::Models::Escape.new(position: position, value: value)
291
291
  end
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of each interface's cursor.
6
6
  #
7
- class Repository < Vedeu::Repository
7
+ class Repository < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :cursors, :repository)
10
10
 
@@ -0,0 +1,16 @@
1
+ module Vedeu
2
+
3
+ # Provides a mechanism to control a running client application via
4
+ # DRb.
5
+ #
6
+ module Distributed
7
+
8
+ end # Distributed
9
+
10
+ end # Vedeu
11
+
12
+ require 'vedeu/distributed/uri'
13
+ require 'vedeu/distributed/server'
14
+ require 'vedeu/distributed/client'
15
+ require 'vedeu/distributed/subprocess'
16
+ require 'vedeu/distributed/test_application'
@@ -66,9 +66,9 @@ module Vedeu
66
66
  # @option attributes views [String]
67
67
  # @return [Vedeu::TestApplication]
68
68
  def initialize(attributes = {})
69
- @attributes = defaults.merge!(attributes)
70
-
71
- @attributes.each { |k, _| instance_variable_set("@#{k}", @attributes[k]) }
69
+ defaults.merge!(attributes).each do |key, value|
70
+ instance_variable_set("@#{key}", value)
71
+ end
72
72
  end
73
73
 
74
74
  # @param block [Proc]
@@ -0,0 +1,22 @@
1
+ module Vedeu
2
+
3
+ # Provides a mechanism to help configure and use Vedeu.
4
+ #
5
+ module DSL
6
+
7
+ end # DSL
8
+
9
+ end # Vedeu
10
+
11
+ require 'vedeu/dsl/dsl'
12
+ require 'vedeu/dsl/shared'
13
+ require 'vedeu/dsl/use'
14
+ require 'vedeu/dsl/presentation'
15
+ require 'vedeu/dsl/composition'
16
+ require 'vedeu/dsl/group'
17
+ require 'vedeu/dsl/keymap'
18
+ require 'vedeu/dsl/text'
19
+ require 'vedeu/dsl/interface'
20
+ require 'vedeu/dsl/line'
21
+ require 'vedeu/dsl/stream'
22
+ require 'vedeu/dsl/view'