vedeu 0.8.20 → 0.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/docs/dsl/by_method/geometry/align_centre.md +3 -0
  3. data/docs/dsl/by_method/geometry/columns.md +12 -1
  4. data/docs/dsl/by_method/geometry/height.md +9 -0
  5. data/docs/dsl/by_method/geometry/horizontal_alignment.md +3 -1
  6. data/docs/dsl/by_method/geometry/rows.md +12 -1
  7. data/docs/dsl/by_method/geometry/vertical_alignment.md +3 -1
  8. data/docs/dsl/by_method/geometry/width.md +9 -0
  9. data/docs/dsl/by_method/geometry/x.md +11 -1
  10. data/docs/dsl/by_method/geometry/xn.md +14 -1
  11. data/docs/dsl/by_method/geometry/y.md +11 -1
  12. data/docs/dsl/by_method/geometry/yn.md +12 -1
  13. data/docs/dsl/by_method/geometry/zindex.md +18 -0
  14. data/docs/dsl/by_method/template_for.md +10 -0
  15. data/docs/dsl/by_method/use.md +21 -0
  16. data/integrations/342_streams.rb +3 -1
  17. data/integrations/dsl_app_001.rb +3 -1
  18. data/integrations/dsl_app_002.rb +3 -1
  19. data/integrations/dsl_app_003.rb +3 -1
  20. data/integrations/dsl_app_004.rb +3 -1
  21. data/integrations/dsl_app_005.rb +3 -1
  22. data/integrations/dsl_app_006.rb +3 -1
  23. data/integrations/dsl_app_007.rb +3 -1
  24. data/integrations/dsl_app_008.rb +3 -1
  25. data/integrations/dsl_app_009.rb +3 -1
  26. data/integrations/dsl_app_010.rb +3 -1
  27. data/integrations/dsl_app_011.rb +3 -1
  28. data/integrations/dsl_app_012.rb +3 -1
  29. data/integrations/dsl_app_013.rb +3 -1
  30. data/integrations/dsl_app_014.rb +3 -1
  31. data/integrations/dsl_app_015.rb +3 -1
  32. data/integrations/dsl_app_016.rb +3 -1
  33. data/integrations/dsl_app_017.rb +3 -1
  34. data/integrations/dsl_app_018.rb +3 -1
  35. data/integrations/dsl_app_019.rb +3 -1
  36. data/integrations/dsl_app_020.rb +3 -1
  37. data/integrations/dsl_app_021.rb +3 -1
  38. data/integrations/dsl_app_022.rb +3 -1
  39. data/integrations/dsl_app_border_001.rb +3 -1
  40. data/integrations/dsl_app_border_002.rb +3 -1
  41. data/integrations/dsl_app_border_003.rb +3 -1
  42. data/integrations/dsl_app_border_004.rb +3 -1
  43. data/integrations/dsl_app_border_005.rb +3 -1
  44. data/integrations/dsl_app_border_006.rb +3 -1
  45. data/integrations/dsl_app_border_007.rb +3 -1
  46. data/integrations/dsl_app_border_008.rb +3 -1
  47. data/integrations/dsl_app_border_009.rb +3 -1
  48. data/integrations/dsl_app_border_010.rb +3 -1
  49. data/integrations/dsl_app_border_011.rb +3 -1
  50. data/integrations/test_runner.rb +20 -10
  51. data/lib/vedeu/borders/border.rb +3 -0
  52. data/lib/vedeu/borders/dsl.rb +1 -1
  53. data/lib/vedeu/borders/refresh.rb +1 -1
  54. data/lib/vedeu/borders/repository.rb +0 -2
  55. data/lib/vedeu/buffers/buffer.rb +1 -0
  56. data/lib/vedeu/buffers/repository.rb +0 -2
  57. data/lib/vedeu/buffers/view.rb +3 -3
  58. data/lib/vedeu/cells/empty.rb +3 -0
  59. data/lib/vedeu/colours/background.rb +3 -8
  60. data/lib/vedeu/colours/foreground.rb +3 -8
  61. data/lib/vedeu/configuration/api.rb +1 -1
  62. data/lib/vedeu/configuration/configuration.rb +3 -2
  63. data/lib/vedeu/cursors/cursor.rb +1 -1
  64. data/lib/vedeu/cursors/repository.rb +0 -2
  65. data/lib/vedeu/dsl/border.rb +1 -1
  66. data/lib/vedeu/dsl/dsl.rb +1 -1
  67. data/lib/vedeu/dsl/elements.rb +4 -4
  68. data/lib/vedeu/dsl/geometry.rb +2 -2
  69. data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
  70. data/lib/vedeu/dsl/use.rb +1 -21
  71. data/lib/vedeu/dsl/view.rb +3 -13
  72. data/lib/vedeu/dsl/views.rb +15 -18
  73. data/lib/vedeu/editor/lines.rb +1 -1
  74. data/lib/vedeu/editor/repository.rb +0 -2
  75. data/lib/vedeu/esc/background.rb +17 -17
  76. data/lib/vedeu/esc/colours.rb +2 -2
  77. data/lib/vedeu/esc/esc.rb +1 -1
  78. data/lib/vedeu/esc/foreground.rb +17 -17
  79. data/lib/vedeu/events/event.rb +1 -3
  80. data/lib/vedeu/events/repository.rb +0 -2
  81. data/lib/vedeu/geometries/dsl/dsl.rb +18 -183
  82. data/lib/vedeu/geometries/move.rb +34 -49
  83. data/lib/vedeu/geometries/position.rb +1 -1
  84. data/lib/vedeu/geometries/repository.rb +0 -2
  85. data/lib/vedeu/groups/dsl.rb +1 -1
  86. data/lib/vedeu/groups/repository.rb +0 -2
  87. data/lib/vedeu/input/dsl.rb +2 -3
  88. data/lib/vedeu/input/key.rb +1 -1
  89. data/lib/vedeu/input/repository.rb +0 -2
  90. data/lib/vedeu/interfaces/dsl.rb +2 -3
  91. data/lib/vedeu/interfaces/interface.rb +3 -0
  92. data/lib/vedeu/interfaces/null.rb +3 -0
  93. data/lib/vedeu/interfaces/repository.rb +0 -2
  94. data/lib/vedeu/logging/debug.rb +1 -1
  95. data/lib/vedeu/logging/log.rb +19 -5
  96. data/lib/vedeu/logging/timer.rb +2 -2
  97. data/lib/vedeu/menus/dsl.rb +2 -3
  98. data/lib/vedeu/menus/repository.rb +0 -2
  99. data/lib/vedeu/models/page.rb +1 -1
  100. data/lib/vedeu/models/row.rb +1 -1
  101. data/lib/vedeu/output/compressor_cache.rb +10 -4
  102. data/lib/vedeu/output/compressors/simple.rb +7 -3
  103. data/lib/vedeu/output/write.rb +3 -0
  104. data/lib/vedeu/presentation/colour.rb +1 -1
  105. data/lib/vedeu/presentation/position.rb +1 -1
  106. data/lib/vedeu/presentation/presentation.rb +0 -4
  107. data/lib/vedeu/presentation/styles.rb +1 -1
  108. data/lib/vedeu/renderers/all.rb +4 -4
  109. data/lib/vedeu/repositories/assemblage.rb +2 -2
  110. data/lib/vedeu/repositories/model.rb +2 -6
  111. data/lib/vedeu/repositories/registerable.rb +10 -0
  112. data/lib/vedeu/repositories/store.rb +1 -1
  113. data/lib/vedeu/runtime/application.rb +3 -3
  114. data/lib/vedeu/runtime/launcher.rb +1 -1
  115. data/lib/vedeu/templating/helpers.rb +4 -4
  116. data/lib/vedeu/terminal/terminal.rb +2 -2
  117. data/lib/vedeu/version.rb +1 -1
  118. data/lib/vedeu/views/composition.rb +3 -0
  119. data/lib/vedeu/views/line.rb +3 -0
  120. data/lib/vedeu/views/stream.rb +3 -0
  121. data/lib/vedeu/views/view.rb +3 -0
  122. data/lib/vedeu.rb +3 -0
  123. data/test/lib/vedeu/borders/repository_test.rb +0 -2
  124. data/test/lib/vedeu/buffers/repository_test.rb +0 -2
  125. data/test/lib/vedeu/cursors/repository_test.rb +0 -2
  126. data/test/lib/vedeu/dsl/border_test.rb +26 -16
  127. data/test/lib/vedeu/editor/repository_test.rb +0 -2
  128. data/test/lib/vedeu/events/repository_test.rb +0 -2
  129. data/test/lib/vedeu/geometries/repository_test.rb +0 -4
  130. data/test/lib/vedeu/groups/repository_test.rb +0 -2
  131. data/test/lib/vedeu/input/repository_test.rb +0 -2
  132. data/test/lib/vedeu/interfaces/repository_test.rb +0 -2
  133. data/test/lib/vedeu/menus/repository_test.rb +0 -2
  134. data/test/lib/vedeu/presentation/colour_test.rb +6 -0
  135. data/test/lib/vedeu/presentation/position_test.rb +2 -0
  136. data/test/lib/vedeu/presentation/presentation_test.rb +10 -1
  137. data/test/lib/vedeu/presentation/styles_test.rb +6 -0
  138. data/test/lib/vedeu/repositories/registerable_test.rb +11 -1
  139. data/test/support/examples/material_colours_app.rb +0 -93
  140. metadata +5 -2
