vedeu 0.6.10 → 0.6.11
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.
- checksums.yaml +4 -4
- data/lib/vedeu/all.rb +17 -103
- data/lib/vedeu/api/all.rb +15 -0
- data/lib/vedeu/api/internal.rb +4 -0
- data/lib/vedeu/application/all.rb +6 -0
- data/lib/vedeu/bindings/all.rb +32 -0
- data/lib/vedeu/bindings/bindings.rb +0 -14
- data/lib/vedeu/bindings/refresh.rb +8 -2
- data/lib/vedeu/bindings/system.rb +1 -0
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/repository.rb +1 -1
- data/lib/vedeu/buffers/buffer.rb +2 -4
- data/lib/vedeu/buffers/repository.rb +1 -1
- data/lib/vedeu/colours/background.rb +1 -1
- data/lib/vedeu/colours/backgrounds.rb +1 -1
- data/lib/vedeu/colours/foreground.rb +1 -1
- data/lib/vedeu/colours/foregrounds.rb +1 -1
- data/lib/vedeu/colours/translator.rb +4 -3
- data/lib/vedeu/configuration/api.rb +2 -1
- data/lib/vedeu/configuration/cli.rb +1 -1
- data/lib/vedeu/cursors/cursor.rb +26 -26
- data/lib/vedeu/cursors/repository.rb +1 -1
- data/lib/vedeu/distributed/all.rb +16 -0
- data/lib/vedeu/distributed/test_application.rb +3 -3
- data/lib/vedeu/dsl/all.rb +22 -0
- data/lib/vedeu/dsl/composition.rb +43 -40
- data/lib/vedeu/dsl/dsl.rb +6 -3
- data/lib/vedeu/dsl/group.rb +23 -16
- data/lib/vedeu/dsl/interface.rb +48 -38
- data/lib/vedeu/dsl/keymap.rb +6 -7
- data/lib/vedeu/dsl/line.rb +6 -3
- data/lib/vedeu/dsl/stream.rb +2 -1
- data/lib/vedeu/editor/cursor.rb +1 -3
- data/lib/vedeu/editor/document.rb +4 -5
- data/lib/vedeu/editor/documents.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -3
- data/lib/vedeu/editor/lines.rb +2 -3
- data/lib/vedeu/esc/all.rb +14 -0
- data/lib/vedeu/esc/colours.rb +8 -4
- data/lib/vedeu/esc/esc.rb +89 -84
- data/lib/vedeu/events/aliases.rb +1 -2
- data/lib/vedeu/events/collection.rb +1 -1
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/events/trigger.rb +11 -9
- data/lib/vedeu/geometry/dimension.rb +1 -3
- data/lib/vedeu/geometry/generic_coordinate.rb +1 -3
- data/lib/vedeu/geometry/geometry.rb +1 -1
- data/lib/vedeu/geometry/repository.rb +3 -3
- data/lib/vedeu/input/all.rb +3 -0
- data/lib/vedeu/input/keymap.rb +10 -11
- data/lib/vedeu/input/keymaps.rb +1 -1
- data/lib/vedeu/input/keys.rb +1 -1
- data/lib/vedeu/input/mapper.rb +14 -12
- data/lib/vedeu/logging/all.rb +3 -0
- data/lib/vedeu/logging/log.rb +4 -2
- data/lib/vedeu/menus/menu.rb +2 -4
- data/lib/vedeu/menus/repository.rb +1 -1
- data/lib/vedeu/models/all.rb +15 -0
- data/lib/vedeu/models/cell.rb +1 -1
- data/lib/vedeu/models/escape.rb +1 -1
- data/lib/vedeu/models/group.rb +4 -3
- data/lib/vedeu/models/groups.rb +1 -1
- data/lib/vedeu/models/interface.rb +1 -1
- data/lib/vedeu/models/interfaces.rb +1 -1
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/collections/chars.rb +1 -1
- data/lib/vedeu/models/views/collections/lines.rb +1 -1
- data/lib/vedeu/models/views/collections/streams.rb +1 -1
- data/lib/vedeu/models/views/collections/view_collection.rb +1 -1
- data/lib/vedeu/models/views/composition.rb +1 -1
- data/lib/vedeu/models/views/line.rb +8 -6
- data/lib/vedeu/models/views/stream.rb +1 -1
- data/lib/vedeu/models/views/view.rb +1 -1
- data/lib/vedeu/null/all.rb +12 -0
- data/lib/vedeu/output/clear/named_group.rb +2 -1
- data/lib/vedeu/output/clear/named_interface.rb +5 -4
- data/lib/vedeu/output/compressor.rb +1 -0
- data/lib/vedeu/output/output.rb +3 -0
- data/lib/vedeu/output/presentation/colour.rb +10 -10
- data/lib/vedeu/output/presentation/presentation.rb +9 -9
- data/lib/vedeu/output/presentation/style.rb +2 -2
- data/lib/vedeu/output/refresh/refresh.rb +35 -0
- data/lib/vedeu/output/refresh/refresh_group.rb +66 -0
- data/lib/vedeu/output/renderers/all.rb +17 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +4 -2
- data/lib/vedeu/output/renderers/file.rb +7 -6
- data/lib/vedeu/output/renderers/html.rb +9 -7
- data/lib/vedeu/output/renderers/null.rb +1 -1
- data/lib/vedeu/output/renderers/renderer_options.rb +24 -20
- data/lib/vedeu/output/renderers/terminal.rb +1 -1
- data/lib/vedeu/output/renderers/text.rb +1 -1
- data/lib/vedeu/output/wordwrap.rb +7 -4
- data/lib/vedeu/plugins/all.rb +2 -0
- data/lib/vedeu/repositories/all.rb +16 -0
- data/lib/vedeu/repositories/collection.rb +93 -89
- data/lib/vedeu/repositories/model.rb +113 -102
- data/lib/vedeu/repositories/registerable.rb +60 -56
- data/lib/vedeu/repositories/repository.rb +161 -156
- data/lib/vedeu/repositories/store.rb +70 -66
- data/lib/vedeu/runtime/all.rb +15 -0
- data/lib/vedeu/runtime/launcher.rb +19 -16
- data/lib/vedeu/templating/all.rb +6 -0
- data/lib/vedeu/terminal/all.rb +14 -0
- data/lib/vedeu/terminal/buffer.rb +8 -7
- data/lib/vedeu/terminal/mode.rb +11 -10
- data/lib/vedeu/terminal/terminal.rb +50 -45
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -2
- data/test/lib/vedeu/editor/cursor_test.rb +0 -3
- data/test/lib/vedeu/esc/esc_test.rb +58 -54
- data/test/lib/vedeu/events/collection_test.rb +1 -1
- data/test/lib/vedeu/input/keys_test.rb +1 -1
- data/test/lib/vedeu/input/mapper_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/chars_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/lines_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/streams_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/view_collection_test.rb +1 -1
- data/test/lib/vedeu/output/refresh/refresh_group_test.rb +43 -0
- data/test/lib/vedeu/output/refresh/refresh_test.rb +50 -0
- data/test/lib/vedeu/output/renderers/renderer_options_test.rb +8 -4
- data/test/lib/vedeu/output/renderers_test.rb +2 -1
- data/test/lib/vedeu/repositories/collection_test.rb +105 -101
- data/test/lib/vedeu/repositories/model_test.rb +56 -52
- data/test/lib/vedeu/repositories/registerable_test.rb +36 -32
- data/test/lib/vedeu/repositories/repository_test.rb +178 -174
- data/test/lib/vedeu/repositories/store_test.rb +109 -105
- data/test/support/examples/material_colours_app.rb +0 -1
- data/test/support/helpers/model_test_class.rb +50 -46
- data/test/test_helper.rb +2 -2
- metadata +21 -9
- data/lib/vedeu/refresh/refresh.rb +0 -31
- data/lib/vedeu/refresh/refresh_group.rb +0 -59
- data/out_ +0 -50
- data/test/lib/vedeu/refresh/refresh_group_test.rb +0 -39
- data/test/lib/vedeu/refresh/refresh_test.rb +0 -46
@@ -3,12 +3,12 @@ module Vedeu
|
|
3
3
|
module Views
|
4
4
|
|
5
5
|
# Represents a single row of the terminal. It is a container for
|
6
|
-
# {Vedeu::Views::Stream} objects. A line's width is determined by
|
7
|
-
# {Vedeu::Geometry::Geometry} it belongs to.
|
6
|
+
# {Vedeu::Views::Stream} objects. A line's width is determined by
|
7
|
+
# the {Vedeu::Geometry::Geometry} it belongs to.
|
8
8
|
#
|
9
9
|
class Line
|
10
10
|
|
11
|
-
include Vedeu::Model
|
11
|
+
include Vedeu::Repositories::Model
|
12
12
|
include Vedeu::Presentation
|
13
13
|
|
14
14
|
collection Vedeu::Views::Streams
|
@@ -45,7 +45,8 @@ module Vedeu
|
|
45
45
|
end
|
46
46
|
alias_method :<<, :add
|
47
47
|
|
48
|
-
# Returns an array of all the characters with formatting for
|
48
|
+
# Returns an array of all the characters with formatting for
|
49
|
+
# this line.
|
49
50
|
#
|
50
51
|
# @return [Array]
|
51
52
|
# @see Vedeu::Views::Stream
|
@@ -57,14 +58,15 @@ module Vedeu
|
|
57
58
|
|
58
59
|
# An object is equal when its values are the same.
|
59
60
|
#
|
60
|
-
# @param other [Vedeu::Collection]
|
61
|
+
# @param other [Vedeu::Repositories::Collection]
|
61
62
|
# @return [Boolean]
|
62
63
|
def eql?(other)
|
63
64
|
self.class == other.class && value == other.value
|
64
65
|
end
|
65
66
|
alias_method :==, :eql?
|
66
67
|
|
67
|
-
# Returns the size of the content in characters without
|
68
|
+
# Returns the size of the content in characters without
|
69
|
+
# formatting.
|
68
70
|
#
|
69
71
|
# @return [Fixnum]
|
70
72
|
def size
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
# Provides the mechanisms to clear an interface or group of
|
3
|
+
# Provides the mechanisms to clear an interface or group of
|
4
|
+
# interfaces.
|
4
5
|
#
|
5
6
|
module Clear
|
6
7
|
|
@@ -57,9 +58,9 @@ module Vedeu
|
|
57
58
|
end
|
58
59
|
|
59
60
|
# For each visible line of the interface, set the foreground and
|
60
|
-
# background colours to those specified when the interface was
|
61
|
-
# then starting write space characters over the area
|
62
|
-
# occupies.
|
61
|
+
# background colours to those specified when the interface was
|
62
|
+
# defined, then starting write space characters over the area
|
63
|
+
# which the interface occupies.
|
63
64
|
#
|
64
65
|
# @return [Array<Array<Vedeu::Views::Char>>]
|
65
66
|
def output
|
data/lib/vedeu/output/output.rb
CHANGED
@@ -6,8 +6,8 @@ module Vedeu
|
|
6
6
|
#
|
7
7
|
module Colour
|
8
8
|
|
9
|
-
# When the background colour for the model exists, return it,
|
10
|
-
# returns the parent background colour, or an empty
|
9
|
+
# When the background colour for the model exists, return it,
|
10
|
+
# otherwise returns the parent background colour, or an empty
|
11
11
|
# Vedeu::Colours::Background.
|
12
12
|
#
|
13
13
|
# @return [Vedeu::Colours::Background]
|
@@ -24,8 +24,8 @@ module Vedeu
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
# Allows the setting of the background colour by coercing the
|
28
|
-
# into a Vedeu::Colours::Background colour.
|
27
|
+
# Allows the setting of the background colour by coercing the
|
28
|
+
# given value into a Vedeu::Colours::Background colour.
|
29
29
|
#
|
30
30
|
# @return [Vedeu::Colours::Background]
|
31
31
|
def background=(value)
|
@@ -48,16 +48,16 @@ module Vedeu
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
# Allows the setting of the model's colour by coercing the given
|
52
|
-
# into a Vedeu::Colours::Colour.
|
51
|
+
# Allows the setting of the model's colour by coercing the given
|
52
|
+
# value into a Vedeu::Colours::Colour.
|
53
53
|
#
|
54
54
|
# @return [Vedeu::Colours::Colour]
|
55
55
|
def colour=(value)
|
56
56
|
@colour = Vedeu::Colours::Colour.coerce(value)
|
57
57
|
end
|
58
58
|
|
59
|
-
# When the foreground colour for the model exists, return it,
|
60
|
-
# returns the parent foreground colour, or an empty
|
59
|
+
# When the foreground colour for the model exists, return it,
|
60
|
+
# otherwise returns the parent foreground colour, or an empty
|
61
61
|
# Vedeu::Colours::Foreground.
|
62
62
|
#
|
63
63
|
# @return [Vedeu::Colours::Foreground]
|
@@ -74,8 +74,8 @@ module Vedeu
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
# Allows the setting of the foreground colour by coercing the
|
78
|
-
# into a Vedeu::Colours::Foreground colour.
|
77
|
+
# Allows the setting of the foreground colour by coercing the
|
78
|
+
# given value into a Vedeu::Colours::Foreground colour.
|
79
79
|
#
|
80
80
|
# @return [Vedeu::Colours::Foreground]
|
81
81
|
def foreground=(value)
|
@@ -4,17 +4,17 @@ require 'vedeu/output/presentation/style'
|
|
4
4
|
|
5
5
|
module Vedeu
|
6
6
|
|
7
|
-
# This module allows the sharing of presentation concerns between
|
8
|
-
# Interface, View, Line and Stream.
|
7
|
+
# This module allows the sharing of presentation concerns between
|
8
|
+
# the models: Interface, View, Line and Stream.
|
9
9
|
#
|
10
10
|
module Presentation
|
11
11
|
|
12
12
|
include Vedeu::Presentation::Colour
|
13
13
|
include Vedeu::Presentation::Styles
|
14
14
|
|
15
|
-
# Converts the colours and styles to escape sequences, and when
|
16
|
-
# model has previously set the colour and style,
|
17
|
-
# consistent formatting.
|
15
|
+
# Converts the colours and styles to escape sequences, and when
|
16
|
+
# the parent model has previously set the colour and style,
|
17
|
+
# reverts back to that for consistent formatting.
|
18
18
|
#
|
19
19
|
# @return [String] An escape sequence with value interpolated.
|
20
20
|
def to_s
|
@@ -24,8 +24,8 @@ module Vedeu
|
|
24
24
|
|
25
25
|
private
|
26
26
|
|
27
|
-
# Renders the colour attributes of the receiver and yields (to
|
28
|
-
# the styles).
|
27
|
+
# Renders the colour attributes of the receiver and yields (to
|
28
|
+
# then render the styles).
|
29
29
|
#
|
30
30
|
# @return [String]
|
31
31
|
def render_colour
|
@@ -44,8 +44,8 @@ module Vedeu
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
# Renders the style attributes of the receiver and yields (to
|
48
|
-
# the next model, or finally, the content).
|
47
|
+
# Renders the style attributes of the receiver and yields (to
|
48
|
+
# then render the next model, or finally, the content).
|
49
49
|
#
|
50
50
|
# @return [String]
|
51
51
|
def render_style
|
@@ -11,7 +11,7 @@ module Vedeu
|
|
11
11
|
# be defined in either interfaces, for specific lines or within
|
12
12
|
# streams. Styles are applied as encountered.
|
13
13
|
#
|
14
|
-
# @see Vedeu::Esc
|
14
|
+
# @see Vedeu::EscapeSequences::Esc
|
15
15
|
#
|
16
16
|
class Style
|
17
17
|
|
@@ -71,7 +71,7 @@ module Vedeu
|
|
71
71
|
return '' unless present?(value)
|
72
72
|
|
73
73
|
@sequences ||= Array(value).flatten.map do |v|
|
74
|
-
Vedeu::Esc.string(v)
|
74
|
+
Vedeu::EscapeSequences::Esc.string(v)
|
75
75
|
end.join
|
76
76
|
end
|
77
77
|
alias_method :escape_sequences, :to_s
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
module Output
|
4
|
+
|
5
|
+
# @see Vedeu::Bindings::System#refresh!
|
6
|
+
class Refresh
|
7
|
+
|
8
|
+
# Refresh all registered interfaces.
|
9
|
+
#
|
10
|
+
# @return [Array<Vedeu::Models::Interface>]
|
11
|
+
def self.all
|
12
|
+
new.all
|
13
|
+
end
|
14
|
+
|
15
|
+
# Return a new instance of Vedeu::Output::Refresh.
|
16
|
+
#
|
17
|
+
# @return [Vedeu::Output::Refresh]
|
18
|
+
def initialize; end
|
19
|
+
|
20
|
+
# Refresh all registered interfaces.
|
21
|
+
#
|
22
|
+
# @return [Array<Vedeu::Models::Interface>]
|
23
|
+
def all
|
24
|
+
Vedeu.timer('Refreshing all') do
|
25
|
+
Vedeu.interfaces.zindexed.each do |interface|
|
26
|
+
Vedeu.trigger(:_refresh_, interface.name)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end # Refresh
|
32
|
+
|
33
|
+
end # Output
|
34
|
+
|
35
|
+
end # Vedeu
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
module Output
|
4
|
+
|
5
|
+
# Refresh an interface, or collection of interfaces belonging to a
|
6
|
+
# group.
|
7
|
+
#
|
8
|
+
# The interfaces will be refreshed in z-index order, meaning that
|
9
|
+
# interfaces with a lower z-index will be drawn first. This means
|
10
|
+
# overlapping interfaces will be drawn as specified.
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# Vedeu.trigger(:_refresh_group_, group_name)
|
14
|
+
#
|
15
|
+
class RefreshGroup
|
16
|
+
|
17
|
+
include Vedeu::Common
|
18
|
+
|
19
|
+
# @param name [String] The name of the group to be refreshed.
|
20
|
+
# @return [Array|Vedeu::Error::ModelNotFound] A collection of
|
21
|
+
# the names of interfaces refreshed, or an exception when the
|
22
|
+
# group was not found.
|
23
|
+
def self.by_name(name)
|
24
|
+
new(name).by_name
|
25
|
+
end
|
26
|
+
|
27
|
+
# Return a new instance of Vedeu::Output::RefreshGroup.
|
28
|
+
#
|
29
|
+
# @param name [String]
|
30
|
+
# @return [Vedeu::Output::RefreshGroup]
|
31
|
+
def initialize(name)
|
32
|
+
@name = name
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [void]
|
36
|
+
def by_name
|
37
|
+
Vedeu.timer("Refresh Group: '#{group_name}'") do
|
38
|
+
Vedeu.groups.by_name(group_name).by_zindex.each do |name|
|
39
|
+
Vedeu::Buffers::Refresh.by_name(name)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
protected
|
45
|
+
|
46
|
+
# @!attribute [r] name
|
47
|
+
# @return [String]
|
48
|
+
attr_reader :name
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
# @raise [Vedeu::Error::MissingRequired] When the name is empty
|
53
|
+
# or nil.
|
54
|
+
# @return [String]
|
55
|
+
def group_name
|
56
|
+
return name if present?(name)
|
57
|
+
|
58
|
+
fail Vedeu::Error::MissingRequired,
|
59
|
+
'Cannot refresh group with an empty group name.'
|
60
|
+
end
|
61
|
+
|
62
|
+
end # RefreshGroup
|
63
|
+
|
64
|
+
end # Output
|
65
|
+
|
66
|
+
end # Vedeu
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
module Renderers
|
4
|
+
|
5
|
+
end # Renderers
|
6
|
+
|
7
|
+
end # Vedeu
|
8
|
+
|
9
|
+
require 'vedeu/output/renderers/renderer_options'
|
10
|
+
require 'vedeu/output/renderers/escape_sequence'
|
11
|
+
require 'vedeu/output/renderers/file'
|
12
|
+
require 'vedeu/output/renderers/html'
|
13
|
+
require 'vedeu/output/renderers/json'
|
14
|
+
require 'vedeu/output/renderers/null'
|
15
|
+
require 'vedeu/output/renderers/terminal'
|
16
|
+
require 'vedeu/output/renderers/text'
|
17
|
+
require 'vedeu/output/renderers'
|
@@ -6,7 +6,7 @@ module Vedeu
|
|
6
6
|
#
|
7
7
|
class EscapeSequence
|
8
8
|
|
9
|
-
include Vedeu::RendererOptions
|
9
|
+
include Vedeu::Renderers::RendererOptions
|
10
10
|
|
11
11
|
# Returns a new instance of Vedeu::Renderers::EscapeSequence.
|
12
12
|
#
|
@@ -24,7 +24,9 @@ module Vedeu
|
|
24
24
|
out = ''
|
25
25
|
|
26
26
|
output.each do |row|
|
27
|
-
row.each
|
27
|
+
row.each do |cell|
|
28
|
+
out << Vedeu::EscapeSequences::Esc.escape(cell.to_s)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
out
|
@@ -6,16 +6,17 @@ module Vedeu
|
|
6
6
|
#
|
7
7
|
class File
|
8
8
|
|
9
|
-
include Vedeu::RendererOptions
|
9
|
+
include Vedeu::Renderers::RendererOptions
|
10
10
|
|
11
11
|
# Returns a new instance of Vedeu::Renderers::File.
|
12
12
|
#
|
13
13
|
# @param options [Hash]
|
14
|
-
# @option options filename [String] Provide a filename for the
|
15
|
-
# Defaults to 'out'.
|
16
|
-
# @option options timestamp [Boolean] Append a timestamp to the
|
17
|
-
#
|
18
|
-
#
|
14
|
+
# @option options filename [String] Provide a filename for the
|
15
|
+
# output. Defaults to 'out'.
|
16
|
+
# @option options timestamp [Boolean] Append a timestamp to the
|
17
|
+
# filename.
|
18
|
+
# @option options write_file [Boolean] Whether to write the file
|
19
|
+
# to the given filename.
|
19
20
|
# @return [Vedeu::Renderers::File]
|
20
21
|
def initialize(options = {})
|
21
22
|
@options = options || {}
|
@@ -13,15 +13,17 @@ module Vedeu
|
|
13
13
|
# @option options content [String] Defaults to an empty string.
|
14
14
|
# @option options end_tag [String] Defaults to '</td>'.
|
15
15
|
# @option options end_row_tag [String] Defaults to '</tr>'.
|
16
|
-
# @option options filename [String] Provide a filename for the
|
17
|
-
# Defaults to 'out'.
|
18
|
-
# @option options start_tag [String] Defaults to '<td' (note the
|
19
|
-
# the tag is missing, this is so that inline styles can
|
16
|
+
# @option options filename [String] Provide a filename for the
|
17
|
+
# output. Defaults to 'out'.
|
18
|
+
# @option options start_tag [String] Defaults to '<td' (note the
|
19
|
+
# end of the tag is missing, this is so that inline styles can
|
20
|
+
# be added later).
|
20
21
|
# @option options start_row_tag [String] Defaults to '<tr>'.
|
21
22
|
# @option options template [String]
|
22
|
-
# @option options timestamp [Boolean] Append a timestamp to the
|
23
|
-
#
|
24
|
-
#
|
23
|
+
# @option options timestamp [Boolean] Append a timestamp to the
|
24
|
+
# filename.
|
25
|
+
# @option options write_file [Boolean] Whether to write the file
|
26
|
+
# to the given filename.
|
25
27
|
# @return [Vedeu::Renderers::HTML]
|
26
28
|
def initialize(options = {})
|
27
29
|
@options = options || {}
|
@@ -1,28 +1,32 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
# :nocov:
|
6
|
-
module RendererOptions
|
3
|
+
module Renderers
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
# Combines the options provided at instantiation with the default
|
11
|
-
# values.
|
5
|
+
# Provides shared functionality to Vedeu::Renderer classes.
|
12
6
|
#
|
13
|
-
#
|
14
|
-
|
15
|
-
defaults.merge!(@options)
|
16
|
-
end
|
7
|
+
# :nocov:
|
8
|
+
module RendererOptions
|
17
9
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
private
|
11
|
+
|
12
|
+
# Combines the options provided at instantiation with the
|
13
|
+
# default values.
|
14
|
+
#
|
15
|
+
# @return [Hash<Symbol => void>]
|
16
|
+
def options
|
17
|
+
defaults.merge!(@options)
|
18
|
+
end
|
19
|
+
|
20
|
+
# The default values for a new instance of this class.
|
21
|
+
#
|
22
|
+
# @return [Hash<Symbol => void>]
|
23
|
+
def defaults
|
24
|
+
{}
|
25
|
+
end
|
26
|
+
|
27
|
+
end # RendererOptions
|
28
|
+
# :nocov:
|
24
29
|
|
25
|
-
end #
|
26
|
-
# :nocov:
|
30
|
+
end # Renderers
|
27
31
|
|
28
32
|
end # Vedeu
|
@@ -146,10 +146,13 @@ module Vedeu
|
|
146
146
|
options.fetch(:ellipsis)
|
147
147
|
end
|
148
148
|
|
149
|
-
# Returns the word wrapping mode. One of :default, :prune or
|
150
|
-
# :
|
151
|
-
#
|
152
|
-
#
|
149
|
+
# Returns the word wrapping mode. One of :default, :prune or
|
150
|
+
# :wrap;
|
151
|
+
# :default = Renders the content as is.
|
152
|
+
# :prune = Discards the remainder of the content line
|
153
|
+
# after width.
|
154
|
+
# :wrap = Forces the content on to a new line after
|
155
|
+
# width.
|
153
156
|
# @return [Symbol]
|
154
157
|
def mode
|
155
158
|
options.fetch(:mode)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# Provides all registered repositories.
|
4
|
+
#
|
5
|
+
module Repositories
|
6
|
+
|
7
|
+
end # Repositories
|
8
|
+
|
9
|
+
end # Vedeu
|
10
|
+
|
11
|
+
require 'vedeu/repositories/collection'
|
12
|
+
require 'vedeu/repositories/repositories'
|
13
|
+
require 'vedeu/repositories/model'
|
14
|
+
require 'vedeu/repositories/store'
|
15
|
+
require 'vedeu/repositories/registerable'
|
16
|
+
require 'vedeu/repositories/repository'
|