vedeu 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +3 -0
  3. data/Rakefile +16 -7
  4. data/examples/borders_app.rb +58 -55
  5. data/lib/vedeu/api.rb +1 -1
  6. data/lib/vedeu/application.rb +25 -25
  7. data/lib/vedeu/bindings.rb +5 -7
  8. data/lib/vedeu/configuration/api.rb +0 -2
  9. data/lib/vedeu/configuration/cli.rb +0 -2
  10. data/lib/vedeu/configuration/configuration.rb +0 -2
  11. data/lib/vedeu/cursor/cursor.rb +0 -2
  12. data/lib/vedeu/debug.rb +2 -2
  13. data/lib/vedeu/distributed/server.rb +0 -2
  14. data/lib/vedeu/dsl/components/border.rb +15 -19
  15. data/lib/vedeu/dsl/components/geometry.rb +14 -18
  16. data/lib/vedeu/dsl/components/keymap.rb +28 -32
  17. data/lib/vedeu/dsl/composition.rb +27 -9
  18. data/lib/vedeu/events/all.rb +1 -0
  19. data/lib/vedeu/events/event.rb +6 -8
  20. data/lib/vedeu/events/events.rb +10 -0
  21. data/lib/vedeu/events/trigger.rb +6 -12
  22. data/lib/vedeu/geometry/grid.rb +0 -2
  23. data/lib/vedeu/geometry/position.rb +0 -2
  24. data/lib/vedeu/geometry/position_validator.rb +0 -14
  25. data/lib/vedeu/input/input.rb +0 -2
  26. data/lib/vedeu/models/collection.rb +0 -2
  27. data/lib/vedeu/models/focus.rb +0 -1
  28. data/lib/vedeu/models/geometry.rb +7 -3
  29. data/lib/vedeu/models/group.rb +0 -2
  30. data/lib/vedeu/models/menu.rb +23 -29
  31. data/lib/vedeu/models/model.rb +0 -2
  32. data/lib/vedeu/models/view/char.rb +14 -10
  33. data/lib/vedeu/models/view/composition.rb +7 -9
  34. data/lib/vedeu/models/view/interface.rb +0 -1
  35. data/lib/vedeu/models/view/line.rb +2 -3
  36. data/lib/vedeu/models/view/stream.rb +0 -3
  37. data/lib/vedeu/output/all.rb +1 -0
  38. data/lib/vedeu/output/background.rb +0 -2
  39. data/lib/vedeu/output/colour.rb +0 -2
  40. data/lib/vedeu/output/compositor.rb +0 -2
  41. data/lib/vedeu/output/foreground.rb +0 -2
  42. data/lib/vedeu/output/html_renderer.rb +6 -0
  43. data/lib/vedeu/output/index_position.rb +35 -0
  44. data/lib/vedeu/output/output.rb +3 -1
  45. data/lib/vedeu/output/position_index.rb +2 -2
  46. data/lib/vedeu/output/presentation.rb +0 -2
  47. data/lib/vedeu/output/style.rb +0 -1
  48. data/lib/vedeu/output/translator.rb +18 -20
  49. data/lib/vedeu/output/viewport.rb +76 -51
  50. data/lib/vedeu/output/virtual_terminal.rb +2 -1
  51. data/lib/vedeu/repositories/all.rb +4 -4
  52. data/lib/vedeu/repositories/repository.rb +0 -2
  53. data/lib/vedeu/support/coercions.rb +0 -2
  54. data/lib/vedeu/support/common.rb +0 -2
  55. data/lib/vedeu/support/esc.rb +0 -2
  56. data/lib/vedeu/support/log.rb +86 -3
  57. data/lib/vedeu/support/refresh.rb +0 -2
  58. data/lib/vedeu/support/sentence.rb +5 -9
  59. data/lib/vedeu/support/terminal.rb +0 -2
  60. data/lib/vedeu/support/trace.rb +0 -2
  61. data/lib/vedeu/support/visible.rb +1 -1
  62. data/test/lib/vedeu/configuration/api_test.rb +14 -0
  63. data/test/lib/vedeu/configuration/configuration_test.rb +10 -0
  64. data/test/lib/vedeu/distributed/server_test.rb +5 -0
  65. data/test/lib/vedeu/dsl/components/border_test.rb +7 -0
  66. data/test/lib/vedeu/dsl/components/geometry_test.rb +8 -3
  67. data/test/lib/vedeu/dsl/interface_test.rb +5 -0
  68. data/test/lib/vedeu/dsl/line_test.rb +4 -0
  69. data/test/lib/vedeu/dsl/shared/colour_test.rb +7 -7
  70. data/test/lib/vedeu/dsl/shared/style_test.rb +5 -2
  71. data/test/lib/vedeu/dsl/stream_test.rb +4 -1
  72. data/test/lib/vedeu/events/event_test.rb +6 -0
  73. data/test/lib/vedeu/geometry/bounding_area_test.rb +30 -30
  74. data/test/lib/vedeu/geometry/position_test.rb +5 -0
  75. data/test/lib/vedeu/models/view/char_test.rb +1 -14
  76. data/test/lib/vedeu/output/index_position_test.rb +64 -0
  77. data/test/lib/vedeu/output/style_test.rb +4 -0
  78. data/test/lib/vedeu/output/translator_test.rb +4 -0
  79. data/test/lib/vedeu/output/virtual_terminal_test.rb +2 -0
  80. data/test/lib/vedeu/output/wordwrap_test.rb +5 -0
  81. data/test/lib/vedeu/repositories/all_test.rb +3 -3
  82. data/test/lib/vedeu/repositories/repository_test.rb +8 -0
  83. data/test/lib/vedeu/support/console_test.rb +14 -0
  84. data/test/lib/vedeu/support/esc_test.rb +6 -0
  85. data/test/lib/vedeu/support/terminal_test.rb +13 -0
  86. data/vedeu.gemspec +4 -4
  87. metadata +12 -24
  88. data/test/integration/distributed_test.rb +0 -16
  89. data/test/integration/dsl/compositions_test.rb +0 -19
  90. data/test/integration/dsl/interfaces_test.rb +0 -193
  91. data/test/integration/dsl/keymaps_test.rb +0 -30
  92. data/test/integration/dsl/lines_test.rb +0 -104
  93. data/test/integration/dsl/menus_test.rb +0 -59
  94. data/test/integration/dsl/streams_test.rb +0 -103
  95. data/test/integration/dsl/views_test.rb +0 -45
