vedeu 0.4.55 → 0.4.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu.rb +1 -1
  3. data/lib/vedeu/application.rb +2 -2
  4. data/lib/vedeu/buffers/buffer.rb +3 -3
  5. data/lib/vedeu/buffers/buffers.rb +1 -1
  6. data/lib/vedeu/buffers/display_buffer.rb +3 -3
  7. data/lib/vedeu/colours/colour.rb +1 -1
  8. data/lib/vedeu/colours/colour_translator.rb +4 -4
  9. data/lib/vedeu/configuration/api.rb +4 -4
  10. data/lib/vedeu/configuration/cli.rb +1 -1
  11. data/lib/vedeu/configuration/configuration.rb +2 -2
  12. data/lib/vedeu/cursor/cursor.rb +5 -5
  13. data/lib/vedeu/cursor/cursors.rb +1 -1
  14. data/lib/vedeu/cursor/move.rb +8 -8
  15. data/lib/vedeu/cursor/reposition.rb +2 -2
  16. data/lib/vedeu/distributed/client.rb +1 -1
  17. data/lib/vedeu/distributed/server.rb +1 -1
  18. data/lib/vedeu/distributed/test_application.rb +1 -1
  19. data/lib/vedeu/distributed/uri.rb +1 -1
  20. data/lib/vedeu/dsl/border.rb +3 -3
  21. data/lib/vedeu/dsl/composition.rb +4 -4
  22. data/lib/vedeu/dsl/geometry.rb +4 -4
  23. data/lib/vedeu/dsl/group.rb +4 -4
  24. data/lib/vedeu/dsl/interface.rb +9 -9
  25. data/lib/vedeu/dsl/keymap.rb +10 -8
  26. data/lib/vedeu/dsl/line.rb +5 -5
  27. data/lib/vedeu/dsl/stream.rb +2 -2
  28. data/lib/vedeu/dsl/use.rb +2 -2
  29. data/lib/vedeu/dsl/view.rb +7 -7
  30. data/lib/vedeu/events/event.rb +1 -1
  31. data/lib/vedeu/events/events.rb +1 -1
  32. data/lib/vedeu/geometry/geometries.rb +1 -1
  33. data/lib/vedeu/geometry/grid.rb +8 -8
  34. data/lib/vedeu/geometry/position_validator.rb +1 -1
  35. data/lib/vedeu/input/input.rb +1 -1
  36. data/lib/vedeu/input/key.rb +2 -2
  37. data/lib/vedeu/input/keymap.rb +1 -1
  38. data/lib/vedeu/input/keymaps.rb +1 -1
  39. data/lib/vedeu/input/mapper.rb +3 -3
  40. data/lib/vedeu/launcher.rb +1 -1
  41. data/lib/vedeu/log.rb +7 -7
  42. data/lib/vedeu/models/all.rb +1 -2
  43. data/lib/vedeu/models/char.rb +1 -1
  44. data/lib/vedeu/models/composition.rb +2 -2
  45. data/lib/vedeu/models/{escape_char.rb → escape.rb} +5 -5
  46. data/lib/vedeu/models/focus.rb +5 -3
  47. data/lib/vedeu/models/groups.rb +1 -1
  48. data/lib/vedeu/models/interface.rb +1 -1
  49. data/lib/vedeu/models/interfaces.rb +1 -1
  50. data/lib/vedeu/models/line.rb +2 -2
  51. data/lib/vedeu/models/menu.rb +3 -3
  52. data/lib/vedeu/models/menus.rb +1 -1
  53. data/lib/vedeu/models/stream.rb +1 -1
  54. data/lib/vedeu/output/border.rb +2 -2
  55. data/lib/vedeu/output/borders.rb +1 -1
  56. data/lib/vedeu/output/html_char.rb +42 -21
  57. data/lib/vedeu/output/refresh.rb +4 -4
  58. data/lib/vedeu/output/renderers/html.rb +22 -5
  59. data/lib/vedeu/output/renderers/renderer_options.rb +4 -0
  60. data/lib/vedeu/output/style.rb +1 -1
  61. data/lib/vedeu/output/text.rb +1 -1
  62. data/lib/vedeu/output/viewport.rb +1 -1
  63. data/lib/vedeu/output/virtual_terminal.rb +2 -1
  64. data/lib/vedeu/repositories/collection.rb +1 -1
  65. data/lib/vedeu/repositories/repository.rb +9 -5
  66. data/lib/vedeu/templating/helpers.rb +4 -4
  67. data/lib/vedeu/templating/template.rb +6 -4
  68. data/lib/vedeu/terminal.rb +2 -2
  69. data/lib/vedeu/version.rb +1 -1
  70. data/test/lib/vedeu/cursor/cursor_test.rb +2 -2
  71. data/test/lib/vedeu/models/{escape_char_test.rb → escape_test.rb} +4 -4
  72. data/test/lib/vedeu/models/group_test.rb +12 -0
  73. data/test/lib/vedeu/output/compressor_test.rb +2 -2
  74. data/test/lib/vedeu/output/html_char_test.rb +9 -2
  75. data/test/lib/vedeu/repositories/all_test.rb +21 -0
  76. data/test/lib/vedeu/repositories/repository_test.rb +2 -2
  77. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e84104ce6f4159eb294124d8a6074932fa995a85
