vedeu 0.8.21 → 0.8.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/bin/vedeu_drb_server +4 -4
  3. data/docs/configuration/log.md +3 -1
  4. data/docs/configuration/profile.md +2 -1
  5. data/examples/dsl_alignment.rb +2 -2
  6. data/examples/dsl_colours.rb +2 -2
  7. data/examples/dsl_demo_groups.rb +1 -1
  8. data/examples/dsl_editor.rb +2 -2
  9. data/examples/dsl_hello_worlds.rb +1 -1
  10. data/examples/dsl_horizontal_alignment.rb +2 -2
  11. data/examples/dsl_menus.rb +1 -1
  12. data/examples/dsl_vertical_alignment.rb +2 -2
  13. data/examples/views/empty_template.rb +5 -5
  14. data/examples/views/full_screen.rb +5 -5
  15. data/examples/views/misc_view.rb +3 -2
  16. data/examples/views/wordwrap.rb +1 -1
  17. data/integrations/342_streams.rb +2 -2
  18. data/integrations/dsl_app_001.rb +5 -5
  19. data/integrations/dsl_app_002.rb +5 -5
  20. data/integrations/dsl_app_003.rb +5 -5
  21. data/integrations/dsl_app_004.rb +5 -5
  22. data/integrations/dsl_app_005.rb +5 -5
  23. data/integrations/dsl_app_006.rb +5 -5
  24. data/integrations/dsl_app_007.rb +5 -5
  25. data/integrations/dsl_app_008.rb +5 -5
  26. data/integrations/dsl_app_009.rb +5 -5
  27. data/integrations/dsl_app_010.rb +5 -5
  28. data/integrations/dsl_app_011.rb +5 -5
  29. data/integrations/dsl_app_012.rb +5 -5
  30. data/integrations/dsl_app_013.rb +5 -5
  31. data/integrations/dsl_app_014.rb +5 -5
  32. data/integrations/dsl_app_015.rb +5 -5
  33. data/integrations/dsl_app_016.rb +5 -5
  34. data/integrations/dsl_app_017.rb +5 -5
  35. data/integrations/dsl_app_018.rb +5 -5
  36. data/integrations/dsl_app_019.rb +5 -5
  37. data/integrations/dsl_app_020.rb +5 -5
  38. data/integrations/dsl_app_021.rb +5 -5
  39. data/integrations/dsl_app_022.rb +5 -5
  40. data/integrations/dsl_app_border_001.rb +5 -5
  41. data/integrations/dsl_app_border_002.rb +5 -5
  42. data/integrations/dsl_app_border_003.rb +5 -5
  43. data/integrations/dsl_app_border_004.rb +5 -5
  44. data/integrations/dsl_app_border_005.rb +5 -5
  45. data/integrations/dsl_app_border_006.rb +5 -5
  46. data/integrations/dsl_app_border_007.rb +5 -5
  47. data/integrations/dsl_app_border_008.rb +5 -5
  48. data/integrations/dsl_app_border_009.rb +5 -5
  49. data/integrations/dsl_app_border_010.rb +5 -5
  50. data/integrations/dsl_app_border_011.rb +5 -5
  51. data/integrations/test_runner.rb +1 -1
  52. data/lib/vedeu/configuration/configuration.rb +1 -1
  53. data/lib/vedeu/distributed/subprocess.rb +2 -4
  54. data/lib/vedeu/distributed/templates/default_configuration.vedeu +2 -2
  55. data/lib/vedeu/editor/cropper.rb +4 -4
  56. data/lib/vedeu/editor/cursor.rb +13 -6
  57. data/lib/vedeu/editor/item.rb +12 -2
  58. data/lib/vedeu/logging/debug.rb +1 -1
  59. data/lib/vedeu/renderers/support/options.rb +1 -1
  60. data/lib/vedeu/runtime/bootstrap.rb +1 -1
  61. data/lib/vedeu/version.rb +1 -1
  62. data/lib/vedeu.rb +1 -0
  63. data/test/lib/vedeu/configuration/api_test.rb +2 -2
  64. data/test/lib/vedeu/configuration/configuration_test.rb +3 -3
  65. data/test/lib/vedeu/logging/debug_test.rb +1 -1
  66. data/test/lib/vedeu/renderers/support/file_test.rb +3 -3
  67. data/test/lib/vedeu/templating/template_test.rb +2 -2
  68. data/test/lib/vedeu/templating/view_template_test.rb +1 -1
  69. data/test/support/examples/drb_app.rb +2 -2
  70. data/test/support/examples/focus_app.rb +1 -1
  71. data/test/support/examples/hello_world.rb +1 -1
  72. data/test/support/examples/material_colours_app.rb +2 -2
  73. data/test/support/examples/view_templates_app/view_templates_app.rb +1 -1
  74. data/test/support/ttyrec.rb +2 -2
  75. data/test/test_helper.rb +3 -3
  76. metadata +2 -2
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -14,14 +14,14 @@ class DSLApp
14
14
  Vedeu.configure do
