vedeu 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/examples/material_colours_app.rb +25 -0
  3. data/lib/vedeu/all.rb +0 -1
  4. data/lib/vedeu/colours/colour_translator.rb +6 -6
  5. data/lib/vedeu/cursor/cursor.rb +0 -12
  6. data/lib/vedeu/dsl.rb +23 -0
  7. data/lib/vedeu/dsl/border.rb +0 -10
  8. data/lib/vedeu/dsl/composition.rb +1 -19
  9. data/lib/vedeu/dsl/geometry.rb +0 -10
  10. data/lib/vedeu/dsl/group.rb +0 -10
  11. data/lib/vedeu/dsl/interface.rb +0 -20
  12. data/lib/vedeu/dsl/keymap.rb +0 -10
  13. data/lib/vedeu/dsl/line.rb +3 -21
  14. data/lib/vedeu/dsl/menu.rb +0 -10
  15. data/lib/vedeu/dsl/stream.rb +4 -10
  16. data/lib/vedeu/dsl/view.rb +0 -20
  17. data/lib/vedeu/geometry/geometry.rb +0 -13
  18. data/lib/vedeu/geometry/position.rb +11 -0
  19. data/lib/vedeu/models/escape.rb +0 -7
  20. data/lib/vedeu/models/interface.rb +4 -16
  21. data/lib/vedeu/models/views/all.rb +4 -5
  22. data/lib/vedeu/models/views/char.rb +21 -22
  23. data/lib/vedeu/models/views/{chars.rb → collections/chars.rb} +0 -0
  24. data/lib/vedeu/models/views/{lines.rb → collections/lines.rb} +0 -0
  25. data/lib/vedeu/models/views/{streams.rb → collections/streams.rb} +0 -0
  26. data/lib/vedeu/models/views/{view_collection.rb → collections/view_collection.rb} +0 -0
  27. data/lib/vedeu/models/views/composition.rb +17 -19
  28. data/lib/vedeu/models/views/line.rb +19 -31
  29. data/lib/vedeu/models/views/stream.rb +7 -20
  30. data/lib/vedeu/models/views/view.rb +22 -35
  31. data/lib/vedeu/output/html_char.rb +38 -28
  32. data/lib/vedeu/output/presentation/colour.rb +15 -44
  33. data/lib/vedeu/output/presentation/style.rb +7 -14
  34. data/lib/vedeu/output/viewport.rb +0 -3
  35. data/lib/vedeu/output/virtual_terminal.rb +2 -2
  36. data/lib/vedeu/repositories/repository.rb +0 -7
  37. data/lib/vedeu/version.rb +1 -1
  38. data/test/lib/vedeu/buffers/buffer_test.rb +4 -4
  39. data/test/lib/vedeu/colours/colour_translator_test.rb +14 -0
  40. data/test/lib/vedeu/cursor/cursor_test.rb +0 -9
  41. data/test/lib/vedeu/dsl/line_test.rb +15 -13
  42. data/test/lib/vedeu/geometry/geometry_test.rb +0 -13
  43. data/test/lib/vedeu/geometry/position_test.rb +18 -0
  44. data/test/lib/vedeu/models/escape_test.rb +0 -8
  45. data/test/lib/vedeu/models/interface_test.rb +0 -12
  46. data/test/lib/vedeu/models/views/char_test.rb +4 -23
  47. data/test/lib/vedeu/models/views/{chars_test.rb → collections/chars_test.rb} +0 -0
  48. data/test/lib/vedeu/models/views/{lines_test.rb → collections/lines_test.rb} +0 -0
  49. data/test/lib/vedeu/models/views/{streams_test.rb → collections/streams_test.rb} +0 -0
  50. data/test/lib/vedeu/models/views/collections/view_collection_test.rb +22 -0
  51. data/test/lib/vedeu/models/views/composition_test.rb +23 -17
  52. data/test/lib/vedeu/models/views/line_test.rb +13 -42
  53. data/test/lib/vedeu/models/views/stream_test.rb +4 -33
  54. data/test/lib/vedeu/output/html_char_test.rb +16 -39
  55. data/test/lib/vedeu/output/presentation/colour_test.rb +63 -60
  56. data/test/lib/vedeu/output/presentation/style_test.rb +30 -29
  57. data/test/lib/vedeu/output/presentation_test.rb +1 -1
  58. data/test/lib/vedeu/output/renderers/html_test.rb +4 -8
  59. data/test/lib/vedeu/output/renderers/json_test.rb +37 -3
  60. data/test/lib/vedeu/output/wordwrap_test.rb +4 -4
  61. data/test/lib/vedeu/repositories/repository_test.rb +0 -26
  62. data/test/lib/vedeu/templating/view_template_test.rb +8 -8
  63. metadata +13 -17
  64. data/lib/vedeu/geometry/position_index.rb +0 -68
  65. data/lib/vedeu/models/interface_collection.rb +0 -9
  66. data/test/lib/vedeu/geometry/position_index_test.rb +0 -82
  67. data/test/lib/vedeu/models/interface_collection_test.rb +0 -18
