vedeu 0.6.20 → 0.6.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +4 -0
  4. data/Rakefile +13 -0
  5. data/bin/vedeu_drb_server +6 -6
  6. data/docs/api.md +14 -0
  7. data/docs/dsl.md +12 -12
  8. data/docs/events/document.md +4 -2
  9. data/docs/events/drb.md +4 -0
  10. data/docs/events/focus.md +2 -0
  11. data/docs/events/menu.md +2 -0
  12. data/docs/events/movement.md +7 -5
  13. data/docs/events/refresh.md +2 -0
  14. data/docs/events/system.md +5 -0
  15. data/docs/events/view.md +2 -0
  16. data/docs/events/visibility.md +2 -0
  17. data/lib/vedeu.rb +0 -23
  18. data/lib/vedeu/all.rb +2 -4
  19. data/lib/vedeu/application/application_view.rb +1 -1
  20. data/lib/vedeu/borders/all.rb +3 -3
  21. data/lib/vedeu/borders/border.rb +2 -2
  22. data/lib/vedeu/borders/dsl.rb +21 -27
  23. data/lib/vedeu/borders/null.rb +2 -15
  24. data/lib/vedeu/borders/render.rb +1 -1
  25. data/lib/vedeu/borders/repository.rb +9 -0
  26. data/lib/vedeu/buffers/buffer.rb +2 -2
  27. data/lib/vedeu/buffers/null.rb +1 -31
  28. data/lib/vedeu/buffers/refresh.rb +8 -8
  29. data/lib/vedeu/buffers/repository.rb +9 -0
  30. data/lib/vedeu/colours/backgrounds.rb +9 -0
  31. data/lib/vedeu/colours/colour.rb +1 -1
  32. data/lib/vedeu/colours/foregrounds.rb +9 -0
  33. data/lib/vedeu/common.rb +22 -13
  34. data/lib/vedeu/configuration/configuration.rb +6 -0
  35. data/lib/vedeu/cursors/cursor.rb +13 -8
  36. data/lib/vedeu/cursors/refresh.rb +2 -2
  37. data/lib/vedeu/cursors/repository.rb +18 -1
  38. data/lib/vedeu/distributed/server.rb +23 -0
  39. data/lib/vedeu/distributed/templates/default_borders.vedeu +1 -1
  40. data/lib/vedeu/distributed/templates/default_geometries.vedeu +1 -1
  41. data/lib/vedeu/distributed/templates/default_interfaces.vedeu +1 -1
  42. data/lib/vedeu/distributed/templates/default_keymaps.vedeu +1 -1
  43. data/lib/vedeu/distributed/templates/default_menus.vedeu +1 -1
  44. data/lib/vedeu/distributed/templates/default_views.vedeu +1 -1
  45. data/lib/vedeu/dsl/composition.rb +7 -17
  46. data/lib/vedeu/dsl/dsl.rb +12 -0
  47. data/lib/vedeu/dsl/interface.rb +32 -33
  48. data/lib/vedeu/dsl/keymap.rb +13 -19
  49. data/lib/vedeu/dsl/line.rb +3 -13
  50. data/lib/vedeu/dsl/shared.rb +5 -5
  51. data/lib/vedeu/dsl/stream.rb +0 -10
  52. data/lib/vedeu/dsl/use.rb +6 -6
  53. data/lib/vedeu/dsl/view.rb +17 -19
  54. data/lib/vedeu/editor/cursor.rb +32 -10
  55. data/lib/vedeu/editor/document.rb +33 -35
  56. data/lib/vedeu/editor/editor.rb +3 -4
  57. data/lib/vedeu/editor/insert.rb +1 -1
  58. data/lib/vedeu/editor/line.rb +1 -8
  59. data/lib/vedeu/editor/lines.rb +1 -1
  60. data/lib/vedeu/editor/repository.rb +9 -0
  61. data/lib/vedeu/esc/esc.rb +2 -1
  62. data/lib/vedeu/events/aliases.rb +8 -1
  63. data/lib/vedeu/events/event.rb +8 -0
  64. data/lib/vedeu/events/repository.rb +9 -0
  65. data/lib/vedeu/events/trigger.rb +9 -5
  66. data/lib/vedeu/geometry/coordinate.rb +2 -2
  67. data/lib/vedeu/geometry/dsl.rb +32 -38
  68. data/lib/vedeu/geometry/generic_coordinate.rb +1 -1
  69. data/lib/vedeu/geometry/geometry.rb +3 -3
  70. data/lib/vedeu/geometry/null.rb +2 -24
  71. data/lib/vedeu/geometry/repository.rb +9 -0
  72. data/lib/vedeu/groups/clear.rb +7 -3
  73. data/lib/vedeu/groups/dsl.rb +29 -35
  74. data/lib/vedeu/groups/group.rb +28 -4
  75. data/lib/vedeu/groups/refresh.rb +3 -2
  76. data/lib/vedeu/groups/repository.rb +9 -0
  77. data/lib/vedeu/input/capture.rb +1 -1
  78. data/lib/vedeu/input/keymap.rb +2 -1
  79. data/lib/vedeu/input/keymaps.rb +9 -0
  80. data/lib/vedeu/input/mapper.rb +4 -0
  81. data/lib/vedeu/input/translator.rb +1 -1
  82. data/lib/vedeu/logging/debug.rb +13 -0
  83. data/lib/vedeu/logging/log.rb +8 -0
  84. data/lib/vedeu/logging/timer.rb +13 -0
  85. data/lib/vedeu/menus/dsl.rb +8 -18
  86. data/lib/vedeu/menus/menu.rb +8 -4
  87. data/lib/vedeu/menus/null.rb +1 -1
  88. data/lib/vedeu/menus/repository.rb +9 -0
  89. data/lib/vedeu/models/cell.rb +5 -0
  90. data/lib/vedeu/models/escape.rb +5 -0
  91. data/lib/vedeu/models/focus.rb +20 -5
  92. data/lib/vedeu/models/interface.rb +10 -1
  93. data/lib/vedeu/models/interfaces.rb +9 -0
  94. data/lib/vedeu/models/toggleable.rb +19 -4
  95. data/lib/vedeu/models/views/char.rb +6 -1
  96. data/lib/vedeu/models/views/html_char.rb +1 -4
  97. data/lib/vedeu/models/views/line.rb +1 -1
  98. data/lib/vedeu/models/views/view.rb +1 -1
  99. data/lib/vedeu/null/generic.rb +14 -2
  100. data/lib/vedeu/null/interface.rb +1 -1
  101. data/lib/vedeu/null/view.rb +1 -1
  102. data/lib/vedeu/output/clear/interface.rb +5 -1
  103. data/lib/vedeu/output/compressor.rb +8 -4
  104. data/lib/vedeu/output/direct.rb +4 -4
  105. data/lib/vedeu/output/presentation/all.rb +15 -0
  106. data/lib/vedeu/output/presentation/presentation.rb +0 -7
  107. data/lib/vedeu/output/refresh/refresh.rb +1 -3
  108. data/lib/vedeu/output/renderers/all.rb +10 -0
  109. data/lib/vedeu/output/renderers/terminal.rb +1 -3
  110. data/lib/vedeu/repositories/collection.rb +3 -3
  111. data/lib/vedeu/repositories/model.rb +1 -1
  112. data/lib/vedeu/repositories/repository.rb +8 -8
  113. data/lib/vedeu/repositories/store.rb +3 -2
  114. data/lib/vedeu/runtime/application.rb +4 -0
  115. data/lib/vedeu/runtime/bootstrap.rb +1 -1
  116. data/lib/vedeu/runtime/flags.rb +7 -0
  117. data/lib/vedeu/runtime/main_loop.rb +2 -0
  118. data/lib/vedeu/runtime/router.rb +4 -0
  119. data/lib/vedeu/templating/decoder.rb +1 -1
  120. data/lib/vedeu/templating/encoder.rb +1 -1
  121. data/lib/vedeu/templating/helpers.rb +2 -0
  122. data/lib/vedeu/templating/template.rb +1 -1
  123. data/lib/vedeu/terminal/buffer.rb +7 -0
  124. data/lib/vedeu/terminal/terminal.rb +8 -0
  125. data/lib/vedeu/version.rb +1 -1
  126. data/test/lib/vedeu/borders/dsl_test.rb +0 -6
  127. data/test/lib/vedeu/borders/null_test.rb +0 -12
  128. data/test/lib/vedeu/buffers/null_test.rb +0 -37
  129. data/test/lib/vedeu/common_test.rb +33 -0
  130. data/test/lib/vedeu/cursors/cursor_test.rb +1 -1
  131. data/test/lib/vedeu/dsl/composition_test.rb +0 -6
  132. data/test/lib/vedeu/dsl/dsl_test.rb +1 -0
  133. data/test/lib/vedeu/dsl/interface_test.rb +0 -6
  134. data/test/lib/vedeu/dsl/keymap_test.rb +0 -5
  135. data/test/lib/vedeu/dsl/line_test.rb +0 -7
  136. data/test/lib/vedeu/dsl/stream_test.rb +0 -7
  137. data/test/lib/vedeu/editor/cursor_test.rb +23 -8
  138. data/test/lib/vedeu/editor/document_test.rb +27 -23
  139. data/test/lib/vedeu/editor/line_test.rb +0 -30
  140. data/test/lib/vedeu/geometry/dsl_test.rb +0 -5
  141. data/test/lib/vedeu/geometry/null_test.rb +0 -30
  142. data/test/lib/vedeu/groups/dsl_test.rb +0 -6
  143. data/test/lib/vedeu/groups/group_test.rb +15 -7
  144. data/test/lib/vedeu/menus/dsl_test.rb +0 -5
  145. data/test/lib/vedeu/models/cell_test.rb +4 -0
  146. data/test/lib/vedeu/models/escape_test.rb +4 -0
  147. data/test/lib/vedeu/models/views/char_test.rb +4 -0
  148. data/test/lib/vedeu/null/generic_test.rb +13 -0
  149. data/test/lib/vedeu/terminal/buffer_test.rb +3 -2
  150. data/test/lib/vedeu_test.rb +81 -3
  151. data/test/support/examples/borders_app.rb +1 -3
  152. data/test/support/examples/drb_app.rb +1 -3
  153. data/test/support/examples/editor_app.rb +2 -4
  154. data/test/support/examples/focus_app.rb +1 -3
  155. data/test/support/examples/hello_world.rb +1 -6
  156. data/test/support/examples/material_colours_app.rb +1 -3
  157. data/test/support/examples/view_templates_app/view_templates_app.rb +1 -3
  158. data/test/support/helpers/model_test_class.rb +1 -5
  159. data/test/support/who.rb +29 -0
  160. data/test/test_helper.rb +0 -1
  161. metadata +5 -17
  162. data/lib/vedeu/api/all.rb +0 -15
  163. data/lib/vedeu/api/external.rb +0 -194
  164. data/lib/vedeu/api/internal.rb +0 -177
  165. data/test/lib/vedeu/api/external_test.rb +0 -74
  166. data/test/lib/vedeu/api/internal_test.rb +0 -33
  167. data/test/support/examples/typed_commands/command.erb +0 -1
  168. data/test/support/examples/typed_commands/output.erb +0 -1
  169. data/test/support/examples/typed_commands/status.erb +0 -1
  170. data/test/support/examples/typed_commands/typed_commands_app.rb +0 -94
