vedeu 0.8.17 → 0.8.18

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +1 -1
  3. data/docs/configuration/base_path.md +11 -0
  4. data/docs/configuration/colour.md +6 -0
  5. data/docs/configuration/colour_mode.md +13 -0
  6. data/docs/configuration/compression.md +22 -0
  7. data/docs/configuration/cooked.md +7 -0
  8. data/docs/configuration/debug.md +20 -0
  9. data/docs/configuration/drb_height.md +6 -0
  10. data/docs/configuration/drb_width.md +6 -0
  11. data/docs/configuration/fake.md +6 -0
  12. data/docs/configuration/height.md +12 -0
  13. data/docs/configuration/log.md +15 -0
  14. data/docs/configuration/log_except.md +11 -0
  15. data/docs/configuration/log_only.md +11 -0
  16. data/docs/configuration/mouse.md +11 -0
  17. data/docs/configuration/profile.md +22 -0
  18. data/docs/configuration/raw.md +7 -0
  19. data/docs/configuration/renderer.md +13 -0
  20. data/docs/configuration/root.md +9 -0
  21. data/docs/configuration/stderr.md +6 -0
  22. data/docs/configuration/stdin.md +6 -0
  23. data/docs/configuration/stdout.md +6 -0
  24. data/docs/configuration/terminal_mode.md +23 -0
  25. data/docs/configuration/threaded.md +3 -0
  26. data/docs/configuration/width.md +11 -0
  27. data/integrations/dsl_app_001.rb +1 -1
  28. data/integrations/dsl_app_002.rb +1 -1
  29. data/integrations/dsl_app_003.rb +1 -1
  30. data/integrations/dsl_app_004.rb +1 -1
  31. data/integrations/dsl_app_005.rb +1 -1
  32. data/integrations/dsl_app_006.rb +1 -1
  33. data/integrations/dsl_app_007.rb +1 -1
  34. data/integrations/dsl_app_008.rb +1 -1
  35. data/integrations/dsl_app_009.rb +1 -1
  36. data/integrations/dsl_app_010.rb +1 -1
  37. data/integrations/dsl_app_011.rb +1 -1
  38. data/integrations/dsl_app_012.rb +1 -1
  39. data/integrations/dsl_app_013.rb +1 -1
  40. data/integrations/dsl_app_014.rb +1 -1
  41. data/integrations/dsl_app_015.rb +1 -1
  42. data/integrations/dsl_app_016.rb +1 -1
  43. data/integrations/dsl_app_017.rb +1 -1
  44. data/integrations/dsl_app_018.rb +1 -1
  45. data/integrations/dsl_app_019.rb +1 -1
  46. data/integrations/dsl_app_020.rb +1 -1
  47. data/integrations/dsl_app_021.rb +1 -1
  48. data/integrations/dsl_app_022.rb +1 -1
  49. data/integrations/dsl_app_border_001.rb +1 -1
  50. data/integrations/dsl_app_border_002.rb +1 -1
  51. data/integrations/dsl_app_border_003.rb +1 -1
  52. data/integrations/dsl_app_border_004.rb +1 -1
  53. data/integrations/dsl_app_border_005.rb +1 -1
  54. data/lib/vedeu/application/application_view.rb +3 -3
  55. data/lib/vedeu/coercers/coercer.rb +17 -6
  56. data/lib/vedeu/coercers/colour.rb +2 -2
  57. data/lib/vedeu/coercers/editor_line.rb +1 -1
  58. data/lib/vedeu/colours/translator.rb +7 -4
  59. data/lib/vedeu/common.rb +1 -1
  60. data/lib/vedeu/configuration/api.rb +24 -279
  61. data/lib/vedeu/configuration/configuration.rb +53 -53
  62. data/lib/vedeu/distributed/all.rb +0 -1
  63. data/lib/vedeu/distributed/subprocess.rb +3 -4
  64. data/lib/vedeu/error.rb +11 -6
  65. data/lib/vedeu/events/trigger.rb +1 -1
  66. data/lib/vedeu/groups/group.rb +0 -1
  67. data/lib/vedeu/logging/log.rb +7 -8
  68. data/lib/vedeu/renderers/support/options.rb +2 -2
  69. data/lib/vedeu/support/point.rb +1 -1
  70. data/lib/vedeu/version.rb +1 -1
  71. data/test/lib/vedeu/coercers/coercer_test.rb +9 -3
  72. data/test/lib/vedeu/coercers/editor_line_test.rb +12 -5
  73. data/test/lib/vedeu/common_test.rb +6 -0
  74. data/test/lib/vedeu/configuration/configuration_test.rb +0 -6
  75. data/test/lib/vedeu/error_test.rb +19 -9
  76. data/test/lib/vedeu/repositories/assemblage_test.rb +2 -2
  77. data/test/lib/vedeu/repositories/collection_test.rb +5 -2
  78. data/test/lib/vedeu/repositories/model_test.rb +16 -2
  79. data/test/lib/vedeu/repositories/registerable_test.rb +7 -2
  80. data/test/lib/vedeu/support/point_test.rb +6 -0
  81. data/test/test_helper.rb +0 -1
  82. metadata +26 -7
  83. data/lib/vedeu/distributed/test_application.rb +0 -117
  84. data/test/lib/vedeu/distributed/test_application_test.rb +0 -95
  85. data/test/support/helpers/model_test_class.rb +0 -74
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 428c6ce796c2302c1c1ffdc4fe0e24dbc93bd72d
4
- data.tar.gz: f2be6bebebfc68dad88801c1d28100bcd615a7fe
3
+ metadata.gz: bed6cd0c3c695df9f891c552340787a070f6f54a
4
+ data.tar.gz: 8dcad64d499e1cf9dffb5dda7451b050f9a09a12
5
5
  SHA512:
6
- metadata.gz: ea73e52d7a7641e7d201508946bd444f8010c33d43b198ae2a8db66b634beb2f6604eaae721f1123a3fdb7a7580635c677419f6de963eb6c4d4eef366abf14af
7
- data.tar.gz: 29571610db40d58fdb32d01ce87719da00ff8f28f5f67bb0776156d9a79a4affe5f3b48ed76b90a0fb7e87e44bfaa4c9ded1194508b6340e2cf8e8b14f5d510e
6
+ metadata.gz: 179414aaacba620522ea4005d8c353609ea5deab9e9ad4d7d0d5431ee31bc634ca32c42df602056a41078f8eb3a8a779758fe2a1d07257c71a037e41d1420460
7
+ data.tar.gz: 1ddf063acbd38734c3098c5cc88b4cb1bf0aa9240ec8d9f806be1c82c2107d80890d1b3d9c639b81264ccfcc6e230832a6b7a7e0cdb78fa659b8c7664b863722
data/Guardfile CHANGED
@@ -10,7 +10,7 @@ end
10
10
  guard :minitest, all_after_pass: true,
11
11
  focus_on_failed: true do
12
12
  watch(%r{^test/(.*)_test\.rb})
13
- watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
13
+ watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
14
14
  watch(%r{^test/test_helper\.rb}) { 'test' }
15
15
  watch(%r{^lib/(.+)all\.rb}) { 'test' }
16
16
  end
