vedeu 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +9 -0
  3. data/README.md +1 -1
  4. data/docs/api.md +60 -67
  5. data/docs/configuration.md +8 -5
  6. data/docs/events.md +31 -15
  7. data/docs/events/application.md +12 -0
  8. data/docs/events/document.md +57 -0
  9. data/docs/events/drb.md +43 -0
  10. data/docs/events/focus.md +24 -0
  11. data/docs/events/menu.md +57 -0
  12. data/docs/events/movement.md +57 -0
  13. data/docs/events/refresh.md +25 -0
  14. data/docs/events/system.md +90 -0
  15. data/docs/events/visibility.md +68 -0
  16. data/lib/vedeu.rb +2 -2
  17. data/lib/vedeu/all.rb +3 -2
  18. data/lib/vedeu/api.rb +18 -18
  19. data/lib/vedeu/application/controller.rb +1 -1
  20. data/lib/vedeu/application/helper.rb +1 -1
  21. data/lib/vedeu/application/view.rb +1 -1
  22. data/lib/vedeu/bindings/application.rb +1 -12
  23. data/lib/vedeu/bindings/bindings.rb +3 -1
  24. data/lib/vedeu/bindings/document.rb +9 -62
  25. data/lib/vedeu/bindings/drb.rb +12 -56
  26. data/lib/vedeu/bindings/focus.rb +3 -28
  27. data/lib/vedeu/bindings/menus.rb +10 -66
  28. data/lib/vedeu/bindings/movement.rb +4 -69
  29. data/lib/vedeu/bindings/refresh.rb +3 -33
  30. data/lib/vedeu/bindings/system.rb +14 -100
  31. data/lib/vedeu/bindings/visibility.rb +20 -71
  32. data/lib/vedeu/borders/all.rb +4 -3
  33. data/lib/vedeu/borders/border.rb +39 -33
  34. data/lib/vedeu/borders/dsl.rb +40 -33
  35. data/lib/vedeu/borders/null.rb +2 -2
  36. data/lib/vedeu/borders/render.rb +29 -24
  37. data/lib/vedeu/borders/repository.rb +2 -2
  38. data/lib/vedeu/buffers/all.rb +8 -7
  39. data/lib/vedeu/buffers/buffer.rb +47 -39
  40. data/lib/vedeu/buffers/null.rb +2 -2
  41. data/lib/vedeu/buffers/refresh.rb +4 -3
  42. data/lib/vedeu/buffers/virtual_buffer.rb +122 -118
  43. data/lib/vedeu/buffers/virtual_buffers.rb +62 -56
  44. data/lib/vedeu/colours/background.rb +2 -1
  45. data/lib/vedeu/colours/colour.rb +21 -19
  46. data/lib/vedeu/colours/foreground.rb +2 -1
  47. data/lib/vedeu/colours/repository.rb +6 -5
  48. data/lib/vedeu/colours/translator.rb +39 -35
  49. data/lib/vedeu/configuration/api.rb +59 -51
  50. data/lib/vedeu/configuration/cli.rb +9 -7
  51. data/lib/vedeu/configuration/configuration.rb +41 -32
  52. data/lib/vedeu/cursors/cursor.rb +1 -1
  53. data/lib/vedeu/cursors/refresh.rb +20 -16
  54. data/lib/vedeu/distributed/server.rb +8 -6
  55. data/lib/vedeu/distributed/subprocess.rb +90 -86
  56. data/lib/vedeu/distributed/uri.rb +4 -3
  57. data/lib/vedeu/dsl/composition.rb +2 -2
  58. data/lib/vedeu/dsl/group.rb +4 -4
  59. data/lib/vedeu/dsl/interface.rb +5 -5
  60. data/lib/vedeu/dsl/presentation.rb +2 -2
  61. data/lib/vedeu/dsl/text.rb +1 -1
  62. data/lib/vedeu/editor/cropper.rb +4 -4
  63. data/lib/vedeu/editor/cursor.rb +6 -4
  64. data/lib/vedeu/editor/document.rb +20 -18
  65. data/lib/vedeu/editor/editor.rb +2 -2
  66. data/lib/vedeu/editor/line.rb +10 -5
  67. data/lib/vedeu/editor/lines.rb +2 -2
  68. data/lib/vedeu/internal_api.rb +4 -4
  69. data/lib/vedeu/models/focus.rb +197 -191
  70. data/lib/vedeu/models/group.rb +171 -159
  71. data/lib/vedeu/models/groups.rb +14 -10
  72. data/lib/vedeu/models/interface.rb +116 -110
  73. data/lib/vedeu/models/interfaces.rb +24 -20
  74. data/lib/vedeu/models/toggleable.rb +4 -4
  75. data/lib/vedeu/models/views/char.rb +1 -1
  76. data/lib/vedeu/models/views/composition.rb +1 -1
  77. data/lib/vedeu/models/views/line.rb +1 -1
  78. data/lib/vedeu/models/views/stream.rb +1 -1
  79. data/lib/vedeu/models/views/view.rb +1 -1
  80. data/lib/vedeu/null/interface.rb +1 -1
  81. data/lib/vedeu/null/view.rb +1 -1
  82. data/lib/vedeu/output/clear/named_interface.rb +1 -1
  83. data/lib/vedeu/output/compressor.rb +78 -73
  84. data/lib/vedeu/output/direct.rb +61 -57
  85. data/lib/vedeu/output/output.rb +34 -29
  86. data/lib/vedeu/output/{presentation.rb → presentation/presentation.rb} +2 -1
  87. data/lib/vedeu/output/presentation/style.rb +64 -18
  88. data/lib/vedeu/output/presentation/styles.rb +39 -0
  89. data/lib/vedeu/output/renderers/html.rb +2 -2
  90. data/lib/vedeu/output/renderers/json.rb +2 -1
  91. data/lib/vedeu/output/renderers/terminal.rb +3 -3
  92. data/lib/vedeu/output/renderers/text.rb +3 -3
  93. data/lib/vedeu/output/text.rb +186 -180
  94. data/lib/vedeu/output/wordwrap.rb +142 -138
  95. data/lib/vedeu/refresh/refresh.rb +2 -2
  96. data/lib/vedeu/templating/helpers.rb +11 -6
  97. data/lib/vedeu/templating/view_template.rb +1 -1
  98. data/lib/vedeu/terminal/terminal.rb +2 -2
  99. data/lib/vedeu/version.rb +1 -1
  100. data/test/lib/vedeu/borders/render_test.rb +1 -1
  101. data/test/lib/vedeu/buffers/buffer_test.rb +16 -14
  102. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +105 -101
  103. data/test/lib/vedeu/buffers/virtual_buffers_test.rb +43 -39
  104. data/test/lib/vedeu/colours/colour_test.rb +4 -4
  105. data/test/lib/vedeu/cursors/cursor_test.rb +2 -2
  106. data/test/lib/vedeu/cursors/repository_test.rb +3 -3
  107. data/test/lib/vedeu/distributed/subprocess_test.rb +33 -29
  108. data/test/lib/vedeu/dsl/group_test.rb +3 -3
  109. data/test/lib/vedeu/dsl/interface_test.rb +6 -5
  110. data/test/lib/vedeu/dsl/line_test.rb +4 -2
  111. data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
  112. data/test/lib/vedeu/dsl/text_test.rb +8 -8
  113. data/test/lib/vedeu/editor/document_test.rb +10 -6
  114. data/test/lib/vedeu/input/keymap_test.rb +1 -10
  115. data/test/lib/vedeu/models/focus_test.rb +177 -170
  116. data/test/lib/vedeu/models/group_test.rb +99 -95
  117. data/test/lib/vedeu/models/groups_test.rb +13 -9
  118. data/test/lib/vedeu/models/interface_test.rb +93 -87
  119. data/test/lib/vedeu/models/interfaces_test.rb +24 -20
  120. data/test/lib/vedeu/models/views/char_test.rb +2 -2
  121. data/test/lib/vedeu/models/views/line_test.rb +11 -7
  122. data/test/lib/vedeu/models/views/stream_test.rb +1 -1
  123. data/test/lib/vedeu/models/views/view_test.rb +1 -1
  124. data/test/lib/vedeu/output/clear/named_group_test.rb +1 -1
  125. data/test/lib/vedeu/output/clear/named_interface_test.rb +3 -1
  126. data/test/lib/vedeu/output/compressor_test.rb +126 -122
  127. data/test/lib/vedeu/output/direct_test.rb +49 -43
  128. data/test/lib/vedeu/output/output_test.rb +35 -31
  129. data/test/lib/vedeu/output/{presentation_test.rb → presentation/presentation_test.rb} +11 -7
  130. data/test/lib/vedeu/output/presentation/style_test.rb +88 -48
  131. data/test/lib/vedeu/output/presentation/styles_test.rb +84 -0
  132. data/test/lib/vedeu/output/text_test.rb +109 -105
  133. data/test/lib/vedeu/output/viewport_test.rb +3 -1
  134. data/test/lib/vedeu/output/wordwrap_test.rb +209 -205
  135. data/test/lib/vedeu/refresh/refresh_test.rb +3 -1
  136. data/test/lib/vedeu/templating/helpers_test.rb +6 -6
  137. data/test/lib/vedeu/templating/view_template_test.rb +1 -1
  138. metadata +17 -8
  139. data/lib/vedeu/output/style.rb +0 -76
  140. data/test/lib/vedeu/output/style_test.rb +0 -120