@@ -16,4 +16,13 @@ module Vedeu
16
16
 
17
17
  end # Geometry
18
18
 
19
+ # Manipulate the repository of geometries.
20
+ #
21
+ # @example
22
+ # Vedeu.geometries
23
+ #
24
+ # @!method geometries
25
+ # @return [Vedeu::Geometry::Repository]
26
+ def_delegators Vedeu::Geometry::Repository, :geometries
27
+
19
28
  end # Vedeu
@@ -13,7 +13,7 @@ module Vedeu
13
13
  # @example
14
14
  # Vedeu.clear_by_group(name)
15
15
  #
16
- # @param name [String]
16
+ # @param name [String|Symbol]
17
17
  # @return [void]
18
18
  def render(name)
19
19
  new(name).render
@@ -25,7 +25,7 @@ module Vedeu
25
25
 
26
26
  # Return a new instance of Vedeu::Groups::Clear.
27
27
  #
28
- # @param name [String]
28
+ # @param name [String|Symbol]
29
29
  # @return [Vedeu::Groups::Clear]
30
30
  def initialize(name)
31
31
  @name = name
@@ -39,7 +39,7 @@ module Vedeu
39
39
  protected
40
40
 
41
41
  # @!attribute [r] name
42
- # @return [String]
42
+ # @return [String|Symbol]
43
43
  attr_reader :name