15
15
  debug!
16
16
  height 10
17
- log '/tmp/vedeu_views_dsl.log'
17
+ log Dir.tmpdir + '/vedeu_views_dsl.log'
18
18
  renderers [
19
19
  Vedeu::Renderers::Terminal.new(
20
- filename: "/tmp/#{TESTCASE}.out",
20
+ filename: Dir.tmpdir + "/#{TESTCASE}.out",
21
21
  write_file: true),
22
- # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
- # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
- # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
22
+ # Vedeu::Renderers::JSON.new(filename: Dir.tmpdir + "/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: Dir.tmpdir + "/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: Dir.tmpdir + "/#{TESTCASE}.txt"),
25
25
  ]
26
26
  run_once!
27
27
  standalone!
@@ -59,7 +59,7 @@ class TestRunner
59
59
 
60
60
  # @return [String]
61
61
  def actual_path
62
- "/tmp/#{testcase}.out"
62
+ Dir.tmpdir + "/#{testcase}.out"
63
63
  end
64
64
 
65
65
  # @return [String]
@@ -423,7 +423,7 @@ module Vedeu
423
423
  foreground: :default,
424
424
  height: nil,
425
425
  interactive: true,
426
- log: '/tmp/vedeu_bootstrap.log',
426
+ log: Dir.tmpdir + '/vedeu_bootstrap.log',
427
427
  log_except: [],
428
428
  log_only: [],
429
429
  mouse: true,
@@ -27,9 +27,7 @@ module Vedeu
27
27
  def execute!
28
28
  file_open && file_write && file_close
29
29
 
30
- @pid = fork do
31
- exec(file_path)
32
- end
30
+ @pid = fork { exec(file_path) }
33
31
 
34
32
  Process.detach(@pid)
35
33
 
@@ -91,7 +89,7 @@ module Vedeu
91
89
 
92
90
  # @return [String]
93
91
  def file_name
94
- "/tmp/foo_#{timestamp}"
92
+ Dir.tmpdir + "/foo_#{timestamp}"
95
93
  end
96
94
 
97
95
  # return [Fixnum]
@@ -1,6 +1,6 @@
1
1
  Vedeu.configure do
2
2
  # compression false
3
- # log '/tmp/your_app.log'
3
+ # log Dir.tmpdir + '/your_app.log'
4
4
  # debug!
5
5
  # profile!
6
6
  # drb!
@@ -22,5 +22,5 @@ Vedeu.configure do
22
22
  # Not used yet
23
23
  # stdin File.open("/dev/tty", "r")
24
24
  # stdout File.open("/dev/tty", "w")
25
- # stderr File.open("/tmp/vedeu_error.log", "w+")
25
+ # stderr File.open(Dir.tmpdir + "/vedeu_error.log", "w+")
26
26
  end
@@ -45,10 +45,10 @@ module Vedeu
45
45
 
46
46
  visible.each_with_index do |line, iy|
47
47
  line.chars.each_with_index do |char, ix|
48
- position = Vedeu::Geometries::Position.new((by + iy), (bx + ix))
49
- out << Vedeu::Cells::Char.new(name: name,
50
- position: position,
51
- value: char)
48
+ out << Vedeu::Cells::Char.new(
49
+ name: name,
50
+ position: Vedeu::Geometries::Position.new((by + iy), (bx + ix)),
51
+ value: char)
52
52
  end
53
53
  end
54
54
 
@@ -93,12 +93,7 @@ module Vedeu
93
93
  # @return [Vedeu::Editor::Cursor]
94
94
  # @todo Should ox/oy be 0; or set to @ox/@oy? (GL: 2015-10-02)
95
95
  def refresh
96
- Vedeu::Cursors::Cursor.store(name: name,
97
- x: real_x,
98
- y: real_y,
99
- ox: 0,
100
- oy: 0,
101
- visible: true)
96
+ Vedeu::Cursors::Cursor.store(refresh_attributes)
102
97
 