@@ -1,9 +0,0 @@
1
- module Vedeu
2
-
3
- # A collection of {Vedeu::Interface} instances.
4
- #
5
- class InterfaceCollection < Vedeu::Collection
6
-
7
- end # InterfaceCollection
8
-
9
- end # Vedeu
@@ -1,82 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe PositionIndex do
6
-
7
- let(:described) { Vedeu::PositionIndex }
8
- let(:instance) { described.new(y, x) }
9
- let(:y) { 6 }
10
- let(:x) { 17 }
11
-
12
- describe '#initialize' do
13
- it { instance.must_be_instance_of(described) }
14
- it { instance.instance_variable_get('@y').must_equal(y) }
15
- it { instance.instance_variable_get('@x').must_equal(x) }
16
- end
17
-
18
- describe '.[]' do
19
- subject { described[y, x] }
20
-
21
- it { subject.must_be_instance_of(Array) }
22
- it { subject.must_equal([5, 16]) }
23
- end
24
-
25
- describe '#[]' do
26
- subject { instance.[] }
27
-
28
- it { subject.must_be_instance_of(Array) }
29
- it { subject.must_equal([5, 16]) }
30
- end
31
-
32
- describe '#eql?' do
33
- let(:other) { described.new(6, 17) }
34
-
35
- subject { instance.eql?(other) }
36
-
37
- it { subject.must_equal(true) }
38
-
39
- context 'when different to other' do
40
- let(:other) { described.new(2, 9) }
41
-
42
- it { subject.must_equal(false) }
43
- end
44
- end
45
-
46
- describe '#to_position' do
47
- subject { instance.to_position }
48
-
49
- it { subject.must_be_instance_of(Vedeu::Position) }
50
- end
51
-
52
- describe '#y' do
53
- subject { instance.y }
54
-
55
- it { subject.must_equal(5) }
56
-
57
- it { instance.must_respond_to(:first) }
58
-
59
- context 'when y is less than 1' do
60
- let(:y) { -3 }
61
-
62
- it { subject.must_equal(0) }
63
- end
64
- end
65
-
66
- describe '#x' do
67
- subject { instance.x }
68
-
69
- it { subject.must_equal(16) }
70
-
71
- it { instance.must_respond_to(:last) }
72
-
73
- context 'when x is less than 1' do
74
- let(:x) { -9 }
75
-
76
- it { subject.must_equal(0) }
77
- end
78
- end
79
-
80
- end # PositionIndex
81
-
82
- end # Vedeu
@@ -1,18 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe InterfaceCollection do
6
-
7
- let(:described) { Vedeu::InterfaceCollection }
8
- let(:instance) { described.new }
9
-
10
- it { described.superclass.must_equal(Vedeu::Collection) }
11
-
12
- describe '#initialize' do
13
- it { instance.must_be_instance_of(described) }
14
- end
15
-
16
- end # InterfaceCollection
17
-
18
- end # Vedeu