@@ -0,0 +1,11 @@
1
+ Configure the base path of the client application.
2
+
3
+ Override the base path for the application (for locating
4
+ templates and other resources). By default the base path is
5
+ just the current working directory but this will not work for many
6
+ applications.
7
+
8
+ Vedeu.configure do
9
+ base_path '/path/to/application'
10
+ # ...
11
+ end
@@ -0,0 +1,6 @@
1
+ Sets the background and foreground of the terminal.
2
+
3
+ Vedeu.configure do
4
+ colour background: '#ff0000', foreground: '#ffff00'
5
+ # ...
6
+ end
@@ -0,0 +1,13 @@
1
+ Sets the colour mode of the terminal.
2
+
3
+ Vedeu.configure do
4
+ colour_mode 256
5
+ # ...
6
+ end
7
+
8
+ Note
9
+ - iTerm 2 on Mac OSX will handle the true colour setting
10
+ (16777216), whereas Terminator on Linux will not display
11
+ colours correctly. For compatibility across platforms, it is
12
+ recommended to either not set the colour mode at all and
13
+ allow it to be detected, or use 256 here.
@@ -0,0 +1,22 @@
1
+ Compression reduces the number of escape sequences being sent to the
2
+ terminal which improves redraw/render/refresh rate. By default it is
3
+ enabled.
4
+
5
+ Sets boolean to enable/disable compression. Vedeu's default setting is
6
+ for compression to be enabled. Setting `compression` to false will
7
+ disable compression.
8
+
9
+ Vedeu.configure do
10
+ compression! # enabled (default)
11
+ # ...
12
+ end
13
+
14
+ Vedeu.configure do
15
+ compression false
16
+ # ...
17
+ end
18
+
19
+ Note:
20
+
21
+ - Be aware that running an application without compression will affect
22
+ performance.
@@ -0,0 +1,7 @@
1
+ Sets the terminal mode to `cooked`. Default terminal mode is `raw`.
2
+ Also, see {Vedeu::Config::API#raw!}
3
+
4
+ Vedeu.configure do
5
+ cooked!
6
+ # ...
7
+ end
@@ -0,0 +1,20 @@
1
+ Sets boolean to enable/disable debugging. Vedeu's default setting is
2
+ for debugging to be disabled. Using `debug!` or setting `debug` to
3
+ true will enable debugging.
4
+
5
+ Enabling debugging will:
6
+ - Log when an event is triggered which has no action registered.
7
+ - Enable `Vedeu::Logging::Timer` meaning various timing information is
8
+ output to the log file.
9
+ - Produce a full a backtrace to STDOUT and the log file upon
10
+ unrecoverable error or unhandled exception.
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ # ...
15
+ end
16
+
17
+ Vedeu.configure do
18
+ debug false
19
+ # ...
20
+ end
@@ -0,0 +1,6 @@
1
+ Sets the height of the fake terminal in the DRb server.
2
+
3
+ Vedeu.configure do
4
+ drb_height 25
5
+ # ...
6
+ end
@@ -0,0 +1,6 @@
1
+ Sets the width of the fake terminal in the DRb server.
2
+
3
+ Vedeu.configure do
4
+ drb_width 80
5
+ # ...
6
+ end
@@ -0,0 +1,6 @@
1
+ Sets the terminal mode to `fake`. Default terminal mode is `raw`.
2
+
3
+ Vedeu.configure do
4
+ fake!
5
+ # ...
6
+ end
@@ -0,0 +1,12 @@
1
+ Sets the height of the terminal.
2
+
3
+ Vedeu.configure do
4
+ height 25
5
+
6
+ # or...
7
+
8
+ height = 25
9
+
10
+ # ...
11
+ end
12
+
@@ -0,0 +1,15 @@
1
+ Sets the location of the log file, or disables the log. By default,
2
+ the log file is set to '/tmp/vedeu_bootstrap.log'.
3
+
4
+ # Log messages will be sent to the path given.
5
+ Vedeu.configure do
6
+ log '/var/log/vedeu.log'
7
+ # ...
8
+ end
9
+
10
+ # Log messages will be silently dropped.
11
+ Vedeu.configure do
12
+ log false
13
+ # ...
14
+ end
15
+
@@ -0,0 +1,11 @@
1
+ Log specific message types except those given. A complete list of
2
+ message types can be found at {Vedeu::LOG_TYPES}.
3
+
4
+ Vedeu.configure do
5
+ log_except :debug, :event
6
+
7
+ # or
8
+ log_except [:debug, :info]
9
+
10
+ # ...
11
+ end
@@ -0,0 +1,11 @@
1
+ Only log specific message types. A complete list of message types can
2
+ be found at {Vedeu::LOG_TYPES}.
3
+
4
+ Vedeu.configure do
5
+ log_only :debug, :event
6
+
7
+ # or
8
+ log_only [:debug, :info]
9
+
10
+ # ...
11
+ end
@@ -0,0 +1,11 @@
1
+ Sets boolean to enable/disable mouse support.
2
+
3
+ Vedeu.configure do
4
+ mouse! # => same as `mouse true`
5
+
6
+ # or...
7
+ mouse true
8
+
9
+ mouse false
10
+
11
+ end
@@ -0,0 +1,22 @@
1
+ Sets boolean to enable/disable profiling. Vedeu's default setting is
2
+ for profiling to be disabled. Using `profile!` or setting `profile` to
3
+ true will enable profiling.
4
+
5
+ Profile uses 'ruby-prof' to write a 'vedeu_profile' file to the /tmp
6
+ directory which contains a call trace of the running application.
7
+ Upon exit, this file can be examined to ascertain certain behaviours
8
+ of Vedeu.
9
+
10
+ Note:
11
+ Be aware that running an application with profiling enabled will
12
+ affect performance considerably.
13
+
14
+ Vedeu.configure do
15
+ profile!
16
+ # ...
17
+ end
18
+
19
+ Vedeu.configure do
20
+ profile false
21
+ # ...
22
+ end
@@ -0,0 +1,7 @@
1
+ Sets the terminal mode to `raw`. Default terminal mode is `raw`. Also,
2
+ see {Vedeu::Config::API#cooked!}
3
+
4
+ Vedeu.configure do
5
+ raw!
6
+ # ...
7
+ end
@@ -0,0 +1,13 @@
1
+ Sets the renderers for Vedeu. Each renderer added must have the class
2
+ method '.render' defined as this will be called when rendering
3
+ content.
4
+
5
+ Vedeu.configure do
6
+ renderer MyRenderer
7
+ # ...
8
+ end
9
+
10
+ Vedeu.configure do
11
+ renderers MyRenderer, MyOtherRenderer
12
+ # ...
13
+ end
@@ -0,0 +1,9 @@
1
+ Configure the root class of the client application.
2
+
3
+ Vedeu will execute this controller with action and optional arguments
4
+ first.
5
+
6
+ Vedeu.configure do
7
+ root :controller, :action, args
8
+ # ...
9
+ end
@@ -0,0 +1,6 @@
1
+ Sets the value of STDERR.
2
+
3
+ Vedeu.configure do
4
+ stderr IO.console
5
+ # ...
6
+ end
@@ -0,0 +1,6 @@
1
+ Sets the value of STDIN.
2
+
3
+ Vedeu.configure do
4
+ stdin IO.console
5
+ # ...
6
+ end
@@ -0,0 +1,6 @@
1
+ Sets the value of STDOUT.
2
+
3
+ Vedeu.configure do
4
+ stdout IO.console
5
+ # ...
6
+ end
@@ -0,0 +1,23 @@
1
+ Sets the terminal mode. Valid values can be either ':cooked', ':fake'
2
+ or :raw'.
3
+
4
+ Vedeu.configure do
5
+ terminal_mode :cooked
6
+
7
+ # or...
8
+
9
+ terminal_mode :fake
10
+
11
+ # or...
12
+
13
+ terminal_mode :raw
14
+
15
+ # or...
16
+
17
+ terminal_mode = :raw
18
+ terminal_mode = :fake
19
+ terminal_mode = :cooked
20
+
21
+ # ... some code
22
+ end
23
+
@@ -0,0 +1,3 @@
1
+ Instructs Vedeu to use threads to perform certain actions.
2
+
3
+ This can have a performance impact.
@@ -0,0 +1,11 @@
1
+ Sets the width of the terminal.
2
+
3
+ Vedeu.configure do
4
+ width 80
5
+
6
+ # or...
7
+
8
+ width = 80
9
+
10
+ # ...
11
+ end
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do
@@ -25,7 +25,7 @@ class DSLApp
25
25
  standalone!
26
26
  end
27
27
 
28
- load './support/test_interface.rb'
28
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
29
29
 
30
30
  Vedeu.render do
31
31
  view(:test_interface) do