vedeu 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/integrations/342_streams.rb +74 -0
  4. data/integrations/dsl_app_001.rb +58 -0
  5. data/integrations/dsl_app_002.rb +59 -0
  6. data/integrations/dsl_app_003.rb +58 -0
  7. data/integrations/dsl_app_004.rb +63 -0
  8. data/integrations/dsl_app_005.rb +62 -0
  9. data/integrations/dsl_app_006.rb +57 -0
  10. data/integrations/dsl_app_007.rb +63 -0
  11. data/integrations/dsl_app_008.rb +65 -0
  12. data/integrations/dsl_app_009.rb +70 -0
  13. data/integrations/dsl_app_010.rb +71 -0
  14. data/integrations/dsl_app_011.rb +61 -0
  15. data/integrations/dsl_app_012.rb +59 -0
  16. data/integrations/dsl_app_013.rb +60 -0
  17. data/integrations/dsl_app_014.rb +60 -0
  18. data/integrations/dsl_app_015.rb +60 -0
  19. data/integrations/dsl_app_016.rb +64 -0
  20. data/integrations/dsl_app_017.rb +56 -0
  21. data/integrations/dsl_app_018.rb +56 -0
  22. data/integrations/dsl_app_019.rb +56 -0
  23. data/integrations/dsl_app_020.rb +56 -0
  24. data/integrations/expected/342_streams.out +1 -0
  25. data/integrations/expected/dsl_app_001.out +1 -0
  26. data/integrations/expected/dsl_app_002.out +1 -0
  27. data/integrations/expected/dsl_app_003.out +1 -0
  28. data/integrations/expected/dsl_app_004.out +1 -0
  29. data/integrations/expected/dsl_app_005.out +1 -0
  30. data/integrations/expected/dsl_app_006.out +1 -0
  31. data/integrations/expected/dsl_app_007.out +1 -0
  32. data/integrations/expected/dsl_app_008.out +1 -0
  33. data/integrations/expected/dsl_app_009.out +1 -0
  34. data/integrations/expected/dsl_app_010.out +1 -0
  35. data/integrations/expected/dsl_app_011.out +1 -0
  36. data/integrations/expected/dsl_app_012.out +1 -0
  37. data/integrations/expected/dsl_app_013.out +1 -0
  38. data/integrations/expected/dsl_app_014.out +1 -0
  39. data/integrations/expected/dsl_app_015.out +1 -0
  40. data/integrations/expected/dsl_app_016.out +1 -0
  41. data/integrations/support/test_interface.rb +13 -0
  42. data/integrations/test_runner.sh +32 -0
  43. data/lib/vedeu/cells/empty.rb +14 -0
  44. data/lib/vedeu/colours/background.rb +13 -0
  45. data/lib/vedeu/colours/colour.rb +11 -4
  46. data/lib/vedeu/colours/foreground.rb +13 -0
  47. data/lib/vedeu/common.rb +42 -0
  48. data/lib/vedeu/dsl/attributes.rb +1 -1
  49. data/lib/vedeu/dsl/elements.rb +57 -23
  50. data/lib/vedeu/dsl/string/align.rb +17 -2
  51. data/lib/vedeu/geometries/position.rb +5 -0
  52. data/lib/vedeu/geometries/positionable.rb +2 -2
  53. data/lib/vedeu/presentation/style.rb +5 -0
  54. data/lib/vedeu/renderers/all.rb +1 -0
  55. data/lib/vedeu/renderers/escape.rb +96 -0
  56. data/lib/vedeu/repositories/defaults.rb +14 -6
  57. data/lib/vedeu/runtime/launcher.rb +5 -1
  58. data/lib/vedeu/version.rb +1 -1
  59. data/lib/vedeu/views/lines.rb +5 -0
  60. data/lib/vedeu/views/stream.rb +8 -1
  61. data/lib/vedeu/views/streams.rb +6 -1
  62. data/lib/vedeu/views/value.rb +2 -8
  63. data/lib/vedeu/views/view.rb +1 -1
  64. data/test/lib/vedeu/colours/colour_test.rb +0 -8
  65. data/test/lib/vedeu/common_test.rb +72 -0
  66. data/test/lib/vedeu/dsl/string/align_test.rb +1 -1
  67. metadata +43 -17
  68. data/examples/284_slow_rendering.rb +0 -108
  69. data/examples/views/expected/vedeu_line.html +0 -140
  70. data/examples/views/expected/vedeu_line.json +0 -96050
  71. data/examples/views/expected/vedeu_line.out +0 -1
  72. data/examples/views/expected/vedeu_line.txt +0 -58
  73. data/examples/views/expected/vedeu_lines.html +0 -140
  74. data/examples/views/expected/vedeu_lines.json +0 -96050
  75. data/examples/views/expected/vedeu_lines.out +0 -1
  76. data/examples/views/expected/vedeu_lines_alignment.html +0 -80
  77. data/examples/views/expected/vedeu_lines_alignment.json +0 -46370
  78. data/examples/views/expected/vedeu_lines_alignment.out +0 -1
  79. data/examples/views/line.rb +0 -128
  80. data/examples/views/lines.rb +0 -165
  81. data/examples/views/lines_alignment.rb +0 -126
  82. data/examples/views/runner.sh +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8d3a88483f88e3a4a7c316d555da795fa9b5aa0