@@ -1,30 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe 'Keymaps' do
4
-
5
- describe '#key' do
6
- subject {
7
- Vedeu.keymap 'keymaps' do
8
- key '' do
9
- end
10
- end
11
- }
12
-
13
- context 'when no value is provided' do
14
-
15
- end
16
- end
17
-
18
- describe '#name' do
19
- subject {
20
- Vedeu.keymap 'keymaps' do
21
- name ''
22
- end
23
- }
24
-
25
- context 'when no value is provided' do
26
-
27
- end
28
- end
29
-
30
- end
@@ -1,104 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe 'Lines' do
4
-
5
- describe '#background' do
6
- subject {
7
- Vedeu.interface 'lines' do
8
- lines do
9
- background ''
10
- end
11
- end
12
- }
13
-
14
- context 'when no value is provided' do
15
-
16
- end
17
- end
18
-
19
- describe '#colour' do
20
- subject {
21
- Vedeu.interface 'lines' do
22
- lines do
23
- colour ''
24
- end
25
- end
26
- }
27
-
28
- context 'when no value is provided' do
29
-
30
- end
31
- end
32
-
33
- describe '#foreground' do
34
- subject {
35
- Vedeu.interface 'lines' do
36
- lines do
37
- foreground ''
38
- end
39
- end
40
- }
41
-
42
- context 'when no value is provided' do
43
-
44
- end
45
- end
46
-
47
- describe '#line' do
48
- subject {
49
- Vedeu.interface 'lines' do
50
- lines do
51
- line ''
52
- end
53
- end
54
- }
55
-
56
- context 'when no value is provided' do
57
-
58
- end
59
- end
60
-
61
- describe '#stream' do
62
- subject {
63
- Vedeu.interface 'lines' do
64
- lines do
65
- stream ''
66
- end
67
- end
68
- }
69
-
70
- context 'when no value is provided' do
71
-
72
- end
73
- end
74
-
75
- describe '#streams' do
76
- subject {
77
- Vedeu.interface 'lines' do
78
- lines do
79
- streams do
80
- end
81
- end
82
- end
83
- }
84
-
85
- context 'when no value is provided' do
86
-
87
- end
88
- end
89
-
90
- describe '#style' do
91
- subject {
92
- Vedeu.interface 'lines' do
93
- lines do
94
- style ''
95
- end
96
- end
97
- }
98
-
99
- context 'when no value is provided' do
100
-
101
- end
102
- end
103
-
104
- end
@@ -1,59 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe 'Menus' do
4
-
5
- describe '#item' do
6
- subject {
7
- Vedeu.menu 'menus' do
8
- item 'hydrogen'
9
- end
10
- }
11
-
12
- it { subject.must_be_instance_of(Vedeu::Menu) }
13
-
14
- it 'allows the use of item within Vedeu.menu' do
15
- subject.collection.must_equal(['hydrogen'])
16
- end
17
-
18
- context 'when no value is provided' do
19
-
20
- end
21
- end
22
-
23
- describe '#items' do
24
- subject {
25
- Vedeu.menu 'menus' do
26
- items ['lithium', 'beryllium']
27
- end
28
- }
29
-
30
- it { subject.must_be_instance_of(Vedeu::Menu) }
31
-
32
- it 'allows the use of item within Vedeu.menu' do
33
- subject.collection.must_equal(['lithium', 'beryllium'])
34
- end
35
-
36
- context 'when no value is provided' do
37
-
38
- end
39
- end
40
-
41
- describe '#name' do
42
- subject {
43
- Vedeu.menu 'menus' do
44
- name 'elements'
45
- end
46
- }
47
-
48
- it { subject.must_be_instance_of(Vedeu::Menu) }
49
-
50
- it 'allows the use of name within Vedeu.menu' do
51
- subject.name.must_equal('elements')
52
- end
53
-
54
- context 'when no value is provided' do
55
-
56
- end
57
- end
58
-
59
- end
@@ -1,103 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe 'Streams' do
4
-
5
- describe '#align' do
6
- subject {
7
- Vedeu.interface 'streams' do
8
- lines do
9
- streams do
10
- align 'Some text...'
11
- end
12
- end
13
- end
14
- }
15
-
16
- context 'when no value is provided' do
17
-
18
- end
19
- end
20
-
21
- describe '#background' do
22
- subject {
23
- Vedeu.interface 'streams' do
24
- lines do
25
- streams do
26
- background ''
27
- end
28
- end
29
- end
30
- }
31
-
32
- context 'when no value is provided' do
33
-
34
- end
35
- end
36
-
37
- describe '#colour' do
38
- subject {
39
- Vedeu.interface 'streams' do
40
- lines do
41
- streams do
42
- colour ''
43
- end
44
- end
45
- end
46
- }
47
-
48
- context 'when no value is provided' do
49
-
50
- end
51
- end
52
-
53
- describe '#foreground' do
54
- subject {
55
- Vedeu.interface 'streams' do
56
- lines do
57
- streams do
58
- foreground ''
59
- end
60
- end
61
- end
62
- }
63
-
64
- context 'when no value is provided' do
65
-
66
- end
67
- end
68
-
69
- describe '#style' do
70
- let(:value) { '' }
71
-
72
- subject {
73
- Vedeu.interface 'lines' do
74
- lines do
75
- streams do
76
- style value
77
- end
78
- end
79
- end
80
- }
81
-
82
- context 'when no value is provided' do
83
- let(:value) {}
84
- end
85
- end
86
-
87
- describe '#text' do
88
- subject {
89
- Vedeu.interface 'streams' do
90
- lines do
91
- streams do
92
- text 'Some text...'
93
- end
94
- end
95
- end
96
- }
97
-
98
- context 'when no value is provided' do
99
-
100
- end
101
- end
102
-
103
- end
@@ -1,45 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe 'Views' do
4
-
5
- describe '.interface' do
6
- subject {
7
- Vedeu.interface 'keymaps' do
8
- # ...
9
- end
10
- }
11
-
12
- context 'when no value is provided' do
13
-
14
- end
15
- end
16
-
17
- describe '.renders' do
18
- subject {
19
- Vedeu.renders do
20
- # ...
21
- end
22
- }
23
-
24
- context 'when no block is given' do
25
- subject { Vedeu.renders }
26
-
27
- it { proc { subject }.must_raise(Vedeu::InvalidSyntax) }
28
- end
29
- end
30
-
31
- describe '.views' do
32
- subject {
33
- Vedeu.views do
34
- # ...
35
- end
36
- }
37
-
38
- context 'when no block is given' do
39
- subject { Vedeu.views }
40
-
41
- it { proc { subject }.must_raise(Vedeu::InvalidSyntax) }
42
- end
43
- end
44
-
45
- end