4
- data.tar.gz: b7b8f4ebd1a8955378a9caec05edeee224910750
3
+ metadata.gz: 743d4a2661b960f89aa308cee33ba6e0625f76e6
4
+ data.tar.gz: 6df290d61f188f90a527fbdc49673b38e8f572dc
5
5
  SHA512:
6
- metadata.gz: d354c6aa5c3e636dcffd8896eba97817ec24f53c125cb119018b8fea96659ec9000caec97e6687694193efff159fa33c05c45038ac2e6bfcd758a50d5251bd82
7
- data.tar.gz: 6698d400d2c4ff865b8005d356feb294d266632431d964184ec9e9fd298a94c7fc17ebefefa3c925e2dacbf40c712da6c457f94887f4aa9755fee731f1f8915d
6
+ metadata.gz: 2b56f22b2eff13f49f599717e5c1dd8f1902d904965761c1076325cbfd9b2016e57278ab0e1000330e6ef2f358a004ecb9edfbdaf69704e565cf7f767dafad60
7
+ data.tar.gz: 779ad640efaab6cc5b7213e1e00b784353816386d892c0835613544f975e6e208b3052b72de5943b7ca56a23d983931d32215078accb6884243d1644382e1dd8
@@ -45,7 +45,7 @@ module Vedeu
45
45
  # # ...
46
46
  # end
47
47
  #
48
- # @param receiver []
48
+ # @param receiver [void]
49
49
  # @return [void]
50
50
  def included(receiver)
51
51
  receiver.send(:include, API)
@@ -38,7 +38,7 @@ module Vedeu
38
38
  # Returns a new instance of Vedeu::Application.
39
39
  #
40
40
  # @param configuration [Vedeu::Configuration]
41
- # @return [Application]
41
+ # @return [Vedeu::Application]
42
42
  def initialize(configuration)
43
43
  @configuration = configuration
44
44
  end
@@ -69,7 +69,7 @@ module Vedeu
69
69
  protected
70
70
 
71
71
  # @!attribute [r] configuration
72
- # @return [Configuration]
72
+ # @return [Vedeu::Configuration]
73
73
  attr_reader :configuration
74
74
 
75
75
  private
@@ -20,21 +20,21 @@ module Vedeu
20
20
  # on next refresh.
21
21
  #
22
22
  # @!attribute [rw] back
23
- # @return [Interface]
23
+ # @return [Vedeu::Interface]
24
24
  attr_accessor :back
25
25
 
26
26
  # The currently displayed buffer, contains the content which was last
27
27
  # output.
28
28
  #
29
29
  # @!attribute [rw] front
30
- # @return [Interface]
30
+ # @return [Vedeu::Interface]
31
31
  attr_accessor :front
32
32
 
33
33
  # The previous buffer which was displayed; contains the content that was
34
34
  # shown before 'front'.
35
35
  #
36
36
  # @!attribute [rw] previous
37
- # @return [Interface]
37
+ # @return [Vedeu::Interface]
38
38
  attr_accessor :previous
