vedeu 0.6.13 → 0.6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/configuration.md +0 -14
- data/lib/vedeu.rb +0 -1
- data/lib/vedeu/all.rb +13 -14
- data/lib/vedeu/api/internal.rb +2 -2
- data/lib/vedeu/bindings/focus.rb +2 -0
- data/lib/vedeu/bindings/refresh.rb +2 -0
- data/lib/vedeu/bindings/system.rb +2 -0
- data/lib/vedeu/configuration/api.rb +0 -2
- data/lib/vedeu/configuration/configuration.rb +9 -17
- data/lib/vedeu/dsl/dsl.rb +2 -0
- data/lib/vedeu/dsl/text.rb +6 -0
- data/lib/vedeu/editor/all.rb +1 -1
- data/lib/vedeu/editor/{documents.rb → repository.rb} +2 -2
- data/lib/vedeu/esc/actions.rb +0 -2
- data/lib/vedeu/esc/borders.rb +0 -2
- data/lib/vedeu/esc/colours.rb +0 -2
- data/lib/vedeu/input/mapper.rb +2 -2
- data/lib/vedeu/menus/all.rb +3 -0
- data/lib/vedeu/models/all.rb +2 -0
- data/lib/vedeu/models/views/all.rb +0 -4
- data/lib/vedeu/models/views/char.rb +7 -0
- data/lib/vedeu/models/views/line.rb +7 -0
- data/lib/vedeu/models/views/stream.rb +7 -0
- data/lib/vedeu/models/views/view.rb +7 -0
- data/lib/vedeu/null/all.rb +4 -1
- data/lib/vedeu/null/interface.rb +0 -2
- data/lib/vedeu/null/view.rb +0 -2
- data/lib/vedeu/output/output.rb +8 -2
- data/lib/vedeu/output/renderers/all.rb +95 -1
- data/lib/vedeu/runtime/all.rb +2 -0
- data/lib/vedeu/runtime/launcher.rb +1 -9
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/editor/{documents_test.rb → repository_test.rb} +3 -3
- data/test/lib/vedeu/models/views/char_test.rb +13 -0
- data/test/lib/vedeu/models/views/line_test.rb +16 -3
- data/test/lib/vedeu/models/views/stream_test.rb +13 -0
- data/test/lib/vedeu/models/views/view_test.rb +13 -0
- data/test/lib/vedeu/output/output_test.rb +32 -18
- data/test/lib/vedeu/output/{renderers_test.rb → renderers/all_test.rb} +0 -0
- data/test/lib/vedeu/output/renderers/file_test.rb +2 -2
- metadata +6 -27
- data/lib/vedeu/configuration/cli.rb +0 -290
- data/lib/vedeu/models/views/collections/chars.rb +0 -14
- data/lib/vedeu/models/views/collections/lines.rb +0 -14
- data/lib/vedeu/models/views/collections/streams.rb +0 -14
- data/lib/vedeu/models/views/collections/view_collection.rb +0 -14
- data/lib/vedeu/null/null.rb +0 -11
- data/lib/vedeu/output/renderers.rb +0 -92
- data/test/lib/vedeu/configuration/cli_test.rb +0 -157
- data/test/lib/vedeu/models/views/collections/chars_test.rb +0 -22
- data/test/lib/vedeu/models/views/collections/lines_test.rb +0 -22
- data/test/lib/vedeu/models/views/collections/streams_test.rb +0 -22
- data/test/lib/vedeu/models/views/collections/view_collection_test.rb +0 -22
- data/test/lib/vedeu/null/null_test.rb +0 -8
- data/test/support/examples/configuration_app.rb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e1b859a5c5879bc2165e48baaf00b3a15448111
|
4
|
+
data.tar.gz: dd4db5330f731e8f171c38c3c3f22bd6331b5356
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54b2f06a47ded5480ada1597206145f678390d23897656060724a263b37a68fdecc139a2f3393fb6ab6b97b47aca0d1e1cba762e62dc2df4b4c44a36ba25b59a
|
7
|
+
data.tar.gz: 29b42c9a6fb03431f8b4c45688edb6f30c7df68b434933406cc81e8eb69dc29614c8244762d622b59119034d5c8918ae1f8209d7e9640197182be2dd5e3e628e
|
data/docs/configuration.md
CHANGED
@@ -21,68 +21,54 @@ simply ask for it:
|
|
21
21
|
|
22
22
|
### colour_mode
|
23
23
|
{include:Vedeu::Config::API#colour_mode}
|
24
|
-
{include:Vedeu::Config::CLI#colour_mode}
|
25
24
|
|
26
25
|
### compression / compression!
|
27
26
|
{include:Vedeu::Config::API#compression}
|
28
27
|
|
29
28
|
### cooked / cooked!
|
30
29
|
{include:Vedeu::Config::API#cooked}
|
31
|
-
{include:Vedeu::Config::CLI#cooked}
|
32
30
|
|
33
31
|
### debug / debug!
|
34
32
|
{include:Vedeu::Config::API#debug}
|
35
|
-
{include:Vedeu::Config::CLI#debug}
|
36
33
|
|
37
34
|
### drb / drb!
|
38
35
|
{include:Vedeu::Config::API#drb}
|
39
|
-
{include:Vedeu::Config::CLI#drb}
|
40
36
|
|
41
37
|
### drb_host
|
42
38
|
{include:Vedeu::Config::API#drb_host}
|
43
|
-
{include:Vedeu::Config::CLI#drb_host}
|
44
39
|
|
45
40
|
### drb_port
|
46
41
|
{include:Vedeu::Config::API#drb_port}
|
47
|
-
{include:Vedeu::Config::CLI#drb_port}
|
48
42
|
|
49
43
|
### drb_height
|
50
44
|
{include:Vedeu::Config::API#drb_height}
|
51
|
-
{include:Vedeu::Config::CLI#drb_height}
|
52
45
|
|
53
46
|
### drb_width
|
54
47
|
{include:Vedeu::Config::API#drb_width}
|
55
|
-
{include:Vedeu::Config::CLI#drb_width}
|
56
48
|
|
57
49
|
### interactive / interactive!
|
58
50
|
{include:Vedeu::Config::API#interactive}
|
59
|
-
{include:Vedeu::Config::CLI#interactive}
|
60
51
|
|
61
52
|
### log
|
62
53
|
{include:Vedeu::Config::API#log}
|
63
|
-
{include:Vedeu::Config::CLI#log}
|
64
54
|
|
65
55
|
### log_only
|
66
56
|
{include:Vedeu::Config::API#log_only}
|
67
57
|
|
68
58
|
### raw / raw!
|
69
59
|
{include:Vedeu::Config::API#raw}
|
70
|
-
{include:Vedeu::Config::CLI#raw}
|
71
60
|
|
72
61
|
### renderer / renderers
|
73
62
|
{include:Vedeu::Config::API#renderer}
|
74
63
|
|
75
64
|
### root
|
76
65
|
{include:Vedeu::Config::API#root}
|
77
|
-
{include:Vedeu::Config::CLI#root}
|
78
66
|
|
79
67
|
### run_once / run_once!
|
80
68
|
{include:Vedeu::Config::API#run_once}
|
81
|
-
{include:Vedeu::Config::CLI#run_once}
|
82
69
|
|
83
70
|
### standalone / standalone!
|
84
71
|
{include:Vedeu::Config::API#standalone}
|
85
|
-
{include:Vedeu::Config::CLI#standalone}
|
86
72
|
|
87
73
|
### stderr
|
88
74
|
{include:Vedeu::Config::API#stderr}
|
data/lib/vedeu.rb
CHANGED
data/lib/vedeu/all.rb
CHANGED
@@ -6,7 +6,6 @@ require 'vedeu/common'
|
|
6
6
|
require 'vedeu/logging/all'
|
7
7
|
require 'vedeu/runtime/all'
|
8
8
|
|
9
|
-
require 'vedeu/configuration/cli'
|
10
9
|
require 'vedeu/configuration/api'
|
11
10
|
require 'vedeu/configuration/configuration'
|
12
11
|
|
@@ -17,6 +16,19 @@ require 'vedeu/input/keys'
|
|
17
16
|
|
18
17
|
require 'vedeu/models/toggleable'
|
19
18
|
|
19
|
+
require 'vedeu/output/presentation/presentation'
|
20
|
+
require 'vedeu/output/direct'
|
21
|
+
require 'vedeu/output/clear/named_group'
|
22
|
+
require 'vedeu/output/clear/named_interface'
|
23
|
+
require 'vedeu/output/compressor'
|
24
|
+
require 'vedeu/output/text'
|
25
|
+
require 'vedeu/output/output'
|
26
|
+
require 'vedeu/output/viewport'
|
27
|
+
require 'vedeu/output/wordwrap'
|
28
|
+
require 'vedeu/output/refresh/refresh'
|
29
|
+
require 'vedeu/output/refresh/refresh_group'
|
30
|
+
require 'vedeu/output/renderers/all'
|
31
|
+
|
20
32
|
require 'vedeu/esc/all'
|
21
33
|
require 'vedeu/null/all'
|
22
34
|
require 'vedeu/models/views/all'
|
@@ -35,19 +47,6 @@ require 'vedeu/input/all'
|
|
35
47
|
require 'vedeu/menus/all'
|
36
48
|
require 'vedeu/templating/all'
|
37
49
|
|
38
|
-
require 'vedeu/output/presentation/presentation'
|
39
|
-
require 'vedeu/output/direct'
|
40
|
-
require 'vedeu/output/clear/named_group'
|
41
|
-
require 'vedeu/output/clear/named_interface'
|
42
|
-
require 'vedeu/output/compressor'
|
43
|
-
require 'vedeu/output/text'
|
44
|
-
require 'vedeu/output/output'
|
45
|
-
require 'vedeu/output/viewport'
|
46
|
-
require 'vedeu/output/wordwrap'
|
47
|
-
require 'vedeu/output/refresh/refresh'
|
48
|
-
require 'vedeu/output/refresh/refresh_group'
|
49
|
-
require 'vedeu/output/renderers/all'
|
50
|
-
|
51
50
|
require 'vedeu/api/all'
|
52
51
|
require 'vedeu/bindings/all'
|
53
52
|
require 'vedeu/plugins/all'
|
data/lib/vedeu/api/internal.rb
CHANGED
@@ -64,8 +64,8 @@ module Vedeu
|
|
64
64
|
# Vedeu.documents
|
65
65
|
#
|
66
66
|
# @!method documents
|
67
|
-
# @return [Vedeu::Editor::
|
68
|
-
def_delegators Vedeu::Editor::
|
67
|
+
# @return [Vedeu::Editor::Repository]
|
68
|
+
def_delegators Vedeu::Editor::Repository, :documents
|
69
69
|
|
70
70
|
# Manipulate the repository of events.
|
71
71
|
#
|
data/lib/vedeu/bindings/focus.rb
CHANGED
@@ -420,8 +420,6 @@ module Vedeu
|
|
420
420
|
# @note
|
421
421
|
# - Be aware that running an application without compression
|
422
422
|
# will affect performance.
|
423
|
-
# - Compression cannot yet be configured using a CLI option
|
424
|
-
# flag.
|
425
423
|
#
|
426
424
|
# @param value [Boolean]
|
427
425
|
# @return [Boolean]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
# Namespace for
|
3
|
+
# Namespace for configuration classes.
|
4
4
|
#
|
5
5
|
module Config
|
6
6
|
|
@@ -8,8 +8,7 @@ module Vedeu
|
|
8
8
|
|
9
9
|
# Custom log for configuration.
|
10
10
|
#
|
11
|
-
# @param from [String] Which configuration set the options
|
12
|
-
# ('API' or 'CLI').
|
11
|
+
# @param from [String] Which configuration set the options.
|
13
12
|
# @param options [Hash] The configuration options set.
|
14
13
|
# @return [Hash] The options param.
|
15
14
|
def log(from, options)
|
@@ -22,12 +21,12 @@ module Vedeu
|
|
22
21
|
end
|
23
22
|
|
24
23
|
# Allows the customisation of Vedeu's behaviour through the
|
25
|
-
# configuration API
|
24
|
+
# configuration API.
|
26
25
|
#
|
27
26
|
# Provides access to Vedeu's configuration, which was set with
|
28
27
|
# sensible defaults (influenced by environment variables),
|
29
28
|
# overridden by client application settings (via the configuration
|
30
|
-
# API)
|
29
|
+
# API).
|
31
30
|
#
|
32
31
|
class Configuration
|
33
32
|
|
@@ -51,16 +50,13 @@ module Vedeu
|
|
51
50
|
alias_method :compression?, :compression
|
52
51
|
|
53
52
|
# Provides the mechanism to configure Vedeu. If the client
|
54
|
-
# application sets options, override the defaults with those
|
55
|
-
# and when command-line arguments are provided at application
|
56
|
-
# invocation, override any options with the arguments provided.
|
53
|
+
# application sets options, override the defaults with those.
|
57
54
|
#
|
58
55
|
# @example
|
59
56
|
# Vedeu.configure do
|
60
57
|
# # ...
|
61
58
|
# end
|
62
59
|
#
|
63
|
-
# @param args [Array]
|
64
60
|
# @param opts [Hash]
|
65
61
|
# @option opts stdin [File|IO]
|
66
62
|
# @option opts stdout [File|IO]
|
@@ -69,8 +65,8 @@ module Vedeu
|
|
69
65
|
# @raise [Vedeu::Error::InvalidSyntax]
|
70
66
|
# When the required block is not given.
|
71
67
|
# @return [Hash]
|
72
|
-
def configure(
|
73
|
-
instance.configure(
|
68
|
+
def configure(opts = {}, &block)
|
69
|
+
instance.configure(opts, &block)
|
74
70
|
end
|
75
71
|
|
76
72
|
# Returns the configuration singleton.
|
@@ -265,18 +261,14 @@ module Vedeu
|
|
265
261
|
end
|
266
262
|
|
267
263
|
# Set up default configuration and then allow the client
|
268
|
-
# application to modify it via the configuration API.
|
269
|
-
# process any command line arguments as potential configuration
|
270
|
-
# and apply that.
|
264
|
+
# application to modify it via the configuration API.
|
271
265
|
#
|
272
|
-
# @param args [Array]
|
273
266
|
# @param block [Proc]
|
274
267
|
# @return [Hash]
|
275
|
-
def configure(
|
268
|
+
def configure(opts = {}, &block)
|
276
269
|
@options.merge!(opts)
|
277
270
|
|
278
271
|
@options.merge!(Config::API.configure(&block)) if block_given?
|
279
|
-
@options.merge!(Config::CLI.configure(args)) if args.any?
|
280
272
|
|
281
273
|
Vedeu::Renderers.renderer(*@options[:renderers])
|
282
274
|
|
data/lib/vedeu/dsl/dsl.rb
CHANGED
@@ -32,6 +32,7 @@ module Vedeu
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# :nocov:
|
35
|
+
|
35
36
|
# Attempts to find the missing method on the client object.
|
36
37
|
#
|
37
38
|
# @param method [Symbol] The name of the method sought.
|
@@ -45,6 +46,7 @@ module Vedeu
|
|
45
46
|
|
46
47
|
client.send(method, *args, &block) if client
|
47
48
|
end
|
49
|
+
|
48
50
|
# :nocov:
|
49
51
|
|
50
52
|
end # DSL
|
data/lib/vedeu/dsl/text.rb
CHANGED
data/lib/vedeu/editor/all.rb
CHANGED
@@ -4,14 +4,14 @@ module Vedeu
|
|
4
4
|
|
5
5
|
# Allows the storing of documents.
|
6
6
|
#
|
7
|
-
class
|
7
|
+
class Repository < Vedeu::Repositories::Repository
|
8
8
|
|
9
9
|
singleton_class.send(:alias_method, :documents, :repository)
|
10
10
|
|
11
11
|
real Vedeu::Editor::Document
|
12
12
|
null Vedeu::Editor::Document
|
13
13
|
|
14
|
-
end #
|
14
|
+
end # Repository
|
15
15
|
|
16
16
|
end # Editor
|
17
17
|
|
data/lib/vedeu/esc/actions.rb
CHANGED
data/lib/vedeu/esc/borders.rb
CHANGED
data/lib/vedeu/esc/colours.rb
CHANGED
data/lib/vedeu/input/mapper.rb
CHANGED
@@ -54,12 +54,12 @@ module Vedeu
|
|
54
54
|
def keypress
|
55
55
|
return false unless key
|
56
56
|
|
57
|
-
Vedeu.log(type: :input, message: "Key detected: #{key.inspect}")
|
58
|
-
|
59
57
|
return true if key_defined? && keymap.use(key)
|
60
58
|
|
61
59
|
return true if global_key? && keymap('_global_').use(key)
|
62
60
|
|
61
|
+
Vedeu.log(type: :input, message: "Key detected: #{key.inspect}")
|
62
|
+
|
63
63
|
false
|
64
64
|
end
|
65
65
|
|
data/lib/vedeu/menus/all.rb
CHANGED
data/lib/vedeu/models/all.rb
CHANGED
@@ -10,13 +10,9 @@ end # Vedeu
|
|
10
10
|
|
11
11
|
require 'vedeu/models/views/char'
|
12
12
|
require 'vedeu/models/views/html_char'
|
13
|
-
require 'vedeu/models/views/collections/chars'
|
14
13
|
require 'vedeu/models/views/stream'
|
15
|
-
require 'vedeu/models/views/collections/streams'
|
16
14
|
require 'vedeu/models/views/line'
|
17
|
-
require 'vedeu/models/views/collections/lines'
|
18
15
|
require 'vedeu/models/interface'
|
19
16
|
require 'vedeu/models/interfaces'
|
20
|
-
require 'vedeu/models/views/collections/view_collection'
|
21
17
|
require 'vedeu/models/views/view'
|
22
18
|
require 'vedeu/models/views/composition'
|
@@ -2,6 +2,13 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Views
|
4
4
|
|
5
|
+
# A collection of {Vedeu::Views::Char} instances.
|
6
|
+
#
|
7
|
+
# @api private
|
8
|
+
class Chars < Vedeu::Repositories::Collection
|
9
|
+
|
10
|
+
end # Chars
|
11
|
+
|
5
12
|
# A Char represents a single character of the terminal. It is a container
|
6
13
|
# for the a single character in a {Vedeu::Views::Stream}.
|
7
14
|
#
|
@@ -2,6 +2,13 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Views
|
4
4
|
|
5
|
+
# A collection of {Vedeu::Views::Line} instances.
|
6
|
+
#
|
7
|
+
# @api private
|
8
|
+
class Lines < Vedeu::Repositories::Collection
|
9
|
+
|
10
|
+
end # Lines
|
11
|
+
|
5
12
|
# Represents a single row of the terminal. It is a container for
|
6
13
|
# {Vedeu::Views::Stream} objects. A line's width is determined by
|
7
14
|
# the {Vedeu::Geometry::Geometry} it belongs to.
|
@@ -2,6 +2,13 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Views
|
4
4
|
|
5
|
+
# A collection of {Vedeu::Views::Stream} instances.
|
6
|
+
#
|
7
|
+
# @api private
|
8
|
+
class Streams < Vedeu::Repositories::Collection
|
9
|
+
|
10
|
+
end # Streams
|
11
|
+
|
5
12
|
# Represents a character or collection of characters as part of a
|
6
13
|
# {Vedeu::Views::Line} which you wish to colour and style independently of
|
7
14
|
# the other characters in that line.
|