@@ -2,8 +2,8 @@ module Vedeu
2
2
 
3
3
  module Buffers
4
4
 
5
- # Provides a non-existent Vedeu::Buffers::Buffer that acts like the real
6
- # thing, but does nothing.
5
+ # Provides a non-existent Vedeu::Buffers::Buffer that acts like
6
+ # the real thing, but does nothing.
7
7
  #
8
8
  class Null
9
9
 
@@ -11,8 +11,8 @@ module Vedeu
11
11
 
12
12
  include Vedeu::Common
13
13
 
14
- # @param name [String] The name of the interface to be refreshed using the
15
- # named buffer.
14
+ # @param name [String] The name of the interface to be refreshed
15
+ # using the named buffer.
16
16
  # @return [Array|Vedeu::Error::ModelNotFound]
17
17
  def self.by_name(name)
18
18
  new(name).by_name
@@ -41,7 +41,8 @@ module Vedeu
41
41
 
42
42
  private
43
43
 
44
- # @raise [Vedeu::Error::MissingRequired] When the name is empty or nil.
44
+ # @raise [Vedeu::Error::MissingRequired] When the name is empty
45
+ # or nil.
45
46
  # @return [String]
46
47
  def buffer_name
47
48
  return name if present?(name)
@@ -1,132 +1,136 @@
1
1
  module Vedeu