44
44
 
45
45
  private
@@ -53,4 +53,8 @@ module Vedeu
53
53
 
54
54
  end # Groups
55
55
 
56
+ # @!method clear_by_group
57
+ # @see Vedeu::Groups::Clear.render
58
+ def_delegators Vedeu::Groups::Clear, :clear_by_group
59
+
56
60
  end # Vedeu
@@ -24,35 +24,35 @@ module Vedeu
24
24
  # The example below resembles 'vim' (the popular terminal-based
25
25
  # text editor):
26
26
  #
27
- # Vedeu.group 'title_screen' do
28
- # add 'welcome_interface'
27
+ # Vedeu.group :title_screen do
28
+ # add :welcome_interface
29
29
  # # ... some code
30
30
  # end
31
31
  #
32
- # Vedeu.group 'main_screen' do
33
- # add 'editor_interface'
34
- # add 'status_interface'
35
- # add 'command_interface'
32
+ # Vedeu.group :main_screen do
33
+ # add :editor_interface
34
+ # add :status_interface
35
+ # add :command_interface
36
36
  # # ... some code
37
37
  # end
38
38
  #
39
39
  # or more succinctly:
40
40
  #
41
- # Vedeu.group 'main_screen' do
42
- # members 'editor_interface',
43
- # 'status_interface',
44
- # 'command_interface'
41
+ # Vedeu.group :main_screen do
42
+ # members :editor_interface,
43
+ # :status_interface,
44
+ # :command_interface
45
45
  # # ... some code