@@ -7,21 +7,21 @@ class TestRunner
7
7
 
8
8
  # @param (see #initialize)
9
9
  # @return [void]
10
- def self.result(testcase, file)
11
- new(testcase, file).result
10
+ def self.result(testcase, filename)
11
+ new(testcase, filename).result
12
12
  end
13
13
 
14
14
  # @param testcase [String]
15
- # @param file [String]
15
+ # @param filename [String]
16
16
  # @return [TestRunner]
17
- def initialize(testcase, file)
17
+ def initialize(testcase, filename)
18
18
  @testcase = testcase
19
- @file = file
19
+ @filename = filename
20
20
  end
21
21
 
22
22
  # @return [void]
23
23
  def result
24
- print "\e[36m#{file}: "
24
+ print "\e[36m#{filename}: "
25
25
  if expected == actual
26
26
  print "\e[32mPassed.\e[39m\n"
27
27
  exit 0;
@@ -41,20 +41,30 @@ class TestRunner
41
41
  # @return [String]
42
42
  attr_reader :testcase
43
43
 
44
- # @!attribute [r] file
44
+ # @!attribute [r] filename
45
45
  # @return [String]
46
- attr_reader :file
46
+ attr_reader :filename
47
47
 
48
48
  private
49
49
 
50
50
  # @return [String]