2
2
 
3
- # Represents a {Vedeu::Terminal} view as a grid of
4
- # {Vedeu::Models::Cell} objects.
5
- #
6
- class VirtualBuffer
7
-
8
- # @!attribute [rw] renderer
9
- # @return [void]
10
- attr_accessor :renderer
11
-
12
- # @!attribute [r] height
13
- # @return [Fixnum]
14
- attr_reader :height
15
-
16
- # @!attribute [r] width
17
- # @return [Fixnum]
18
- attr_reader :width
19
-
20
- # @param data [Array<Array<Vedeu::Views::Char>>]
21
- # @return [Array<Array<Vedeu::Views::Char>>]
22
- # @see Vedeu::VirtualBuffer#output
23
- def self.output(data)
24
- new(Vedeu.height, Vedeu.width, Vedeu::Renderers::HTML.new).output(data)
25
- end
26
-
27
- # Returns a new instance of Vedeu::VirtualBuffer.
28
- #
29
- # @param height [Fixnum]
30
- # @param width [Fixnum]
31
- # @param renderer [Object|Vedeu::Renderers::HTML] An object
32
- # responding to .render.
33
- # @return [Vedeu::VirtualBuffer]
34
- def initialize(height, width, renderer = Vedeu::Renderers::HTML.new)
35
- @height = height
36
- @width = width
37
- @renderer = renderer
38
- end
39
-
40
- # Return a grid of {Vedeu::Views::Char} objects defined by the
41
- # height and width of this virtual terminal.
42
- #
43
- # @return [Array<Array<Vedeu::Views::Char>>]
44
- def cells
45
- @cells ||= new_virtual_buffer
46
- end
3
+ module Buffers
47
4
 