46
46
  # end
47
47
  #
48
48
  # or when defining an interface:
49
49
  #
50
- # Vedeu.interface 'some_interface' do
51
- # group 'some_group'
50
+ # Vedeu.interface :some_interface do
51
+ # group :some_group
52
52
  # # ... some code
53
53
  # end
54
54
  #
55
- # @param name [String] The name of this group.
55
+ # @param name [String|Symbol] The name of this group.
56
56
  # @param block [Proc]
57
57
  # @raise [Vedeu::Error::RequiresBlock]
58
58
  # @return [Vedeu::Groups::Group]
@@ -62,44 +62,38 @@ module Vedeu
62
62
  Vedeu::Groups::Group.build(name: name, &block).store
63
63
  end
64
64
 
65
- # Returns an instance of Groups::DSL.
66
- #
67
- # @param model [Vedeu::Groups::Group]
68
- # @param client [Object]
69
- # @return [Vedeu::Groups::DSL]
70
- def initialize(model, client = nil)
71
- @model = model
72
- @client = client
73
- end
74
-
75
65
  # Add the named interface to this group.
76
66
  #
77
- # Vedeu.group 'main_screen' do
78
- # add 'editor_interface'
67
+ # Vedeu.group :main_screen do
68
+ # add :editor_interface
79
69
  # end
80
70
  #
