vedeu 0.6.13 → 0.6.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/docs/configuration.md +0 -14
  3. data/lib/vedeu.rb +0 -1
  4. data/lib/vedeu/all.rb +13 -14
  5. data/lib/vedeu/api/internal.rb +2 -2
  6. data/lib/vedeu/bindings/focus.rb +2 -0
  7. data/lib/vedeu/bindings/refresh.rb +2 -0
  8. data/lib/vedeu/bindings/system.rb +2 -0
  9. data/lib/vedeu/configuration/api.rb +0 -2
  10. data/lib/vedeu/configuration/configuration.rb +9 -17
  11. data/lib/vedeu/dsl/dsl.rb +2 -0
  12. data/lib/vedeu/dsl/text.rb +6 -0
  13. data/lib/vedeu/editor/all.rb +1 -1
  14. data/lib/vedeu/editor/{documents.rb → repository.rb} +2 -2
  15. data/lib/vedeu/esc/actions.rb +0 -2
  16. data/lib/vedeu/esc/borders.rb +0 -2
  17. data/lib/vedeu/esc/colours.rb +0 -2
  18. data/lib/vedeu/input/mapper.rb +2 -2
  19. data/lib/vedeu/menus/all.rb +3 -0
  20. data/lib/vedeu/models/all.rb +2 -0
  21. data/lib/vedeu/models/views/all.rb +0 -4
  22. data/lib/vedeu/models/views/char.rb +7 -0
  23. data/lib/vedeu/models/views/line.rb +7 -0
  24. data/lib/vedeu/models/views/stream.rb +7 -0
  25. data/lib/vedeu/models/views/view.rb +7 -0
  26. data/lib/vedeu/null/all.rb +4 -1
  27. data/lib/vedeu/null/interface.rb +0 -2
  28. data/lib/vedeu/null/view.rb +0 -2
  29. data/lib/vedeu/output/output.rb +8 -2
  30. data/lib/vedeu/output/renderers/all.rb +95 -1
  31. data/lib/vedeu/runtime/all.rb +2 -0
  32. data/lib/vedeu/runtime/launcher.rb +1 -9
  33. data/lib/vedeu/version.rb +1 -1
  34. data/test/lib/vedeu/editor/{documents_test.rb → repository_test.rb} +3 -3
  35. data/test/lib/vedeu/models/views/char_test.rb +13 -0
  36. data/test/lib/vedeu/models/views/line_test.rb +16 -3
  37. data/test/lib/vedeu/models/views/stream_test.rb +13 -0
  38. data/test/lib/vedeu/models/views/view_test.rb +13 -0
  39. data/test/lib/vedeu/output/output_test.rb +32 -18
  40. data/test/lib/vedeu/output/{renderers_test.rb → renderers/all_test.rb} +0 -0
  41. data/test/lib/vedeu/output/renderers/file_test.rb +2 -2
  42. metadata +6 -27
  43. data/lib/vedeu/configuration/cli.rb +0 -290
  44. data/lib/vedeu/models/views/collections/chars.rb +0 -14
  45. data/lib/vedeu/models/views/collections/lines.rb +0 -14
  46. data/lib/vedeu/models/views/collections/streams.rb +0 -14
  47. data/lib/vedeu/models/views/collections/view_collection.rb +0 -14
  48. data/lib/vedeu/null/null.rb +0 -11
  49. data/lib/vedeu/output/renderers.rb +0 -92
  50. data/test/lib/vedeu/configuration/cli_test.rb +0 -157
  51. data/test/lib/vedeu/models/views/collections/chars_test.rb +0 -22
  52. data/test/lib/vedeu/models/views/collections/lines_test.rb +0 -22
  53. data/test/lib/vedeu/models/views/collections/streams_test.rb +0 -22
  54. data/test/lib/vedeu/models/views/collections/view_collection_test.rb +0 -22
  55. data/test/lib/vedeu/null/null_test.rb +0 -8
  56. data/test/support/examples/configuration_app.rb +0 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31c6be7113f82b029855008aaaf699fbd567ae33
4
- data.tar.gz: 1bf5c6c64eb63d6332af2645be09bf0103fc19e8
3
+ metadata.gz: 7e1b859a5c5879bc2165e48baaf00b3a15448111
4
+ data.tar.gz: dd4db5330f731e8f171c38c3c3f22bd6331b5356
5
5
  SHA512:
6
- metadata.gz: 24727ce127fde1301bddc57102f7814fde4fb73f020012cbe0bf5d1d13c7b4023a0457691f1815f6e4ee6f5d53160843a003b53ba9dc231b12b9df8b8ac34e87
7
- data.tar.gz: 310d942055981700a8b3f7381291b0c1a29517c85531be676eee43ff877a6dba875f53b57a424d7863949c9f975b3dba66e766d811347e634fed7f074b8edae4
6
+ metadata.gz: 54b2f06a47ded5480ada1597206145f678390d23897656060724a263b37a68fdecc139a2f3393fb6ab6b97b47aca0d1e1cba762e62dc2df4b4c44a36ba25b59a
7
+ data.tar.gz: 29b42c9a6fb03431f8b4c45688edb6f30c7df68b434933406cc81e8eb69dc29614c8244762d622b59119034d5c8918ae1f8209d7e9640197182be2dd5e3e628e
@@ -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
@@ -12,7 +12,6 @@ require 'forwardable'
12
12
  require 'io/console'
13
13
  require 'json'
14
14
  require 'logger'
15
- require 'optparse'
16
15
  require 'set'
17
16
  require 'singleton'
18
17
  require 'thread'
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'
@@ -64,8 +64,8 @@ module Vedeu
64
64
  # Vedeu.documents
65
65
  #
66
66
  # @!method documents
67
- # @return [Vedeu::Editor::Documents]
68
- def_delegators Vedeu::Editor::Documents, :documents
67
+ # @return [Vedeu::Editor::Repository]
68
+ def_delegators Vedeu::Editor::Repository, :documents
69
69
 
70
70
  # Manipulate the repository of events.
71
71
  #
@@ -2,6 +2,8 @@ module Vedeu
2
2
 
3
3
  module Bindings
4
4
 
5
+ # Provides events to change the focus between interfaces/views.
6
+ #
5
7
  module Focus
6
8
 
7
9
  extend self
@@ -2,6 +2,8 @@ module Vedeu
2
2
 
3
3
  module Bindings
4
4
 
5
+ # Provides events to refresh the view.
6
+ #
5
7
  module Refresh
6
8
 
7
9
  extend self
@@ -2,6 +2,8 @@ module Vedeu
2
2
 
3
3
  module Bindings
4
4
 
5
+ # Provides events to manage Vedeu.
6
+ #
5
7
  module System
6
8
 
7
9
  extend self
@@ -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 the API configuration and CLI configuration classes.
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 or command-line arguments.
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), or any command-line arguments provided.
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(args = [], opts = {}, &block)
73
- instance.configure(args, opts, &block)
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. After this,
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(args = [], opts = {}, &block)
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
@@ -23,6 +23,12 @@ module Vedeu
23
23
  # right '...'
24
24
  # end
25
25
  #
26
+ # line do
27
+ # stream do
28
+ # text '...'
29
+ # end
30
+ # end
31
+ #
26
32
  # left 'This will be left aligned.', width: 35
27
33
  # # => 'This will be left aligned. '
28
34
  #
@@ -16,4 +16,4 @@ require 'vedeu/editor/line'
16
16
  require 'vedeu/editor/lines'
17
17
  require 'vedeu/editor/cursor'
18
18
  require 'vedeu/editor/document'
19
- require 'vedeu/editor/documents'
19
+ require 'vedeu/editor/repository'
@@ -4,14 +4,14 @@ module Vedeu
4
4
 
5
5
  # Allows the storing of documents.
6
6
  #
7
- class Documents < Vedeu::Repositories::Repository
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 # Documents
14
+ end # Repository
15
15
 
16
16
  end # Editor
17
17
 
@@ -1,7 +1,5 @@
1
1
  module Vedeu
2
2
 
3
- # Provides escape sequence strings.
4
- #
5
3
  module EscapeSequences
6
4
 
7
5
  # Provides action related escape sequences.
@@ -1,7 +1,5 @@
1
1
  module Vedeu
2
2
 
3
- # Provides escape sequence strings.
4
- #
5
3
  module EscapeSequences
6
4
 
7
5
  # Provides border/box related escape sequences.
@@ -1,7 +1,5 @@
1
1
  module Vedeu
2
2
 
3
- # Provides escape sequence strings.
4
- #
5
3
  module EscapeSequences
6
4
 
7
5
  # Provides colour related escape sequences.
@@ -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
 
@@ -1,5 +1,8 @@
1
1
  module Vedeu
2
2
 
3
+ # Provides the mechanism to create menus within client
4
+ # applications.
5
+ #
3
6
  module Menus
4
7
 
5
8
  end # Menus
@@ -1,5 +1,7 @@
1
1
  module Vedeu
2
2
 
3
+ # Provides various models which Vedeu uses.
4
+ #
3
5
  module Models
4
6
 
5
7
  end # Models
@@ -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.