48
- # Read a single cell from the virtual terminal.
5
+ # Represents a {Vedeu::Terminal} view as a grid of
6
+ # {Vedeu::Models::Cell} objects.
49
7
  #
50
- # @note
51
- # Given two actual coordinates (y, x) e.g. (1, 1)
52
- # Convert to coordinate indices (cy, cx) e.g. (0, 0)
53
- # Fetch the row at cy and return the cell from cx
54
- #
55
- # @param y [Fixnum] The row/line coordinate.
56
- # @param x [Fixnum] The column/character coordinate.
57
- # @return [Vedeu::Views::Char]
58
- def read(y, x)
59
- cy, cx = Vedeu::Geometry::Position[y, x].as_indices
8
+ class VirtualBuffer
60
9
 
61
- row = fetch(cells, cy)
62
- cell = fetch(row, cx)
10
+ # @!attribute [rw] renderer
11
+ # @return [void]
12
+ attr_accessor :renderer
63
13
 
64
- cell
65
- end
14
+ # @!attribute [r] height
15
+ # @return [Fixnum]
16
+ attr_reader :height
66
17
 
67
- # Write a collection of cells to the virtual terminal.
68
- #
69
- # @param data [Array<Array<Vedeu::Views::Char>>]
70
- # @return [Array<Array<Vedeu::Views::Char>>]
71
- def output(data)
72
- Array(data).flatten.each do |char|
73
- write(char.y, char.x, char) if char.is_a?(Vedeu::Views::Char)
18
+ # @!attribute [r] width
19
+ # @return [Fixnum]
20
+ attr_reader :width
21
+
22
+ # @param data [Array<Array<Vedeu::Views::Char>>]
23
+ # @return [Array<Array<Vedeu::Views::Char>>]
24
+ # @see Vedeu::Buffers::VirtualBuffer#output
25
+ def self.output(data)
26
+ new(Vedeu.height, Vedeu.width, Vedeu::Renderers::HTML.new).output(data)
74
27
  end
75
28
 
76
- cells
77
- end
29
+ # Returns a new instance of Vedeu::Buffers::VirtualBuffer.
30
+ #
31
+ # @param height [Fixnum]
32
+ # @param width [Fixnum]
33
+ # @param renderer [Object|Vedeu::Renderers::HTML] An object
34
+ # responding to .render.
35
+ # @return [Vedeu::Buffers::VirtualBuffer]
36
+ def initialize(height, width, renderer = Vedeu::Renderers::HTML.new)
37
+ @height = height
38
+ @width = width
39
+ @renderer = renderer
40
+ end
78
41
 
79
- # Send the cells to the renderer and return the rendered result.
80
- #
81
- # @return [String|void] Most likely to be a String.
82
- def render
83
- renderer.render(cells)
84
- end
42
+ # Return a grid of {Vedeu::Views::Char} objects defined by the
43
+ # height and width of this virtual terminal.
44
+ #
45
+ # @return [Array<Array<Vedeu::Views::Char>>]
46
+ def cells
47
+ @cells ||= new_virtual_buffer
48
+ end
85
49
 
86
- # Removes all content from the virtual terminal; effectively
87
- # clearing it.
88
- #
89
- # @return [Array<Array<Vedeu::Views::Char>>]
90
- def reset
91
- @cells = new_virtual_buffer
92
- end
93
- alias_method :clear, :reset
50
+ # Read a single cell from the virtual terminal.
51
+ #
52
+ # @note
53
+ # Given two actual coordinates (y, x) e.g. (1, 1)
54
+ # Convert to coordinate indices (cy, cx) e.g. (0, 0)
55
+ # Fetch the row at cy and return the cell from cx
56
+ #
57
+ # @param y [Fixnum] The row/line coordinate.
58
+ # @param x [Fixnum] The column/character coordinate.
59
+ # @return [Vedeu::Views::Char]
60
+ def read(y, x)
61
+ cy, cx = Vedeu::Geometry::Position[y, x].as_indices
62
+
63
+ row = fetch(cells, cy)
64
+ cell = fetch(row, cx)
65
+
66
+ cell
67
+ end
94
68
 
