vedeu 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/Rakefile +8 -0
  4. data/bin/vedeu +1 -1
  5. data/config/cucumber.yml +8 -0
  6. data/features/getting_started.feature +10 -0
  7. data/features/step_definitions/vedeu_steps.rb +11 -0
  8. data/features/support/env.rb +12 -0
  9. data/lib/vedeu.rb +30 -9
  10. data/lib/vedeu/application.rb +1 -1
  11. data/lib/vedeu/launcher.rb +26 -0
  12. data/lib/vedeu/output/colour.rb +1 -1
  13. data/lib/vedeu/output/compositor.rb +9 -6
  14. data/lib/vedeu/output/directive.rb +1 -1
  15. data/lib/vedeu/output/geometry.rb +1 -1
  16. data/lib/vedeu/output/position.rb +2 -2
  17. data/lib/vedeu/output/style.rb +1 -1
  18. data/lib/vedeu/output/wordwrap.rb +2 -1
  19. data/lib/vedeu/process/event_loop.rb +2 -2
  20. data/lib/vedeu/process/input.rb +30 -0
  21. data/lib/vedeu/repository/command.rb +32 -0
  22. data/lib/vedeu/repository/command_repository.rb +27 -0
  23. data/lib/vedeu/{process → repository}/dummy_command.rb +2 -2
  24. data/lib/vedeu/repository/dummy_interface.rb +4 -0
  25. data/lib/vedeu/repository/interface.rb +52 -0
  26. data/lib/vedeu/repository/interface_repository.rb +49 -0
  27. data/lib/vedeu/repository/repository.rb +35 -0
  28. data/lib/vedeu/repository/storage.rb +46 -0
  29. data/lib/vedeu/support/terminal.rb +5 -6
  30. data/lib/vedeu/version.rb +1 -1
  31. data/test/lib/vedeu/application_test.rb +1 -1
  32. data/test/lib/vedeu/output/compositor_test.rb +15 -13
  33. data/test/lib/vedeu/output/directive_test.rb +1 -1
  34. data/test/lib/vedeu/output/position_test.rb +1 -1
  35. data/test/lib/vedeu/process/event_loop_test.rb +2 -3
  36. data/test/lib/vedeu/process/input_test.rb +19 -0
  37. data/test/lib/vedeu/repository/command_repository_test.rb +55 -0
  38. data/test/lib/vedeu/repository/command_test.rb +39 -0
  39. data/test/lib/vedeu/repository/interface_repository_test.rb +71 -0
  40. data/test/lib/vedeu/repository/interface_test.rb +65 -0
  41. data/test/lib/vedeu/repository/repository_test.rb +88 -0
  42. data/test/lib/vedeu/repository/storage_test.rb +50 -0
  43. data/test/test_helper.rb +8 -0
  44. data/vedeu.gemspec +3 -0
  45. metadata +75 -21
  46. data/lib/vedeu/interface/dummy_interface.rb +0 -14
  47. data/lib/vedeu/interface/interface.rb +0 -57
  48. data/lib/vedeu/interface/interfaces.rb +0 -66
  49. data/lib/vedeu/process/command.rb +0 -51
  50. data/lib/vedeu/process/commands.rb +0 -35
  51. data/test/lib/vedeu/interface/dummy_test.rb +0 -22
  52. data/test/lib/vedeu/interface/interface_test.rb +0 -45
  53. data/test/lib/vedeu/interface/interfaces_test.rb +0 -108
  54. data/test/lib/vedeu/process/command_test.rb +0 -48
  55. data/test/lib/vedeu/process/commands_test.rb +0 -56
  56. data/test/lib/vedeu/process/dummy_command_test.rb +0 -16
@@ -1,56 +0,0 @@
1
- require_relative '../../../test_helper'
2
-
3
- module Vedeu
4
- describe Commands do
5
- let(:described_class) { Commands }
6
-
7
- describe '.define' do
8
- let(:subject) { described_class.define }
9
-
10
- context 'when a block is given' do
11
- let(:subject) { described_class.define { :nil } }
12
-
13
- it 'yields the block' do
14
- subject.must_be_instance_of(Symbol)
15
- end
16
- end
17
-
18
- context 'when a block is not given' do
19
- it { subject.must_be_instance_of(Module) }
20
- end
21
- end
22
-
23
- describe '.execute' do
24
- let(:subject) { described_class.execute(command) }
25
- let(:command) {}
26
-
27
- context 'when the command does not exist' do
28
- it { subject.must_be_instance_of(NilClass) }
29
- end
30
-
31
- context 'when the command exists' do
32
- let(:command) { "exit" }
33
-
34
- before { Exit.stubs(:dispatch).returns(true) }
35
-
36
- it { subject.must_be_instance_of(TrueClass) }
37
- end
38
- end
39
-
40
- describe '.list' do
41
- let(:subject) { described_class.list }
42
-
43
- it { subject.must_be_instance_of(String) }
44
- end
45
-
46
- describe '.add' do
47
- let(:subject) { described_class.add(command_name, command_klass, args, options) }
48
- let(:command_name) { "some_name" }
49
- let(:command_klass) { DummyCommand }
50
- let(:args) { [] }
51
- let(:options) { {} }
52
-
53
- it { subject.must_be_instance_of(Hash) }
54
- end
55
- end
56
- end
@@ -1,16 +0,0 @@
1
- require_relative '../../../test_helper'
2
-
3
- module Vedeu
4
- describe DummyCommand do
5
- let(:described_class) { DummyCommand }
6
- let(:subject) { described_class.new }
7
-
8
- it { subject.must_be_instance_of(DummyCommand) }
9
-
10
- describe '.dispatch' do
11
- let(:subject) { described_class.dispatch }
12
-
13
- it { subject.must_be_instance_of(String) }
14
- end
15
- end
16
- end