81
- # @param interface_name [String]
71
+ # @param name [String|Symbol]
82
72
  # @return [Vedeu::Groups::Group]
83
- def add(interface_name)
84
- model.add(interface_name)
73
+ def add(name)
74
+ model.add(name)
85
75
  end
86
76
 
87
77
  # Add the named interfaces to this group in bulk.
88
78
  #
89
- # Vedeu.group 'main_screen' do
90
- # members ['editor_interface',
91
- # 'some_interface',
92
- # 'other_interface']
79
+ # Vedeu.group :main_screen do
80
+ # members [:editor_interface,
81
+ # :some_interface,
82
+ # :other_interface]
93
83
  # end
94
84
  #
95
- # @param interface_names [Array<String>]
85
+ # @param names [Array<String|Symbol>]
96
86
  # @return [Array<String>]
97
- def members(*interface_names)
98
- interface_names.each { |name| add(name) }
87
+ def members(*names)
88
+ names.each { |name| add(name) }
99
89
  end
100
90
 
101
91
  end # DSL
102
92
 
103
93
  end # Groups
104
94
 
95
+ # @!method group
96
+ # @see Vedeu::Groups::DSL.group
97
+ def_delegators Vedeu::Groups::DSL, :group
98
+
105
99
  end # Vedeu
@@ -14,6 +14,12 @@ module Vedeu
14
14
  # @return [String]
15
15
  attr_accessor :name
16
16
 
17
+ # @param (see #initialize)
18
+ # @return (see #initialize)
19
+ def self.store(attributes = {})
20
+ new(attributes).store
21
+ end
22
+
17
23
  # Return a new instance of Vedeu::Groups::Group.
18
24
  #
19
25
  # @note
@@ -23,7 +29,7 @@ module Vedeu
23
29
  # @param attributes [Hash]
24
30
  # @option attributes members [Set] A collection of names of
25
31
  # interfaces belonging to this group.
26
- # @option attributes name [String] The name of the group.
32
+ # @option attributes name [String|Symbol] The name of the group.
27
33
  # @option attributes repository
28
34
  # [Vedeu::Repositories::Repository]
29
35
  # The storage for all Group models.
@@ -43,7 +49,7 @@ module Vedeu
43
49
  def add(member)
44
50
  attrs = attributes.merge!(members: members.add(member))
45
51
 
46
- Vedeu::Groups::Group.new(attrs).store
52
+ Vedeu::Groups::Group.store(attrs)
47
53
  end
48
54
 
49
55
  # Returns the attributes of the group.
@@ -66,6 +72,16 @@ module Vedeu
66
72
  interfaces.sort { |a, b| a.zindex <=> b.zindex }.map(&:name)
67
73
  end
68
74
 
75
+ # An object is equal when its values are the same.
76
+ #
77
+ # @param other [Vedeu::Groups::Group]
78
+ # @return [Boolean]
79
+ def eql?(other)
80
+ self.class == other.class && name == other.name &&
81
+ members == other.members
82
+ end
83
+ alias_method :==, :eql?
84
+
69
85
  # Hide the named group of interfaces, or without a name, the
70
86
  # group of the currently focussed interface. Useful for hiding
71
87
  # part of that which is currently displaying in the terminal.
@@ -102,7 +118,7 @@ module Vedeu
102
118
  def remove(member)
103
119
  attrs = attributes.merge!(members: members.delete(member))
104
120
 
105
- Vedeu::Groups::Group.new(attrs).store
121
+ Vedeu::Groups::Group.store(attrs)
106
122
  end
107
123
 
108
124
  # Remove all members from the group.
@@ -111,7 +127,7 @@ module Vedeu
111
127
  def reset
112
128
  attrs = defaults.merge!(name: name)
113
129
 
114
- Vedeu::Groups::Group.new(attrs).store
130
+ Vedeu::Groups::Group.store(attrs)
115
131
  end
116
132
 
117
133
  # Show the named group of interfaces, or without a name, the
@@ -155,4 +171,12 @@ module Vedeu
155
171
 