95
- # Write a single cell to the virtual terminal.
96
- #
97
- # @note
98
- # If the position (y, x) is nil; we're out of bounds.
99
- # Otherwise, write the data to (cy, cx).
100
- #
101
- # @param y [Fixnum] The row/line coordinate.
102
- # @param x [Fixnum] The column/character coordinate.
103
- # @param data [Vedeu::Views::Char]
104
- # @return [Vedeu::Views::Char]
105
- def write(y, x, data)
106
- return false unless read(y, x).is_a?(Vedeu::Models::Cell)
107
-
108
- cy, cx = Vedeu::Geometry::Position[y, x].as_indices
109
- cells[cy][cx] = data
110
-
111
- true
112
- end
113
-
114
- private
115
-
116
- # @param from [Array] An Array of rows, or an Array of cells.
117
- # @param which [Fixnum] A Fixnum representing the index; the row
118
- # number or the cell number for a row.
119
- # @return [Array<Vedeu::Views::Char>|Array]
120
- def fetch(from, which)
121
- from[which] || []
122
- end
123
-
124
- # @return [Array<Array<Vedeu::Models::Cell>>]
125
- # @see Vedeu::VirtualBuffer#cells
126
- def new_virtual_buffer
127
- Array.new(height) { Array.new(width) { Vedeu::Models::Cell.new } }
128
- end
129
-
130
- end # VirtualBuffer
69
+ # Write a collection of cells to the virtual terminal.
70
+ #
71
+ # @param data [Array<Array<Vedeu::Views::Char>>]
72
+ # @return [Array<Array<Vedeu::Views::Char>>]
73
+ def output(data)
74
+ Array(data).flatten.each do |char|
75
+ write(char.y, char.x, char) if char.is_a?(Vedeu::Views::Char)
76
+ end
77
+
78
+ cells
79
+ end
80
+
81
+ # Send the cells to the renderer and return the rendered result.
82
+ #
83
+ # @return [String|void] Most likely to be a String.
84
+ def render
85
+ renderer.render(cells)
86
+ end
87
+
88
+ # Removes all content from the virtual terminal; effectively
89
+ # clearing it.
90
+ #
91
+ # @return [Array<Array<Vedeu::Views::Char>>]
92
+ def reset
93
+ @cells = new_virtual_buffer
94
+ end
95
+ alias_method :clear, :reset
96
+
97
+ # Write a single cell to the virtual terminal.
98
+ #
99
+ # @note
100
+ # If the position (y, x) is nil; we're out of bounds.
101
+ # Otherwise, write the data to (cy, cx).
102
+ #
103
+ # @param y [Fixnum] The row/line coordinate.
104
+ # @param x [Fixnum] The column/character coordinate.
105
+ # @param data [Vedeu::Views::Char]
106
+ # @return [Vedeu::Views::Char]
107
+ def write(y, x, data)
108
+ return false unless read(y, x).is_a?(Vedeu::Models::Cell)
109
+
110
+ cy, cx = Vedeu::Geometry::Position[y, x].as_indices
111
+ cells[cy][cx] = data
112
+
113
+ true
114
+ end
115
+
116
+ private
117
+
118
+ # @param from [Array] An Array of rows, or an Array of cells.
119
+ # @param which [Fixnum] A Fixnum representing the index; the row
120
+ # number or the cell number for a row.
121
+ # @return [Array<Vedeu::Views::Char>|Array]
122
+ def fetch(from, which)
123
+ from[which] || []
124
+ end
125
+
126
+ # @return [Array<Array<Vedeu::Models::Cell>>]
127
+ # @see Vedeu::Buffers::VirtualBuffer#cells
128
+ def new_virtual_buffer
129
+ Array.new(height) { Array.new(width) { Vedeu::Models::Cell.new } }
130
+ end
131
+
132
+ end # VirtualBuffer
133
+
134
+ end # Buffers
131
135
 