103
98
  Vedeu.trigger(:_refresh_cursor_, name)
104
99
 
@@ -195,6 +190,18 @@ module Vedeu
195
190
  (bx + x) - ox
196
191
  end
197
192
 
193
+ # @return [Hash<Symbol => Fixnum, String, Symbol>]
194
+ def refresh_attributes
195
+ {
196
+ name: name,
197
+ x: real_x,
198
+ y: real_y,
199
+ ox: 0,
200
+ oy: 0,
201
+ visible: true
202
+ }
203
+ end
204
+
198
205
  end # Cursor
199
206
 
200
207
  end # Editor
@@ -30,10 +30,10 @@ module Vedeu
30
30
  def by_index
31
31
  return nil unless collection
32
32
 
33
- if index.nil? || index > collection.size
33
+ if index_out_of_range?
34
34
  last_item
35
35
 
36
- elsif index > 0 && index <= collection.size
36
+ elsif index_within_range?
37
37
  nth_item
38
38
 
39
39
  else
@@ -69,6 +69,16 @@ module Vedeu
69
69
  collection[index]
70
70
  end
71
71
 
72
+ # @return [Boolean]
73
+ def index_out_of_range?
74
+ index.nil? || index > collection.size
75
+ end
76
+
77
+ # @return [Boolean]
78
+ def index_within_range?
79
+ index > 0 && index <= collection.size
80
+ end
81
+
72
82
  end # Item
73
83
 
74
84
  end # Editor
@@ -41,7 +41,7 @@ module Vedeu
41
41
  # @macro raise_requires_block
42
42
  # @return [void]
43
43
  # @yieldreturn [void] The section of the application to profile.
44
- def profile(filename = '/tmp/vedeu_profile', &block)
44
+ def profile(filename = Dir.tmpdir + '/vedeu_profile', &block)
45
45
  Vedeu.requires_gem!('ruby-prof')
46
46
 
47
47
  raise Vedeu::Error::RequiresBlock unless block_given?
@@ -90,7 +90,7 @@ module Vedeu
90
90
  compression: Vedeu.config.compression?,
91
91
  end_tag: '</td>',
92
92
  end_row_tag: '</tr>',
93
- filename: '/tmp/vedeu_out',
93
+ filename: Dir.tmpdir + '/vedeu_out',
94
94
  output: '',
95
95
  start_tag: '<td',
96
96
  start_row_tag: '<tr>',
@@ -112,7 +112,7 @@ module Vedeu
112
112
  # @return [void]
113
113
  def configure_log!
114
114
  Vedeu.configure do
115
- log('/tmp/vedeu_bootstrap.log')
115
+ log(Dir.tmpdir + '/vedeu_bootstrap.log')
116
116
  end unless Vedeu.config.log?
117
117
  end
118
118
 
data/lib/vedeu/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
  module Vedeu
4
4
 
5
5
  # The current version of Vedeu.
6
- VERSION = '0.8.21'
6
+ VERSION = '0.8.22'
7
7
 
8
8
  end
data/lib/vedeu.rb CHANGED
@@ -14,6 +14,7 @@ require 'set'
14
14
  require 'singleton'
15
15
  require 'thread'
16
16
  require 'time'
17
+ require 'tmpdir'
17
18
  require 'zlib'
18
19
 
19
20
  # Gem dependencies
@@ -257,8 +257,8 @@ module Vedeu
257
257
 
258
258
  describe '#log' do
259
259
  it 'sets the options to the desired value' do
260
- configuration = Vedeu.configure { log('/tmp/vedeu_api_test.log') }
261
- configuration.log.must_equal('/tmp/vedeu_api_test.log')
260
+ configuration = Vedeu.configure { log(Dir.tmpdir + '/vedeu_api_test.log') }
261
+ configuration.log.must_equal(Dir.tmpdir + '/vedeu_api_test.log')
262
262
  end
263
263
  end
264
264
 
@@ -66,18 +66,18 @@ module Vedeu
66
66
  describe '.log' do
67
67
  context 'when the log is not configured' do
68
68
  it 'sends messages to the default log' do
69
- described.log.must_equal('/tmp/vedeu_bootstrap.log')
69
+ described.log.must_equal(Dir.tmpdir + '/vedeu_bootstrap.log')
70
70
  end
71
71
  end
72
72
 
73
73
  context 'when the log is configured with a filename' do
74
74
  before do
75
75
  Vedeu.configure do