51
51
  def actual
52
- File.read("/tmp/#{testcase}.out")
52
+ @_actual ||= File.read(actual_path)
53
53
  end
54
54
 
55
55
  # @return [String]
56
56
  def expected
57
- File.read(File.expand_path("../expected/#{testcase}.out", file))
57
+ @_expected ||= File.read(File.expand_path(expected_path, filename))
58
+ end
59
+
60
+ # @return [String]
61
+ def actual_path
62
+ "/tmp/#{testcase}.out"
63
+ end
64
+
65
+ # @return [String]
66
+ def expected_path
67
+ "../expected/#{testcase}.out"
58
68
  end
59
69
 
60
70
  end # TestRunner
@@ -21,6 +21,9 @@ module Vedeu
21
21
  extend Forwardable
22
22
  include Vedeu::Repositories::Model
23
23
  include Vedeu::Presentation
24
+ include Vedeu::Presentation::Colour
25
+ include Vedeu::Presentation::Position
26
+ include Vedeu::Presentation::Styles
24
27
 
25
28
  # @!attribute [w] bottom_left
26
29
  # @return [String] The character to be used for the bottom left
@@ -15,7 +15,7 @@ module Vedeu
15
15
 
16
16
  # {include:file:docs/dsl/by_method/border.md}
17
17
  # @macro param_name
18
- # @param block [Proc]
18
+ # @macro param_block
19
19
  # @macro raise_requires_block
20
20
  # @macro raise_missing_required
21
21
  # @return [Vedeu::Borders::Border]
