vedeu 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -4
  3. data/lib/vedeu.rb +1 -0
  4. data/lib/vedeu/models/collection.rb +17 -0
  5. data/lib/vedeu/models/colour.rb +27 -5
  6. data/lib/vedeu/models/line_collection.rb +4 -9
  7. data/lib/vedeu/models/stream.rb +1 -1
  8. data/lib/vedeu/models/stream_collection.rb +4 -9
  9. data/lib/vedeu/support/coordinate.rb +149 -0
  10. data/lib/vedeu/support/esc.rb +4 -0
  11. data/lib/vedeu/support/menu.rb +103 -0
  12. data/lib/vedeu/support/terminal.rb +4 -0
  13. data/test/example_app/lib/app.rb +25 -6
  14. data/test/lib/vedeu/models/collection_test.rb +50 -0
  15. data/test/lib/vedeu/models/colour_test.rb +58 -1
  16. data/test/lib/vedeu/models/command_test.rb +2 -1
  17. data/test/lib/vedeu/models/interface_collection_test.rb +4 -3
  18. data/test/lib/vedeu/models/line_test.rb +3 -1
  19. data/test/lib/vedeu/models/stream_test.rb +6 -3
  20. data/test/lib/vedeu/output/text_adaptor_test.rb +1 -1
  21. data/test/lib/vedeu/repository/command_repository_test.rb +2 -1
  22. data/test/lib/vedeu/repository/interface_repository_test.rb +2 -1
  23. data/test/lib/vedeu/repository/repository_test.rb +2 -1
  24. data/test/lib/vedeu/repository/storage_test.rb +6 -3
  25. data/test/lib/vedeu/support/coordinate_test.rb +363 -0
  26. data/test/lib/vedeu/support/esc_test.rb +8 -0
  27. data/test/lib/vedeu/support/menu_test.rb +202 -0
  28. data/test/lib/vedeu/support/parser_test.rb +2 -1
  29. data/test/lib/vedeu/support/parsing/hash_parser_test.rb +6 -3
  30. data/test/lib/vedeu/support/parsing/json_parser_test.rb +2 -1
  31. data/test/lib/vedeu/support/terminal_test.rb +9 -0
  32. data/test/lib/vedeu/support/translator_test.rb +2 -1
  33. data/test/test_helper.rb +12 -0
  34. data/vedeu.gemspec +1 -1
  35. metadata +11 -8
  36. data/lib/vedeu/models/background.rb +0 -13
  37. data/lib/vedeu/models/foreground.rb +0 -13
  38. data/test/lib/vedeu/models/background_test.rb +0 -19
  39. data/test/lib/vedeu/models/foreground_test.rb +0 -18
@@ -1,19 +0,0 @@
1
- require_relative '../../../test_helper'
2
- require_relative '../../../../lib/vedeu/models/background'
3
- require_relative '../../../../lib/vedeu/models/colour'
4
-
5
- module Vedeu
6
- describe Background do
7
- describe '#background' do
8
- it 'returns an escape sequence' do
9
- Colour.new({
10
- background: '#00ff00'
11
- }).background.must_equal("\e[48;5;46m")
12
- end
13
-
14
- it 'returns an empty string when the foreground is missing' do
15
- Colour.new.background.must_equal('')
16
- end
17
- end
18
- end
19
- end
@@ -1,18 +0,0 @@
1
- require_relative '../../../test_helper'
2
- require_relative '../../../../lib/vedeu/models/foreground'
3
- require_relative '../../../../lib/vedeu/models/colour'
4
-
5
- module Vedeu
6
- describe Foreground do
7
- describe '#foreground' do
8
- it 'returns an escape sequence' do
9
- Colour.new({ foreground: '#ff0000' }).foreground
10
- .must_equal("\e[38;5;196m")
11
- end
12
-
13
- it 'returns an empty string when the foreground is missing' do
14
- Colour.new.foreground.must_equal('')
15
- end
16
- end
17
- end
18
- end