39
39
 
40
40
  # @!attribute [r] name
@@ -6,7 +6,7 @@ module Vedeu
6
6
  # Allows the storing of view buffers.
7
7
  #
8
8
  # @api public
9
- class Buffers < Repository
9
+ class Buffers < Vedeu::Repository
10
10
 
11
11
  class << self
12
12
 
@@ -11,7 +11,7 @@ module Vedeu
11
11
  # Store the view and immediate refresh it; causing to be pushed to the
12
12
  # Terminal.
13
13
  #
14
- # @return [Interface]
14
+ # @return [Vedeu::Interface]
15
15
  def store_immediate
16
16
  store_deferred
17
17
 
@@ -23,11 +23,11 @@ module Vedeu
23
23
  # Store the view if it has a name. This view will be shown next time the
24
24
  # refresh event is triggered for the interface.
25
25
  #
26
- # @raise [InvalidSyntax] The name is not defined.
26
+ # @raise [Vedeu::InvalidSyntax] The name is not defined.
27
27
  # @return [Vedeu::Interface]
28
28
  def store_deferred
29
29
  unless present?(name)
30
- fail InvalidSyntax, 'Cannot store an interface without a name.'
30
+ fail Vedeu::InvalidSyntax, 'Cannot store an interface without a name.'
31
31
  end
32
32
 
33
33
  store_new_buffer
@@ -41,7 +41,7 @@ module Vedeu
41
41
  # @return [Vedeu::Foreground]
42
42
  attr_reader :foreground
43
43
 
44
- # @param value []
44
+ # @param value [Vedeu::Colour|Fixnum|Hash|String]
45
45
  # @return [Object]
46
46
  def self.coerce(value)
47
47
  return value if value.is_a?(self)
@@ -249,11 +249,11 @@ module Vedeu
249
249
  (css_to_rgb[2] / 51) * 1
250
250
  end
251
251
 
252
- # @raise [NotImplemented] Subclasses of this class must implement this
253
- # method.
254
- # @return [NotImplemented]
252
+ # @raise [Vedeu::NotImplemented] Subclasses of this class must implement
253
+ # this method.
254
+ # @return [Vedeu::NotImplemented]
255
255
  def not_implemented
256
- fail NotImplemented, 'Subclasses implement this.'
256
+ fail Vedeu::NotImplemented, 'Subclasses implement this.'
257
257
  end
258
258
  alias_method :named_codes, :not_implemented
259
259
  alias_method :numbered_prefix, :not_implemented
@@ -27,7 +27,7 @@ module Vedeu
27
27
  # end
28
28
  #
29
29
  # @param block [Proc]
30
- # @return [Configuration::API]
30
+ # @return [Vedeu::Configuration::API]
31
31
  def initialize(&block)
32
32
  instance_eval(&block) if block_given?
33
33
  end
@@ -233,11 +233,11 @@ module Vedeu
233
233
  # the colour mode at all and allow it to be detected, or use 256 here.
234
234
  #
235
235
  # @param value [Fixnum]
236
- # @raise [InvalidSyntax] When the value parameter is not one of +8+, +16+,
237
- # +256+ or +16777216+.
236
+ # @raise [Vedeu::InvalidSyntax] When the value parameter is not one of
237
+ # +8+, +16+, +256+ or +16777216+.
238
238
  # @return [Boolean]
239
239
  def colour_mode(value = nil)
240
- fail InvalidSyntax, '`colour_mode` must be `8`, `16`, `256`, ' \
240
+ fail Vedeu::InvalidSyntax, '`colour_mode` must be `8`, `16`, `256`, ' \
241
241
  '`16777216`.' unless valid_colour_mode?(value)
242
242
  options[:colour_mode] = value
243
243
  end
@@ -20,7 +20,7 @@ module Vedeu
20
20
  # {Vedeu::API#configure}.
21
21
  #
22
22
  # @param args [Array]
23
- # @return [Configuration::CLI]
23
+ # @return [Vedeu::Configuration::CLI]
24
24
  def initialize(args = [])
25
25
  @args = args
26
26
  @options = {}