@@ -202,7 +202,7 @@ module Vedeu
202
202
  # the block.
203
203
  #
204
204
  # @param size [Fixnum]
205
- # @param block [Proc]
205
+ # @macro param_block
206
206
  # @return [Array<void>]
207
207
  def build_collection(size, &block)
208
208
  Array.new(size) { |e| yield(e) }
@@ -9,8 +9,6 @@ module Vedeu
9
9
  #
10
10
  class Repository < Vedeu::Repositories::Repository
11
11
 
12
- singleton_class.send(:alias_method, :borders, :repository)
13
-
14
12
  null Vedeu::Borders::Border, enabled: false
15
13
  real Vedeu::Borders::Border
16
14
 
@@ -9,6 +9,7 @@ module Vedeu
9
9
  #
10
10
  class Buffer
11
11
 
12
+ include Vedeu::Common
12
13
  include Vedeu::Repositories::Model
13
14
 
14
15
  # The next buffer to be displayed; contains the content which
@@ -8,8 +8,6 @@ module Vedeu
8
8
  #
9
9
  class Repository < Vedeu::Repositories::Repository
10
10
 
11
- singleton_class.send(:alias_method, :buffers, :repository)
12
-
13
11
  null Vedeu::Buffers::Null
14
12
  real Vedeu::Buffers::Buffer
15
13
 
@@ -10,9 +10,9 @@ module Vedeu
10
10
  #
11
11
  class View
12
12
 
13
- include Vedeu::Repositories::Defaults
14
- include Enumerable
15
13
  extend Forwardable
14
+ include Enumerable
15
+ include Vedeu::Repositories::Defaults
16
16
 
17
17
  def_delegators :geometry,
18
18
  :bordered_height,
@@ -31,7 +31,7 @@ module Vedeu
31
31
 
32
32
  # Provides iteration over the buffer.
33
33
  #
34
- # @param block [Proc]
34
+ # @macro param_block
35
35
  # @return [Enumerator]
36
36
  def each(&block)
37
37
  current.each(&block)
@@ -15,6 +15,9 @@ module Vedeu
15
15
  class Empty
16
16
 
17
17
  include Vedeu::Presentation
18
+ include Vedeu::Presentation::Colour
19
+ include Vedeu::Presentation::Position
20
+ include Vedeu::Presentation::Styles
18
21
  include Vedeu::Repositories::Defaults
19
22
 
20
23
  # @!attribute [r] name
@@ -19,15 +19,10 @@ module Vedeu
19
19
 
20
20
  # @return [String]
21
21
  def to_ast
22
- return '' unless background?
22
+ return '' unless background?
23
+ return ':bg' unless rgb?
23
24
 
24
- if rgb?
25
- ":bg_#{colour.to_s.slice(1..-1)}"
26
-
27
- else
28
- ':bg'
29
-
30
- end
25
+ ":bg_#{colour.to_s.slice(1..-1)}"
31
26
  end
32
27
 
33
28
  # @return [Hash<Symbol => String>]
@@ -19,15 +19,10 @@ module Vedeu
19
19
 
20
20
  # @return [String]
21
21
  def to_ast
22
- return '' unless foreground?
22
+ return '' unless foreground?
23
+ return ':fg' unless rgb?
23
24
 
24
- if rgb?
25
- ":fg_#{colour.to_s.slice(1..-1)}"
26
-
27
- else
28
- ':fg'
29
-
30
- end
25
+ ":fg_#{colour.to_s.slice(1..-1)}"
31
26
  end
32
27
 
33
28
  # @return [Hash<Symbol => String>]
@@ -28,7 +28,7 @@ module Vedeu
28
28
  # end
29
29
  #
30
30
  # @param default [Hash]
31
- # @param block [Proc]
31
+ # @macro param_block
32
32
  # @return [Vedeu::Configuration::API]
33
33
  def initialize(default, &block)
34
34
  @default = default
@@ -43,6 +43,7 @@ module Vedeu
43
43
  yellow: [:light_yellow, :yellow],
44
44
  }.freeze
45
45
 
46
+ # @return [Array<Symbol>]
46
47
  LOG_TYPES_KEYS = Vedeu::LOG_TYPES.keys.freeze