132
136
  end # Vedeu
@@ -1,71 +1,77 @@
1
1
  module Vedeu
2
2
 
3
- # Store and retrieve {Vedeu::VirtualBuffer} objects.
4
- #
5
- # Each {Vedeu::VirtualBuffer} object is a copy of the current terminal
6
- # including content but not as String objects but {Vedeu::Views::Char}
7
- # objects. Using {Vedeu::Views::Char} objects means that we can store the data
8
- # used to make up the displayed character, complete with its colour, position
9
- # and style.
10
- #
11
- # Once a {Vedeu::Views::Char} has been converted to a String, it is tricky to
12
- # separate the escape sequences and string data. By deferring this conversion
13
- # we can display the {Vedeu::Views::Char} in multiple ways (e.g. HTML) or in
14
- # multiple formats (e.g. JSON), and render/use that in an appropriate way.
15
- #
16
- module VirtualBuffers
3
+ module Buffers
17
4
 
18
- extend self
19
-
20
- # Fetch the oldest stored virtual buffer first.
5
+ # Store and retrieve {Vedeu::Buffers::VirtualBuffer} objects.
6
+ #
7
+ # Each {Vedeu::Buffers::VirtualBuffer} object is a copy of the
8
+ # current terminal including content but not as String objects but
9
+ # {Vedeu::Views::Char} objects. Using {Vedeu::Views::Char} objects
10
+ # means that we can store the data used to make up the displayed
11
+ # character, complete with its colour, position and style.
12
+ #
13
+ # Once a {Vedeu::Views::Char} has been converted to a String, it
14
+ # is tricky to separate the escape sequences and string data. By
15
+ # deferring this conversion we can display the
16
+ # {Vedeu::Views::Char} in multiple ways (e.g. HTML) or in multiple
17
+ # formats (e.g. JSON), and render/use that in an appropriate way.
21
18
  #
22
- # @return [Array<Array<Vedeu::Views::Char>>|NilClass]
23
- def retrieve
24
- Vedeu.log(type: :drb, message: 'Retrieving output')
19
+ module VirtualBuffers
25
20
 
26
- storage.pop
27
- end
21
+ extend self
28
22
 
29
- # Store a new virtual buffer.
30
- #
31
- # @return [Array<Array<Vedeu::Views::Char>>]
32
- def store(data)
33
- Vedeu.log(type: :drb, message: 'Storing output')
23
+ # Fetch the oldest stored virtual buffer first.
24
+ #
25
+ # @return [Array<Array<Vedeu::Views::Char>>|NilClass]
26
+ def retrieve
27
+ Vedeu.log(type: :drb, message: 'Retrieving output')
34
28
 
35
- storage.unshift(data)
36
- end
29
+ storage.pop
30
+ end
37
31
 
38
- # Return the number of virtual buffers currently stored.
39
- #
40
- # @return [Fixnum]
41
- def size
42
- storage.size
43
- end
32
+ # Store a new virtual buffer.
33
+ #
34
+ # @return [Array<Array<Vedeu::Views::Char>>]
35
+ def store(data)
36
+ Vedeu.log(type: :drb, message: 'Storing output')
44
37
 
45
- # Destroy all virtual buffers currently stored.
46
- #
47
- # @return [Array]
48
- def clear
49
- @storage = in_memory
50
- end
51
- alias_method :reset, :clear
38
+ storage.unshift(data)
39
+ end
52
40
 
53
- private
41
+ # Return the number of virtual buffers currently stored.
42
+ #
43
+ # @return [Fixnum]
44
+ def size
45
+ storage.size
46
+ end
54
47
 
55
- # Access to the storage for this repository.
56
- #
57
- # @return [Array]
58
- def storage
59
- @storage ||= in_memory
60
- end
48
+ # Destroy all virtual buffers currently stored.
49
+ #
50
+ # @return [Array]
51
+ def clear
52
+ @storage = in_memory
53
+ end
54
+ alias_method :reset, :clear
61
55
 