76
- log '/tmp/vedeu.log'
76
+ log Dir.tmpdir + '/vedeu.log'
77
77
  end
78
78
  end
79
79
 
80
- it { described.log.must_equal('/tmp/vedeu.log') }
80
+ it { described.log.must_equal(Dir.tmpdir + '/vedeu.log') }
81
81
  end
82
82
 
83
83
  context 'when the log is configured with false' do
@@ -11,7 +11,7 @@ module Vedeu
11
11
  let(:described) { Vedeu::Logging::Debug }
12
12
 
13
13
  before do
14
- File.stubs(:open).with('/tmp/vedeu_profile', 'w').returns(:some_code)
14
+ File.stubs(:open).with(Dir.tmpdir + '/vedeu_profile', 'w').returns(:some_code)
15
15
  end
16
16
 
17
17
  describe '.debug' do
@@ -55,7 +55,7 @@ module Vedeu
55
55
  # context 'when the filename option is not set' do
56
56
  # context 'when the timestamp option is not set' do
57
57
  # # it do
58
- # # ::File.expects(:write).with('/tmp/out', nil)
58
+ # # ::File.expects(:write).with(Dir.tmpdir + '/out', nil)
59
59
  # # subject
60
60
  # # end
61
61
  # end
@@ -66,7 +66,7 @@ module Vedeu
66
66
  # before { Time.stubs(:now).returns(_time) }
67
67
 
68
68
  # # it do
69
- # # ::File.expects(:write).with('/tmp/out_1428865500.0', 'w')
69
+ # # ::File.expects(:write).with(Dir.tmpdir + '/out_1428865500.0', 'w')
70
70
  # # subject
71
71
  # # end
72
72
  # end
@@ -76,7 +76,7 @@ module Vedeu
76
76
  # let(:filename) { 'some_name' }
77
77
 
78
78
  # # it do
79
- # # ::File.expects(:write).with('/tmp/some_name', 'w')
79
+ # # ::File.expects(:write).with(Dir.tmpdir + '/some_name', 'w')
80
80
  # # subject
81
81
  # # end
82
82
  # end
@@ -29,7 +29,7 @@ module Vedeu
29
29
  end
30
30
 
31
31
  context 'when the path is does not exist' do
32
- let(:path) { '/tmp/vedeu_does_not_exist' }
32
+ let(:path) { Dir.tmpdir + '/vedeu_does_not_exist' }
33
33
 
34
34
  before { File.stubs(:exist?).returns(false) }
35
35
 
@@ -37,7 +37,7 @@ module Vedeu
37
37
  end
38
38
 
39
39
  context 'when the path exists' do
40
- let(:path) { '/tmp/vedeu_exists' }
40
+ let(:path) { Dir.tmpdir + '/vedeu_exists' }
41
41
  let(:expected) { "This is a test.\n" }
42
42
 
43
43
  before do
@@ -11,7 +11,7 @@ module Vedeu
11
11
  let(:described) { Vedeu::Templating::ViewTemplate }
12
12
  let(:instance) { described.new(object, path, options) }
13
13
  let(:object) {}
14
- let(:path) { '/tmp/some_template.erb' }
14
+ let(:path) { Dir.tmpdir + '/some_template.erb' }
15
15
  let(:options) { {} }
16
16
  let(:content) { '' }
17
17
 
@@ -17,7 +17,7 @@ class VedeuTestApplication
17
17
  # Be aware that running an application with profiling enabled will affect
18
18
  # performance.
19
19
  Vedeu.configure do
20
- log '/tmp/vedeu_test_helper.log'
20
+ log Dir.tmpdir + '/vedeu_test_helper.log'
21
21
  debug!
22
22
  # profile!
23
23
  drb!
@@ -45,7 +45,7 @@ class VedeuTestApplication
45
45
  # Not used yet
46
46
  # stdin File.open("/dev/tty", "r")
47
47
  # stdout File.open("/dev/tty", "w")
48
- # stderr File.open("/tmp/vedeu_error.log", "w+")
48
+ # stderr File.open(Dir.tmpdir + "/vedeu_error.log", "w+")
49
49
  end
50
50
 
51
51
  Vedeu.border 'test_interface' do
@@ -25,7 +25,7 @@ class VedeuFocusApp
25
25
  # performance.
26
26
  Vedeu.configure do
27
27
  debug!
28
- log '/tmp/vedeu_focus_app.log'
28
+ log Dir.tmpdir + '/vedeu_focus_app.log'
29
29
  # profile!
30
30
  end
31
31