47
48
 
48
49
  # Allows the customisation of Vedeu's behaviour through the
@@ -87,7 +88,7 @@ module Vedeu
87
88
  # @option opts stdin [File|IO]
88
89
  # @option opts stdout [File|IO]
89
90
  # @option opts stderr [File|IO]
90
- # @param block [Proc]
91
+ # @macro param_block
91
92
  # @return [Hash<Symbol => void>]
92
93
  def configure(opts = {}, &block)
93
94
  instance.configure(opts, &block)
@@ -387,7 +388,7 @@ module Vedeu
387
388
  # Set up default configuration and then allow the client
388
389
  # application to modify it via the configuration API.
389
390
  #
390
- # @param block [Proc]
391
+ # @macro param_block
391
392
  # @return [Hash<Symbol => void>]
392
393
  def configure(opts = {}, &block)
393
394
  @options.merge!(opts)
@@ -156,7 +156,7 @@ module Vedeu
156
156
  # visibility. When passed a block, will position the cursor,
157
157
  # yield and return the original position.
158
158
  #
159
- # @param block [Proc]
159
+ # @macro param_block
160
160
  # @return [String]
161
161
  def to_s(&block)
162
162
  return escape_sequence.to_s unless block_given?
@@ -8,8 +8,6 @@ module Vedeu
8
8
  #
9
9
  class Repository < Vedeu::Repositories::Repository
10
10
 
11
- singleton_class.send(:alias_method, :cursors, :repository)
12
-
13
11
  class << self
14
12
 
15
13
  # {include:file:docs/dsl/by_method/cursor.md}
@@ -33,7 +33,7 @@ module Vedeu
33
33
  # end
34
34
  #
35
35
  # @macro param_name
36
- # @param block [Proc]
36
+ # @macro param_block
37
37
  # @macro raise_requires_block
38
38
  # @macro raise_missing_required
39
39
  # @return [Vedeu::Borders::Border]
data/lib/vedeu/dsl/dsl.rb CHANGED
@@ -61,7 +61,7 @@ module Vedeu
61
61
  # @param method [Symbol] The name of the method sought.
62
62
  # @param args [Array] The arguments which the method was to be
63
63
  # invoked with.
64
- # @param block [Proc] The optional block provided to the method.
64
+ # @macro param_block
65
65
  # @return [void]
66
66
  def method_missing(method, *args, &block)