156
172
  end # Groups
157
173
 
174
+ # @!method hide_group
175
+ # @see Vedeu::Toggleable::ClassMethods#hide
176
+ # @!method show_group
177
+ # @see Vedeu::Toggleable::ClassMethods#show
178
+ # @!method toggle_group
179
+ # @see Vedeu::Toggleable::ClassMethods#toggle
180
+ def_delegators Vedeu::Groups::Group, :hide_group, :show_group, :toggle_group
181
+
158
182
  end # Vedeu
@@ -16,7 +16,8 @@ module Vedeu
16
16
 
17
17
  include Vedeu::Common
18
18
 
19
- # @param name [String] The name of the group to be refreshed.
19
+ # @param name [String|Symbol] The name of the group to be
20
+ # refreshed.
20
21
  # @return [Array|Vedeu::Error::ModelNotFound] A collection of
21
22
  # the names of interfaces refreshed, or an exception when the
22
23
  # group was not found.
@@ -26,7 +27,7 @@ module Vedeu
26
27
 
27
28
  # Return a new instance of Vedeu::Groups::Refresh.
28
29
  #
29
- # @param name [String]
30
+ # @param name [String|Symbol]
30
31
  # @return [Vedeu::Groups::Refresh]
31
32
  def initialize(name)
32
33
  @name = name
@@ -21,4 +21,13 @@ module Vedeu
21
21
 
22
22
  end # Groups
23
23
 
24
+ # Manipulate the repository of groups.
25
+ #
26
+ # @example
27
+ # Vedeu.groups
28
+ #
29
+ # @!method groups
30
+ # @return [Vedeu::Groups::Repository]
31
+ def_delegators Vedeu::Groups::Repository, :groups
32
+
24
33
  end # Vedeu
@@ -10,7 +10,7 @@ module Vedeu
10
10
  # Instantiate Vedeu::Input::Input and capture keypress(es).
11
11
  #
12
12
  # @param (see #initialize)
13
- # @return [String|Symbol]
13
+ # @return (see #read)
14
14
  def self.read(reader)
15
15
  new(reader).read
16
16
  end
@@ -19,7 +19,8 @@ module Vedeu
19
19
  # Returns a new instance of Vedeu::Input::Keymap.
20
20
  #
21
21
  # @param attributes [Hash]
22
- # @option attributes name [String] The name of the keymap.
22
+ # @option attributes name [String|Symbol] The name of the
23
+ # keymap.
23
24
  # @option attributes keys [Vedeu::Input::Keys|Array]
24
25
  # A collection of keys.
25
26
  # @option attributes repository
@@ -14,4 +14,13 @@ module Vedeu
14
14
 
15
15
  end # Input
16
16
 
17
+ # Manipulate the repository of keymaps.
18
+ #
19
+ # @example
20
+ # Vedeu.keymaps
21
+ #
22
+ # @!method keymaps
23
+ # @return [Vedeu::Input::Keymaps]
24
+ def_delegators Vedeu::Input::Keymaps, :keymaps
25
+
17
26
  end # Vedeu
@@ -130,4 +130,8 @@ module Vedeu
130
130
 
131
131
  end # Input
132
132
 
133
+ # @!method keypress
134
+ # @see Vedeu::Input::Mapper.keypress
135
+ def_delegators Vedeu::Input::Mapper, :keypress
136
+
133
137
  end # Vedeu
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Translator
9
9
 
10
- # @param code [String]
10
+ # @param (see #initialize)
11
11
  # @return [Symbol]
12
12
  def self.translate(code)
13
13
  new(code).translate
@@ -13,6 +13,9 @@ module Vedeu
13
13
  # Helps to debug a running application by providing a stack
14
14
  # trace of its execution upon exiting.
15
15
  #
16
+ # @example
17
+ # Vedeu.debug
18
+ #
16
19
  # @param filename [String]
17
20
  # @return [void]
18
21
  # @yieldreturn [void] The section of the application to debug.