4
- data.tar.gz: ca39dccef8dc1df26fadffdfd9f17826eaba3073
3
+ metadata.gz: abd33ac728a08d3f956652ebd9d8bac4b7c8174c
4
+ data.tar.gz: 9a9e106f52a0313cd07403bf11e2a39ba68c187c
5
5
  SHA512:
6
- metadata.gz: ac63eaaadabb40ae66f6e0a2086137e065a68d683e44d0662945b1b89eff9edb6fe2baa8272f424dc7e5e90241514a74bdcb4d53c7a4d710c161537c6d4e4c46
7
- data.tar.gz: d23e3e245d03ecbeaecb276858277517515ff9d0c8678c52b4ad8615f8ef4da93bb271085eb036beced13aa0df835edd1883542fcf10ce33e5bea4cd64b0f4cd
6
+ metadata.gz: 44a86ea06288d4aa5addcd6a9035622e45f489e53c99214ac3191daf64662ea3d85044110a536ed0d30dcebcf2112ebddfddd3e54af71e3c3ae54d9c7d3b1cb1
7
+ data.tar.gz: 48cd0c06ff4387e3629e07a162b9ca74b4172e8cf815fe9b93e15dd4f1a3d50c8b7e162ffe6438e72bb7e295e348449ddfcc811d2ebe6914d00f822e3b057094
data/.rubocop.yml CHANGED
@@ -21,6 +21,7 @@ AllCops:
21
21
  Exclude:
22
22
  - 'benchmarks/**/*'
23
23
  - 'examples/**/*'
24
+ - 'integrations/**/*'
24
25
  - 'test/**/*'
25
26
  - 'vendor/**/*'