67
67
  Vedeu.log(type: :debug,
@@ -59,7 +59,7 @@ module Vedeu
59
59
  # end
60
60
  # end
61
61
  #
62
- # @param block [Proc]
62
+ # @macro param_block
63
63
  # @macro raise_requires_block
64
64
  # @macro raise_fatal
65
65
  # @return [void]
@@ -112,7 +112,7 @@ module Vedeu
112
112
  # block is given.
113
113
  # @param opts [Hash]
114
114
  # @option opts ... [void]
115
- # @param block [Proc]
115
+ # @macro param_block
116
116
  # @macro raise_fatal
117
117
  # @return [void]
118
118
  def line(value = '', opts = {}, &block)
@@ -147,7 +147,7 @@ module Vedeu
147
147
  # block is given.
148
148
  # @param opts [Hash]
149
149
  # @option opts ... [void]
150
- # @param block [Proc]
150
+ # @macro param_block
151
151
  # @macro raise_fatal
152
152
  # @return [void]
153
153
  def stream(value = '', opts = {}, &block)
@@ -292,7 +292,7 @@ module Vedeu
292
292
 
293
293
  private
294
294
 
295
- # @param block [Proc]
295
+ # @macro param_block
296
296
  # @macro raise_requires_block
297
297
  # @return [NilClass]
298
298
  def requires_block!(&block)
@@ -15,7 +15,7 @@ module Vedeu
15
15
 
16
16
  # {include:file:docs/dsl/by_method/geometry.md}
17
17
  # @macro param_name
18
- # @param block [Proc]
18
+ # @macro param_block
19
19
  # @macro raise_requires_block
20
20
  # @macro raise_missing_required
21
21
  # @return [Vedeu::Geometries::Geometry]
@@ -46,7 +46,7 @@ module Vedeu
46
46
 
47
47
  # {include:file:docs/dsl/by_method/geometry.md}
48
48
  # @macro param_name
49
- # @param block [Proc]
49
+ # @macro param_block
50
50
  # @macro raise_requires_block
51
51
  # @macro raise_missing_required
52
52
  # @return [Vedeu::Geometries::Geometry]
@@ -44,7 +44,7 @@ module Vedeu
44
44
  # value.
45
45
  # @option options wordwrap [Boolean] Whether the value should be
46
46
  # wordwrapped.
47
- # @param block [Proc]
47
+ # @macro param_block
48
48
  # @return [Vedeu::DSL::Attributes]
49
49
  def initialize(context = nil,
50
50
  model = nil,
data/lib/vedeu/dsl/use.rb CHANGED
@@ -8,27 +8,7 @@ module Vedeu
8
8
  #
9
9
  module Use
10
10
 
11
- # Use the attribute of stored model.
12
- #
13
- # This DSL method provides access to a stored model by name.
14
- # You can then request an attribute of that model for use within
15
- # the current model. The models which current support this are
16
- # Border, Geometry and Interface.
17
- #
18
- # @example
19
- # # Here the character used for :my_border is used in
20
- # # :my_other_border.
21
- # Vedeu.border :my_other_border do
22
- # top_right use(:my_border).top_right
23
- # end
24
- #
25
- # @note
26
- # - Only models of the same repository can be used in this
27
- # way.
28
- # - If the stored model cannot be found, a ModelNotFound
29
- # exception may be raised, or the request for an attribute
30
- # may raise a NoMethodError exception.
31
- #
11
+ # {include:file:docs/dsl/by_method/use.md}
32
12
  # @macro param_name
33
13
  # @raise
34
14
  # [Vedeu::Error::ModelNotFound|Vedeu::Error::NoMethodError]
@@ -47,8 +47,7 @@ module Vedeu
47
47
 
48
48
  # {include:file:docs/dsl/by_method/view.md}
49
49
  # @macro param_name
50
- # @param block [Proc] The directives you wish to send to this
51
- # view.
50
+ # @macro param_block
52
51
  # @macro raise_requires_block
53
52
  # @macro raise_missing_required
54
53
  # @return [Vedeu::Views::Views<Vedeu::Views::View>]
@@ -63,17 +62,7 @@ module Vedeu
63
62
  model.add(new_model)
64
63
  end
65
64
 
66
- # Load content from an ERb template.
67
- #
68
- # @example
69
- # Vedeu.renders do
70
- # template_for(:my_interface,
71
- # '/path/to/template.erb',
72
- # @some_object, options)
73
- # end
74
- #
75
- # @todo More documentation required.
76
- #
65
+ # {include:file:docs/dsl/by_method/template_for.md}
77
66
  # @macro param_name
78
67
  # @param filename [String] The filename (including path) to the
79
68
  # template to be used. Yoy can use `File.dirname(__FILE__)` to
@@ -84,6 +73,7 @@ module Vedeu
84
73
  # {Vedeu::DSL::Wordwrap}
85
74
  # @macro raise_missing_required
86
75
  # @return [Vedeu::Views::Views<Vedeu::Views::View>]
76
+ # @todo More documentation required.
87
77
  def template_for(name, filename, object = nil, options = {})
88
78
  raise Vedeu::Error::MissingRequired,
89
79
  'Cannot render template without the name of the ' \
@@ -94,9 +94,7 @@ module Vedeu
94
94
  class << self
95
95
 
96
96
  # {include:file:docs/dsl/by_method/renders.md}
97
- # @param block [Proc] The directives you wish to send to
98
- # render. Typically includes `view` with associated
99
- # sub-directives.
97
+ # @macro param_block
100
98
  # @macro raise_requires_block
101
99
  # @return [Vedeu::Views::Composition]
102
100
  def renders(&block)
@@ -107,9 +105,7 @@ module Vedeu
107
105
  alias render renders
108
106
 
109
107
  # {include:file:docs/dsl/by_method/views.md}
110
- # @param block [Proc] The directives you wish to send to
111
- # render. Typically includes `view` with associated
112
- # sub-directives.
108
+ # @macro param_block
113
109
  # @macro raise_requires_block
114
110
  # @return [Vedeu::Views::Composition]
115
111
  def views(&block)
@@ -120,14 +116,17 @@ module Vedeu
120
116
 
121
117
  private
122
118
 
123
- # @param block [Proc] The directives you wish to send to
124
- # render. Typically includes `view` with associated
125
- # sub-directives. The binding of the block is also accessed
126
- # so that we can ascertain the calling client application
127
- # class, this is so that if there methods being called
128
- # inside your views, Vedeu will redirect that call to the
129
- # client class instance instead. (This actually occurs
130
- # when Vedeu rescues from method_missing. See {Vedeu::DSL}.)
119
+ # Handles the directives you wish to send to render. Typically
120
+ # includes `view` with associated sub-directives. The binding
121
+ # of the block is also accessed so that we can ascertain the
122
+ # calling client application class, this is so that if there
123
+ # methods being called inside your views, Vedeu will redirect
124
+ # that call to the client class instance instead. (This
125
+ # actually occurs when Vedeu rescues from method_missing. See
126
+ # {Vedeu::DSL}.)
127
+ #
128
+ # @macro param_block
129
+ # @return [void]
131
130
  def client_binding(&block)
132
131
  eval('self', block.binding).tap do |client|
133
132
  Vedeu.log(type: :debug,
@@ -139,10 +138,8 @@ module Vedeu
139
138
  # one or more view {Vedeu::Views::View} objects.
140
139
  #
141
140
  # @param refresh [Boolean]
142
- # @param block [Proc] The directives you wish to send to
143
- # render. Typically includes `view` with associated
144
- # sub-directives.
145
- # # @return [Vedeu::Views::Composition]
141
+ # @macro param_block
142
+ # @return [Vedeu::Views::Composition]
146
143
  def composition(refresh = false, &block)
147
144
  attrs = {
148
145
  client: client_binding(&block),
@@ -58,7 +58,7 @@ module Vedeu
58
58
 
59
59
  # Provides iteration over the collection.
60
60
  #
61
- # @param block [Proc]
61
+ # @macro param_block
62
62
  # @return [Enumerator]
63
63
  def each(&block)
64
64
  collection.each(&block)
@@ -8,8 +8,6 @@ module Vedeu
8
8
  #
9
9
  class Repository < Vedeu::Repositories::Repository
10
10
 
11
- singleton_class.send(:alias_method, :documents, :repository)
12
-
13
11
  real Vedeu::Editor::Document
14
12
  null Vedeu::Editor::Document
15
13
 
@@ -12,7 +12,7 @@ module Vedeu
12
12
 
13
13
  extend self
14
14
 
15
- # @param block [Proc]
15
+ # @macro param_block
16
16
  # @return [String]
17
17
  def on_black(&block)
18
18
  if block_given?
@@ -24,7 +24,7 @@ module Vedeu
24
24
  end
25
25
  end
26
26
 
27
- # @param block [Proc]
27
+ # @macro param_block
28
28
  # @return [String]
29
29
  def on_red(&block)
30
30
  if block_given?
@@ -36,7 +36,7 @@ module Vedeu
36
36
  end
37
37
  end
38
38
 
39
- # @param block [Proc]
39
+ # @macro param_block
40
40
  # @return [String]
41
41
  def on_green(&block)
42
42
  if block_given?
@@ -48,7 +48,7 @@ module Vedeu
48
48
  end
49
49
  end
50
50
 
51
- # @param block [Proc]
51
+ # @macro param_block
52
52
  # @return [String]
53
53
  def on_yellow(&block)
54
54
  if block_given?
@@ -60,7 +60,7 @@ module Vedeu
60
60
  end
61
61
  end
62
62
 
63
- # @param block [Proc]
63
+ # @macro param_block
64
64
  # @return [String]
65
65
  def on_blue(&block)
66
66
  if block_given?
@@ -72,7 +72,7 @@ module Vedeu
72
72
  end
73
73
  end
74
74
 
75
- # @param block [Proc]
75
+ # @macro param_block
76
76
  # @return [String]
77
77
  def on_magenta(&block)
78
78
  if block_given?
@@ -84,7 +84,7 @@ module Vedeu
84
84
  end
85
85
  end
86
86
 
87
- # @param block [Proc]
87
+ # @macro param_block
88
88
  # @return [String]
89
89
  def on_cyan(&block)
90
90
  if block_given?
@@ -96,7 +96,7 @@ module Vedeu
96
96
  end
97
97
  end
98
98
 
99
- # @param block [Proc]
99
+ # @macro param_block
100
100
  # @return [String]
101
101
  def on_light_grey(&block)
102
102
  if block_given?
@@ -108,7 +108,7 @@ module Vedeu
108
108
  end
109
109
  end
110
110
 
111
- # @param block [Proc]
111
+ # @macro param_block
112
112
  # @return [String]
113
113
  def on_default(&block)
114
114
  if block_given?
@@ -120,7 +120,7 @@ module Vedeu
120
120
  end
121
121
  end
122
122
 
123
- # @param block [Proc]
123
+ # @macro param_block
124
124
  # @return [String]
125
125
  def on_dark_grey(&block)
126
126
  if block_given?
@@ -132,7 +132,7 @@ module Vedeu
132
132
  end
133
133
  end
134
134
 
135
- # @param block [Proc]
135
+ # @macro param_block
136
136
  # @return [String]
137
137
  def on_light_red(&block)
138
138
  if block_given?
@@ -144,7 +144,7 @@ module Vedeu
144
144
  end
145
145
  end
146
146
 
147
- # @param block [Proc]
147
+ # @macro param_block
148
148
  # @return [String]
149
149
  def on_light_green(&block)
150
150
  if block_given?
@@ -156,7 +156,7 @@ module Vedeu
156
156
  end
157
157
  end
158
158
 
159
- # @param block [Proc]
159
+ # @macro param_block
160
160
  # @return [String]
161
161
  def on_light_yellow(&block)
162
162
  if block_given?
@@ -168,7 +168,7 @@ module Vedeu
168
168
  end
169
169
  end
170
170
 
171
- # @param block [Proc]
171
+ # @macro param_block
172
172
  # @return [String]
173
173
  def on_light_blue(&block)
174
174
  if block_given?
@@ -180,7 +180,7 @@ module Vedeu
180
180
  end
181
181
  end
182
182
 
183
- # @param block [Proc]
183
+ # @macro param_block
184
184
  # @return [String]
185
185
  def on_light_magenta(&block)
186
186
  if block_given?
@@ -192,7 +192,7 @@ module Vedeu
192
192
  end
193
193
  end
194
194
 
195
- # @param block [Proc]
195
+ # @macro param_block
196
196
  # @return [String]
197
197
  def on_light_cyan(&block)
198
198
  if block_given?
@@ -204,7 +204,7 @@ module Vedeu
204
204
  end
205
205
  end
206
206
 
207
- # @param block [Proc]
207
+ # @macro param_block
208
208
  # @return [String]
209
209
  def on_white(&block)
210
210
  if block_given?
@@ -23,7 +23,7 @@ module Vedeu
23
23
  end
24
24
 
25
25
  # @param named_colour [Symbol]
26
- # @param block [Proc]
26
+ # @macro param_block
27
27
  # @return [String]
28
28
  def background_colour(named_colour, &block)
29
29
  return '' unless valid_name?(named_colour)
@@ -32,7 +32,7 @@ module Vedeu
32
32
  end
33
33
 
34
34
  # @param named_colour [Symbol]
35
- # @param block [Proc]
35
+ # @macro param_block
36
36
  # @return [String]
37
37
  def colour(named_colour, &block)
38
38
  return '' unless valid_name?(named_colour)
data/lib/vedeu/esc/esc.rb CHANGED
@@ -53,7 +53,7 @@ module Vedeu
53
53
 
54
54
  # Return the escape sequence to render a border character.
55
55
  #
56
- # @param block [Proc]
56
+ # @macro param_block
57
57
  # @return [String]
58
58
  # @yieldreturn [void] The border character to wrap with border
59
59
  # on and off escape sequences.