@@ -65,7 +65,7 @@ module Vedeu
65
65
  # @option opts stdout [File|IO]
66
66
  # @option opts stderr [File|IO]
67
67
  # @param block [Proc]
68
- # @raise [InvalidSyntax] When the required block is not given.
68
+ # @raise [Vedeu::InvalidSyntax] When the required block is not given.
69
69
  # @return [Hash]
70
70
  def configure(args = [], opts = {}, &block)
71
71
  instance.configure(args, opts, &block)
@@ -225,7 +225,7 @@ module Vedeu
225
225
 
226
226
  # Create a new singleton instance of Vedeu::Configuration.
227
227
  #
228
- # @return [Configuration]
228
+ # @return [Vedeu::Configuration]
229
229
  def initialize
230
230
  @options = defaults
231
231
  end
@@ -51,7 +51,7 @@ module Vedeu
51
51
  # @option attributes x [Fixnum] The terminal x coordinate for the cursor.
52
52
  # @option attributes y [Fixnum] The terminal y coordinate for the cursor.
53
53
  #
54
- # @return [Cursor]
54
+ # @return [Vedeu::Cursor]
55
55
  def initialize(attributes = {})
56
56
  # Hack because Repository#by_name creates Cursor objects with just a
57
57
  # name.
@@ -98,7 +98,7 @@ module Vedeu
98
98
  # @example
99
99
  # Vedeu.hide_cursor(name)
100
100
  #
101
- # @return [Vedeu::EscapeChar]
101
+ # @return [Vedeu::Escape]
102
102
  def hide
103
103
  super
104
104
 
@@ -118,7 +118,7 @@ module Vedeu
118
118
  # @example
119
119
  # Vedeu.show_cursor(name)
120
120
  #
121
- # @return [Vedeu::EscapeChar]
121
+ # @return [Vedeu::Escape]
122
122
  def show
123
123
  super
124
124
 
@@ -153,9 +153,9 @@ module Vedeu
153
153
  #
154
154
  # @return [String]
155
155
  def visibility
156
- return Vedeu::EscapeChar.new(Vedeu::Esc.show_cursor) if visible?
156
+ return Vedeu::Escape.new(Vedeu::Esc.show_cursor) if visible?
157
157
 
158
- Vedeu::EscapeChar.new(Vedeu::Esc.hide_cursor)
158
+ Vedeu::Escape.new(Vedeu::Esc.hide_cursor)
159
159
  end
160
160
 
161
161
  end # Cursor
@@ -5,7 +5,7 @@ module Vedeu
5
5
  # Allows the storing of each interface's cursor.
6
6
  #
7
7
  # @api public
8
- class Cursors < Repository
8
+ class Cursors < Vedeu::Repository
9
9
 
10
10
  class << self
11
11
 
@@ -55,7 +55,7 @@ module Vedeu
55
55
  # @param name [String|NilClass] The name of the interface/cursor to be
56
56
  # moved; when not given, the interface currently in focus determines which
57
57
  # cursor instance to move.
58
- # @return [Cursor]
58
+ # @return [Vedeu::Cursor]
59
59
  def self.by_name(entity, direction, name = nil)
60
60
  name = name ? name : Vedeu.focus
61
61
 
@@ -66,7 +66,7 @@ module Vedeu
66
66
  #
67
67
  # @param entity [Class]
68
68
  # @param name [String]
69
- # @return [Cursor]
69
+ # @return [Vedeu::Cursor]
70
70
  def self.down(entity, name)
71
71
  new(entity, name, 1, 0).move
72
72
  end
@@ -75,7 +75,7 @@ module Vedeu
75
75
  #
76
76
  # @param entity [Class]
77
77
  # @param name [String]
78
- # @return [Cursor]
78
+ # @return [Vedeu::Cursor]
79
79
  def self.left(entity, name)
80
80
  new(entity, name, 0, -1).move
81
81
  end
@@ -84,7 +84,7 @@ module Vedeu
84
84
  #
85
85
  # @param entity [Class]
86
86
  # @param name [String]
87
- # @return [Cursor]
87
+ # @return [Vedeu::Cursor]
88
88
  def self.right(entity, name)