62
- # Returns an empty collection ready for the storing of virtual buffers.
63
- #
64
- # @return [Array]
65
- def in_memory
66
- []
67
- end
56
+ private
57
+
58
+ # Access to the storage for this repository.
59
+ #
60
+ # @return [Array]
61
+ def storage
62
+ @storage ||= in_memory
63
+ end
64
+
65
+ # Returns an empty collection ready for the storing of virtual
66
+ # buffers.
67
+ #
68
+ # @return [Array]
69
+ def in_memory
70
+ []
71
+ end
72
+
73
+ end # VirtualBuffers
68
74
 
69
- end # VirtualBuffers
75
+ end # Buffers
70
76
 
71
77
  end # Vedeu
@@ -3,7 +3,8 @@ module Vedeu
3
3
  module Colours
4
4
 
5
5
  # The class represents one half (the other, can be found at
6
- # {Vedeu::Colours::Foreground}) of a terminal colour escape sequence.
6
+ # {Vedeu::Colours::Foreground}) of a terminal colour escape
7
+ # sequence.
7
8
  #
8
9
  class Background < Vedeu::Colours::Translator
9
10
 
@@ -2,17 +2,18 @@ module Vedeu
2
2
 
3
3
  module Colours
4
4
 
5
- # Provides a container for terminal escape sequences controlling the
6
- # foreground and background colours of a character or collection of
7
- # characters.
5
+ # Provides a container for terminal escape sequences controlling
6
+ # the foreground and background colours of a character or
7
+ # collection of characters.
8
8
  #
9
- # Vedeu uses HTML/CSS style notation (i.e. '#aadd00'), they can be used at
10
- # the stream level, the line level or for the whole interface. Terminals
11
- # generally support either 8, 16 or 256 colours, with few supporting full
12
- # 24-bit colour (see notes below).
9
+ # Vedeu uses HTML/CSS style notation (i.e. '#aadd00'), they can be
10
+ # used at the stream level, the line level or for the whole
11
+ # interface. Terminals generally support either 8, 16 or 256
12
+ # colours, with few supporting full 24-bit colour (see notes
13
+ # below).
13
14
  #
14
- # Vedeu attempts to detect the colour depth using the `$TERM` environment
15
- # variable.
15
+ # Vedeu attempts to detect the colour depth using the `$TERM`
16
+ # environment variable.
16
17
  #
17
18
  # To set your `$TERM` variable to allow 256 colour support:
18
19
  #
@@ -21,15 +22,16 @@ module Vedeu
21
22
  # ```
22
23
  #
23
24
  # Notes:
24
- # Terminals which support the 24-bit colour mode include (but are not
25
- # limited to): iTerm2 (OSX), Gnome Terminal (Linux).
25
+ # Terminals which support the 24-bit colour mode include (but are
26
+ # not limited to): iTerm2 (OSX), Gnome Terminal (Linux).
26
27
  #
27
- # Setting your `$TERM` environment variable as above gets you up to 256
28
- # colours, but when you then add the `colour_mode 16_777_216` configuration
29
- # to your client application, it's really a hit and miss affair. iTerm2
30
- # renders all the colours correctly as does Gnome Terminal. Terminator
31
- # (Linux) goes crazy though and defaults to 16 colours despite the `$TERM`
32
- # setting. This area needs more work in Vedeu.
28
+ # Setting your `$TERM` environment variable as above gets you up
29
+ # to 256 colours, but when you then add the
30
+ # `colour_mode 16_777_216` configuration to your client
31
+ # application, it's really a hit and miss affair. iTerm2 renders
32
+ # all the colours correctly as does Gnome Terminal. Terminator
33
+ # (Linux) goes crazy though and defaults to 16 colours despite the
34
+ # `$TERM` setting. This area needs more work in Vedeu.
33
35
  #
34
36
  # @todo Fix colours in all terminals. (GL: 2015-04-13)
35
37
  #
@@ -101,8 +103,8 @@ module Vedeu
101
103
  @foreground = Vedeu::Colours::Foreground.coerce(value)
102
104
  end
103
105
 
104
- # Returns both or either of the converted attributes into a single escape
105
- # sequence.
106
+ # Returns both or either of the converted attributes into a
107
+ # single escape sequence.
106
108
  #
107
109
  # @return [String]
108
110
  def to_s