26
27
  RunRailsCops: false
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ height 5
14
+ debug!
15
+ log '/tmp/vedeu_views_dsl.log'
16
+ renderers(Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/342_streams.out',
18
+ write_file: true))
19
+ run_once!
20
+ standalone!
21
+ end
22
+
23
+ Vedeu.interface :test1_interface do
24
+ background '#000022'
25
+ geometry do
26
+ x 3
27
+ y 3
28
+ xn 53
29
+ yn 3
30
+ end
31
+ end
32
+
33
+ Vedeu.render do
34
+ view(:test1_interface) do
35
+ line do
36
+ stream do
37
+ foreground '#cc66ff'
38
+ left '07/01/2016 21:32:19'
39
+ end
40
+ stream do
41
+ foreground '#007777'
42
+ left ' null'
43
+ end
44
+ stream do
45
+ foreground '#dddddd'
46
+ left ' > hi'
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ def self.actual
53
+ File.read('/tmp/342_streams.out')
54
+ end
55
+
56
+ def self.expected
57
+ File.read(File.expand_path('../expected/342_streams.out', __FILE__))
58
+ end
59
+
60
+ def self.start(argv = ARGV)
61
+ Vedeu::Launcher.execute!(argv)
62
+ end
63
+
64
+ end # DSLApp
65
+
66
+ DSLApp.start
67
+
68
+ if DSLApp.expected == DSLApp.actual
69
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
70
+ exit 0;
71
+ else
72
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
73
+ exit 1;
74
+ end
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_001.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_001.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_001.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_001.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ background '#440000'
32
+ line 'view->line', { foreground: '#ff0000' }
33
+ end
34
+ end
35
+
36
+ def self.actual
37
+ File.read('/tmp/dsl_app_001.out')
38
+ end
39
+
40
+ def self.expected
41
+ File.read(File.expand_path('../expected/dsl_app_001.out', __FILE__))
42
+ end
43
+
44
+ def self.start(argv = ARGV)
45
+ Vedeu::Launcher.execute!(argv)
46
+ end
47
+
48
+ end # DSLApp
49
+
50
+ DSLApp.start
51
+
52
+ if DSLApp.expected == DSLApp.actual
53
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
54
+ exit 0;
55
+ else
56
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
57
+ exit 1;
58
+ end
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_002.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_002.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_002.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_002.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ line 'view->line 1', { foreground: '#ff7f00' }
32
+ line 'view->line 2', { foreground: '#ffff00' }
33
+ end
34
+ end
35
+
36
+ def self.actual
37
+ File.read('/tmp/dsl_app_002.out')
38
+ end
39
+
40
+ def self.expected
41
+ File.read(File.expand_path('../expected/dsl_app_002.out', __FILE__))
42
+ end
43
+
44
+ def self.start(argv = ARGV)
45
+ Vedeu::Launcher.execute!(argv)
46
+ end
47
+
48
+ end # DSLApp
49
+
50
+ DSLApp.start
51
+
52
+ if DSLApp.expected == DSLApp.actual
53
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
54
+ exit 0;
55
+ else
56
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
57
+ exit 1;
58
+ end
59
+
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_003.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_003.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_003.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_003.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ text 'view->text 1', { foreground: '#00ff00' }
32
+ text 'view->text 2', { foreground: '#007fff' }
33
+ end
34
+ end
35
+
36
+ def self.actual
37
+ File.read('/tmp/dsl_app_003.out')
38
+ end
39
+
40
+ def self.expected
41
+ File.read(File.expand_path('../expected/dsl_app_003.out', __FILE__))
42
+ end
43
+
44
+ def self.start(argv = ARGV)
45
+ Vedeu::Launcher.execute!(argv)
46
+ end
47
+
48
+ end # DSLApp
49
+
50
+ DSLApp.start
51
+
52
+ if DSLApp.expected == DSLApp.actual
53
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
54
+ exit 0;
55
+ else
56
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
57
+ exit 1;
58
+ end
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_004.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_004.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_004.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_004.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ line do
32
+ text 'view->line 1->text', { foreground: '#5500cc' }
33
+ end
34
+ line do
35
+ text 'view->line 2->text 1', { foreground: '#ff00ff' }
36
+ text 'view->line 2->text 2', { foreground: '#ffffff' }
37
+ end
38
+ end
39
+ end
40
+
41
+ def self.actual
42
+ File.read('/tmp/dsl_app_004.out')
43
+ end
44
+
45
+ def self.expected
46
+ File.read(File.expand_path('../expected/dsl_app_004.out', __FILE__))
47
+ end
48
+
49
+ def self.start(argv = ARGV)
50
+ Vedeu::Launcher.execute!(argv)
51
+ end
52
+
53
+ end # DSLApp
54
+
55
+ DSLApp.start
56
+
57
+ if DSLApp.expected == DSLApp.actual
58
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
59
+ exit 0;
60
+ else
61
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
62
+ exit 1;
63
+ end
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_005.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_005.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_005.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_005.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ lines do
32
+ background '#000066'
33
+ line 'view->lines->line 1', { foreground: '#00ff00' }
34
+ line 'view->lines->line 2', { background: '#000000', foreground: '#007fff' }
35
+ line 'view->lines->line 3', { foreground: '#55aa00' }
36
+ end
37
+ end
38
+ end
39
+
40
+ def self.actual
41
+ File.read('/tmp/dsl_app_005.out')
42
+ end
43
+
44
+ def self.expected
45
+ File.read(File.expand_path('../expected/dsl_app_005.out', __FILE__))
46
+ end
47
+
48
+ def self.start(argv = ARGV)
49
+ Vedeu::Launcher.execute!(argv)
50
+ end
51
+
52
+ end # DSLApp
53
+
54
+ DSLApp.start
55
+
56
+ if DSLApp.expected == DSLApp.actual
57
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
58
+ exit 0;
59
+ else
60
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
61
+ exit 1;
62
+ end
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ class DSLApp
9
+
10
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
11
+
12
+ Vedeu.configure do
13
+ debug!
14
+ log '/tmp/vedeu_views_dsl.log'
15
+ renderers [
16
+ Vedeu::Renderers::Terminal.new(
17
+ filename: '/tmp/dsl_app_006.out',
18
+ write_file: true),
19
+ # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_006.json'),
20
+ # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_006.html'),
21
+ # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_006.txt'),
22
+ ]
23
+ run_once!
24
+ standalone!
25
+ end
26
+
27
+ load './support/test_interface.rb'
28
+
29
+ Vedeu.render do
30
+ view(:test_interface) do
31
+ stream 'view->stream', { foreground: '#ff0000' }
32
+ end
33
+ end
34
+
35
+ def self.actual
36
+ File.read('/tmp/dsl_app_006.out')
37
+ end
38
+
39
+ def self.expected
40
+ File.read(File.expand_path('../expected/dsl_app_006.out', __FILE__))
41
+ end
42
+
43
+ def self.start(argv = ARGV)
44
+ Vedeu::Launcher.execute!(argv)
45
+ end
46
+
47
+ end # DSLApp
48
+
49
+ DSLApp.start
50
+
51
+ if DSLApp.expected == DSLApp.actual
52
+ puts "#{__FILE__} \e[32mPassed.\e[39m"
53
+ exit 0;
54
+ else
55
+ puts "#{__FILE__} \e[31mFailed.\e[39m"
56
+ exit 1;
57
+ end