89
89
  new(entity, name, 0, 1).move
90
90
  end
@@ -93,7 +93,7 @@ module Vedeu
93
93
  #
94
94
  # @param entity [Class]
95
95
  # @param name [String]
96
- # @return [Cursor]
96
+ # @return [Vedeu::Cursor]
97
97
  def self.up(entity, name)
98
98
  new(entity, name, -1, 0).move
99
99
  end
@@ -103,7 +103,7 @@ module Vedeu
103
103
  #
104
104
  # @param entity [Class]
105
105
  # @param name [String]
106
- # @return [Cursor]
106
+ # @return [Vedeu::Cursor]
107
107
  def self.origin(entity, name)
108
108
  new(entity, name, -2000, -2000).move
109
109
  end
@@ -114,7 +114,7 @@ module Vedeu
114
114
  # @param name [String] The name of the cursor or view.
115
115
  # @param dy [Fixnum] Move up (-1), or down (1), or no action (0).
116
116
  # @param dx [Fixnum] Move left (-1), or right (1), or no action (0).
117
- # @return [Move]
117
+ # @return [Vedeu::Move]
118
118
  def initialize(entity, name, dy = 0, dx = 0)
119
119
  @entity = entity
120
120
  @name = name
@@ -192,7 +192,7 @@ module Vedeu
192
192
  coordinate.y_position(oy)
193
193
  end
194
194
 
195
- # @return [Coordinate]
195
+ # @return [Vedeu::Coordinate]
196
196
  def coordinate
197
197
  @coordinate ||= Vedeu::Coordinate.new(name)
198
198
  end
@@ -13,7 +13,7 @@ module Vedeu
13
13
 
14
14
  # Returns a new instance of Vedeu::Reposition.
15
15
  #
16
- # @param entity []
16
+ # @param entity [void]
17
17
  # @param name [String]
18
18
  # @param y [Fixnum]
19
19
  # @param x [Fixnum]
@@ -60,7 +60,7 @@ module Vedeu
60
60
 
61
61
  private
62
62
 
63
- # @return [Coordinate]
63
+ # @return [Vedeu::Coordinate]
64
64
  def coordinate
65
65
  @coordinate ||= Vedeu::Coordinate.new(name)
66
66
  end
@@ -18,7 +18,7 @@ module Vedeu
18
18
  # Returns a new instance of Vedeu::Distributed::Client.
19
19
  #
20
20
  # @param uri [Vedeu::Distributed::Uri|String]
21
- # @return [Client]
21
+ # @return [Vedeu::Distributed::Client]
22
22
  def initialize(uri)
23
23
  @uri = uri.to_s
24
24
  end
@@ -178,7 +178,7 @@ module Vedeu
178
178
  protected
179
179
 
180
180
  # @!attribute [r] configuration
181
- # @return [Configuration]
181
+ # @return [Vedeu::Configuration]
182
182
  attr_reader :configuration
183
183
 
184
184
  private
@@ -63,7 +63,7 @@ module Vedeu
63
63
  # @option attributes keymaps [String]
64
64
  # @option attributes menus [String]
65
65
  # @option attributes views [String]
66
- # @return [TestApplication]
66
+ # @return [Vedeu::TestApplication]
67
67
  def initialize(attributes = {})
68
68
  @attributes = defaults.merge!(attributes)
69
69
 
@@ -20,7 +20,7 @@ module Vedeu
20
20
  #
21
21
  # @param host [String] Hostname or IP address.
22
22
  # @param port [Fixnum|String]
23
- # @return [Uri]
23
+ # @return [Vedeu::Distributed::Uri]
24
24
  def initialize(host = 'localhost', port = 21_420)
25
25
  @host = host || 'localhost'
26
26
  @port = port || 21_420
@@ -44,10 +44,10 @@ module Vedeu
44
44
  # @param name [String] The name of the interface or view to which this
45
45
  # border belongs.
46
46
  # @param block [Proc]
47
- # @raise [InvalidSyntax] The required block was not given.
47
+ # @raise [Vedeu::InvalidSyntax] The required block was not given.
48
48
  # @return [Vedeu::Border]
49
49
  def self.border(name, &block)