@@ -81,4 +84,14 @@ module Vedeu
81
84
 
82
85
  end # Logging
83
86
 
87
+ # Allow debugging via the creation of stack traces courtesy of
88
+ # ruby-prof.
89
+ #
90
+ # @example
91
+ # Vedeu.debug
92
+ #
93
+ # @!method debug
94
+ # @return [Vedeu::Logging::Debug]
95
+ def_delegators Vedeu::Logging::Debug, :debug
96
+
84
97
  end # Vedeu
@@ -178,4 +178,12 @@ module Vedeu
178
178
 
179
179
  end # Logging
180
180
 
181
+ # @!method log
182
+ # @see Vedeu::Logging::Log.log
183
+ # @!method log_stdout
184
+ # @see Vedeu::Logging::Log.log_stdout
185
+ # @!method log_stderr
186
+ # @see Vedeu::Logging::Log.log_stderr
187
+ def_delegators Vedeu::Logging::Log, :log, :log_stdout, :log_stderr
188
+
181
189
  end # Vedeu
@@ -8,6 +8,8 @@ module Vedeu
8
8
 
9
9
  class << self
10
10
 
11
+ # Measure the execution time of the code in the given block.
12
+ #
11
13
  # @example
12
14
  # Vedeu.timer 'message' do
13
15
  # # ... code to be measured
@@ -65,4 +67,15 @@ module Vedeu
65
67
 
66
68
  end # Logging
67
69
 
70
+ # Measure the execution time of the code in the given block.
71
+ #
72
+ # @example
73
+ # Vedeu.timer do
74
+ # # ... some code here ...
75
+ # end
76
+ #
77
+ # @!method timer
78
+ # @see Vedeu::Logging::Timer.timer
79
+ def_delegators Vedeu::Logging::Timer, :timer
80
+
68
81
  end # Vedeu
@@ -9,22 +9,12 @@ module Vedeu
9
9
 
10
10
  include Vedeu::DSL
11
11
 
12
- # Return a new instance of Vedeu::Menus::DSL.
13
- #
14
- # @param model [Vedeu::Menus::Menu]
15
- # @param client [Object]
16
- # @return [Vedeu::Menus::DSL]
17
- def initialize(model, client = nil)
18
- @model = model
19
- @client = client
20
- end
21
-
22
12
  # Add an individual item to the menu.
23
13
  #
24
14
  # @param element [Object] An object you wish to add to the
25
15
  # collection.
26
16
  #
27
- # Vedeu.menu 'my_menu' do
17
+ # Vedeu.menu :my_menu do
28
18
  # item SomeClass.new
29
19
  # item SomeClass.new
30
20
  # end
@@ -38,14 +28,14 @@ module Vedeu
38
28
  # Define the items for the menu. Most powerful when used with
39
29
  # one of your model classes.
40
30
  #
41
- # In the 'my_playlist' example below, your `Track` model may
31
+ # In the :my_playlist example below, your `Track` model may
42
32
  # return a collection of tracks to populate the menu.
43
33
  #
44
- # Vedeu.menu 'my_menu' do
34
+ # Vedeu.menu :my_menu do
45
35
  # items [:item_1, :item_2, :item_3]
46
36
  # end
47
37
  #
48
- # Vedeu.menu 'my_playlist' do
38
+ # Vedeu.menu :my_playlist do
49
39
  # items Track.all_my_favourites
50
40
  # end
51
41
  #
@@ -61,14 +51,14 @@ module Vedeu
61
51
  # your application's execution lifetime.
62
52
  #
63
53
  # Vedeu.menu do
64
- # name 'my_menu'
54
+ # name :my_menu
65
55
  # # ...
66
56
  # end
67
57
  #
68
- # @param value [String]
58
+ # @param name [String|Symbol]
69
59
  # @return [String]
70
- def name(value)
71
- model.name = value
60
+ def name(name)
61
+ model.name = name
72
62
  end
73
63
  alias_method :name=, :name
74
64