50
- fail InvalidSyntax, 'block not given' unless block_given?
50
+ fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
51
51
 
52
52
  Vedeu::Border.build({ enabled: true, name: name }, &block).store
53
53
  end
@@ -381,7 +381,7 @@ module Vedeu
381
381
  attr_reader :client
382
382
 
383
383
  # @!attribute [r] model
384
- # @return [Border]
384
+ # @return [Vedeu::Border]
385
385
  attr_reader :model
386
386
 
387
387
  end # Border
@@ -43,7 +43,7 @@ module Vedeu
43
43
 
44
44
  # Returns an instance of DSL::Composition.
45
45
  #
46
- # @param model [Composition]
46
+ # @param model [Vedeu::Composition]
47
47
  # @param client [Object]
48
48
  # @return [Vedeu::DSL::Composition]
49
49
  def initialize(model, client = nil)
@@ -69,10 +69,10 @@ module Vedeu
69
69
  # # ...
70
70
  # end
71
71
  #
72
- # @raise [InvalidSyntax] The required block was not given.
72
+ # @raise [Vedeu::InvalidSyntax] The required block was not given.
73
73
  # @return [Vedeu::InterfaceCollection<Vedeu::Interface>]
74
74
  def view(name = '', &block)
75
- fail InvalidSyntax, 'block not given' unless block_given?
75
+ fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
76
76
 
77
77
  new_model = model.member.build(new_attributes(name), &block)
78
78
 
@@ -120,7 +120,7 @@ module Vedeu
120
120
  attr_reader :client
121
121
 
122
122
  # @!attribute [r] model
123
- # @return [Composition]
123
+ # @return [Vedeu::Composition]
124
124
  attr_reader :model
125
125
 
126
126
  private
@@ -42,17 +42,17 @@ module Vedeu
42
42
  # @param name [String] The name of the interface or view to which this
43
43
  # geometry belongs.
44
44
  # @param block [Proc]
45
- # @raise [InvalidSyntax] The required block was not given.
45
+ # @raise [Vedeu::InvalidSyntax] The required block was not given.
46
46
  # @return [Vedeu::Geometry]
47
47
  def self.geometry(name, &block)
48
- fail InvalidSyntax, 'block not given' unless block_given?
48
+ fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
49
49
 
50
50
  Vedeu::Geometry.build({ name: name }, &block).store
51
51
  end
52
52
 
53
53
  # Returns an instance of DSL::Geometry.
54
54
  #
55
- # @param model [Geometry]
55
+ # @param model [Vedeu::Geometry]
56
56
  # @param client [Object]
57
57
  # @return [Vedeu::DSL::Geometry]
58
58
  def initialize(model, client = nil)
@@ -233,7 +233,7 @@ module Vedeu
233
233
  attr_reader :client
234
234
 
235
235
  # @!attribute [r] model
236
- # @return [Geometry]
236
+ # @return [Vedeu::Geometry]
237
237
  attr_reader :model
238
238
 
239
239
  end # Geometry
@@ -33,17 +33,17 @@ module Vedeu
33
33
  #
34
34
  # @param name [String] The name of this group.
35
35
  # @param block [Proc]
36
- # @raise [InvalidSyntax] The required block was not given.
36
+ # @raise [Vedeu::InvalidSyntax] The required block was not given.
37
37
  # @return [Vedeu::Group]
38
38
  def self.group(name, &block)
39
- fail InvalidSyntax, 'block not given' unless block_given?
39
+ fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
40
40
 
41
41
  Vedeu::Group.build({ name: name }, &block).store
42
42
  end
43
43
 
44
44
  # Returns an instance of DSL::Group.
45
45
  #
46
- # @param model [Group]
46
+ # @param model [Vedeu::Group]
47
47
  # @param client [Object]
48
48
  # @return [Vedeu::DSL::Group]
49
49
  def initialize(model, client = nil)
@@ -66,7 +66,7 @@ module Vedeu
66
66
  attr_reader :client
67
67
 
68
68
  # @!attribute [r] model
69
- # @return [Group]
69
+ # @return [Vedeu::Group]
70
70
  attr_reader :model
71
71
 
72
72
  end # Group