vedeu 0.6.13 → 0.6.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/docs/configuration.md +0 -14
  3. data/lib/vedeu.rb +0 -1
  4. data/lib/vedeu/all.rb +13 -14
  5. data/lib/vedeu/api/internal.rb +2 -2
  6. data/lib/vedeu/bindings/focus.rb +2 -0
  7. data/lib/vedeu/bindings/refresh.rb +2 -0
  8. data/lib/vedeu/bindings/system.rb +2 -0
  9. data/lib/vedeu/configuration/api.rb +0 -2
  10. data/lib/vedeu/configuration/configuration.rb +9 -17
  11. data/lib/vedeu/dsl/dsl.rb +2 -0
  12. data/lib/vedeu/dsl/text.rb +6 -0
  13. data/lib/vedeu/editor/all.rb +1 -1
  14. data/lib/vedeu/editor/{documents.rb → repository.rb} +2 -2
  15. data/lib/vedeu/esc/actions.rb +0 -2
  16. data/lib/vedeu/esc/borders.rb +0 -2
  17. data/lib/vedeu/esc/colours.rb +0 -2
  18. data/lib/vedeu/input/mapper.rb +2 -2
  19. data/lib/vedeu/menus/all.rb +3 -0
  20. data/lib/vedeu/models/all.rb +2 -0
  21. data/lib/vedeu/models/views/all.rb +0 -4
  22. data/lib/vedeu/models/views/char.rb +7 -0
  23. data/lib/vedeu/models/views/line.rb +7 -0
  24. data/lib/vedeu/models/views/stream.rb +7 -0
  25. data/lib/vedeu/models/views/view.rb +7 -0
  26. data/lib/vedeu/null/all.rb +4 -1
  27. data/lib/vedeu/null/interface.rb +0 -2
  28. data/lib/vedeu/null/view.rb +0 -2
  29. data/lib/vedeu/output/output.rb +8 -2
  30. data/lib/vedeu/output/renderers/all.rb +95 -1
  31. data/lib/vedeu/runtime/all.rb +2 -0
  32. data/lib/vedeu/runtime/launcher.rb +1 -9
  33. data/lib/vedeu/version.rb +1 -1
  34. data/test/lib/vedeu/editor/{documents_test.rb → repository_test.rb} +3 -3
  35. data/test/lib/vedeu/models/views/char_test.rb +13 -0
  36. data/test/lib/vedeu/models/views/line_test.rb +16 -3
  37. data/test/lib/vedeu/models/views/stream_test.rb +13 -0
  38. data/test/lib/vedeu/models/views/view_test.rb +13 -0
  39. data/test/lib/vedeu/output/output_test.rb +32 -18
  40. data/test/lib/vedeu/output/{renderers_test.rb → renderers/all_test.rb} +0 -0
  41. data/test/lib/vedeu/output/renderers/file_test.rb +2 -2
  42. metadata +6 -27
  43. data/lib/vedeu/configuration/cli.rb +0 -290
  44. data/lib/vedeu/models/views/collections/chars.rb +0 -14
  45. data/lib/vedeu/models/views/collections/lines.rb +0 -14
  46. data/lib/vedeu/models/views/collections/streams.rb +0 -14
  47. data/lib/vedeu/models/views/collections/view_collection.rb +0 -14
  48. data/lib/vedeu/null/null.rb +0 -11
  49. data/lib/vedeu/output/renderers.rb +0 -92
  50. data/test/lib/vedeu/configuration/cli_test.rb +0 -157
  51. data/test/lib/vedeu/models/views/collections/chars_test.rb +0 -22
  52. data/test/lib/vedeu/models/views/collections/lines_test.rb +0 -22
  53. data/test/lib/vedeu/models/views/collections/streams_test.rb +0 -22
  54. data/test/lib/vedeu/models/views/collections/view_collection_test.rb +0 -22
  55. data/test/lib/vedeu/null/null_test.rb +0 -8
  56. data/test/support/examples/configuration_app.rb +0 -63
@@ -1,157 +0,0 @@
1
- require 'test_helper'
2
-
3
- module YourApp
4
-
5
- class SomeController
6
-
7
- end # SomeController
8
-
9
- end # YourApp
10
-
11
- module Vedeu
12
-
13
- module Config
14
-
15
- describe CLI do
16
-
17
- let(:described) { Vedeu::Config::CLI }
18
- let(:instance) { described.new(args) }
19
- let(:args) { [] }
20
-
21
- after { test_configuration }
22
-
23
- describe '#initialize' do
24
- it { instance.must_be_instance_of(described) }
25
- it { instance.instance_variable_get('@args').must_equal(args) }
26
- it { instance.instance_variable_get('@options').must_equal({}) }
27
- end
28
-
29
- describe '#colour_mode' do
30
- it '--colour-mode' do
31
- Configuration.configure(['--colour-mode', '16777216']) {}
32
- Configuration.colour_mode.must_equal(16_777_216)
33
- end
34
-
35
- it '--colour-mode' do
36
- Configuration.configure(['--colour-mode', '256'])
37
- Configuration.colour_mode.must_equal(256)
38
- end
39
-
40
- it '--colour-mode' do
41
- Configuration.configure(['--colour-mode', '16'])
42
- Configuration.colour_mode.must_equal(16)
43
- end
44
-
45
- it '--colour-mode' do
46
- Configuration.configure(['--colour-mode', '348'])
47
- Configuration.colour_mode.must_equal(8)
48
- end
49
- end
50
-
51
- describe '#debug?' do
52
- it '--debug' do
53
- Configuration.configure(['--debug'])
54
- Configuration.debug?.must_equal(true)
55
- end
56
- end
57
-
58
- describe '#drb' do
59
- it '--drb' do
60
- Configuration.configure(['--drb'])
61
- Configuration.drb?.must_equal(true)
62
- end
63
- end
64
-
65
- describe '#drb_height' do
66
- it '--drb-height' do
67
- Configuration.configure(['--drb-height'])
68
- Configuration.drb_height.must_equal(true)
69
- end
70
- end
71
-
72
- describe '#drb_host' do
73
- it '--drb-host' do
74
- Configuration.configure(['--drb-host'])
75
- Configuration.drb_host.must_equal(true)
76
- end
77
- end
78
-
79
- describe '#drb_port' do
80
- it '--drb-port' do
81
- Configuration.configure(['--drb-port'])
82
- Configuration.drb_port.must_equal(true)
83
- end
84
- end
85
-
86
- describe '#drb_width' do
87
- it '--drb-width' do
88
- Configuration.configure(['--drb-width'])
89
- Configuration.drb_width.must_equal(true)
90
- end
91
- end
92
-
93
- describe '#interactive?' do
94
- it '--interactive' do
95
- Configuration.configure(['--interactive'])
96
- Configuration.interactive?.must_equal(true)
97
- end
98
-
99
- it '--noninteractive' do
100
- Configuration.configure(['--noninteractive'])
101
- Configuration.interactive?.must_equal(false)
102
- end
103
-
104
- it '--standalone' do
105
- Configuration.configure(['--standalone'])
106
- Configuration.interactive?.must_equal(false)
107
- end
108
- end
109
-
110
- describe '#log' do
111
- it '--log' do
112
- Configuration.configure(['--log', '/tmp/vedeu_cli_test.log'])
113
- Configuration.log.must_equal('/tmp/vedeu_cli_test.log')
114
- end
115
- end
116
-
117
- describe '#once?' do
118
- it '--run-once' do
119
- Configuration.configure(['--run-once'])
120
- Configuration.once?.must_equal(true)
121
- end
122
-
123
- it '--run-many' do
124
- Configuration.configure(['--run-many'])
125
- Configuration.once?.must_equal(false)
126
- end
127
- end
128
-
129
- describe '#root' do
130
- it '--root' do
131
- Configuration.configure(['--root', 'YourApp::SomeController.new'])
132
- Configuration.root.must_equal('YourApp::SomeController.new')
133
- end
134
- end
135
-
136
- describe '#terminal_mode' do
137
- it '--cooked' do
138
- Configuration.configure(['--cooked'])
139
- Configuration.terminal_mode.must_equal(:cooked)
140
- end
141
-
142
- it '--fake' do
143
- Configuration.configure(['--fake'])
144
- Configuration.terminal_mode.must_equal(:fake)
145
- end
146
-
147
- it '--raw' do
148
- Configuration.configure(['--raw'])
149
- Configuration.terminal_mode.must_equal(:raw)
150
- end
151
- end
152
-
153
- end # CLI
154
-
155
- end # Config
156
-
157
- end # Vedeu
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Views
6
-
7
- describe Chars do
8
-
9
- let(:described) { Vedeu::Views::Chars }
10
- let(:instance) { described.new }
11
-
12
- it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
13
-
14
- describe '#initialize' do
15
- it { instance.must_be_instance_of(described) }
16
- end
17
-
18
- end # Chars
19
-
20
- end # Views
21
-
22
- end # Vedeu
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Views
6
-
7
- describe Lines do
8
-
9
- let(:described) { Vedeu::Views::Lines }
10
- let(:instance) { described.new }
11
-
12
- it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
13
-
14
- describe '#initialize' do
15
- it { instance.must_be_instance_of(described) }
16
- end
17
-
18
- end # Lines
19
-
20
- end # Views
21
-
22
- end # Vedeu
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Views
6
-
7
- describe Streams do
8
-
9
- let(:described) { Vedeu::Views::Streams }
10
- let(:instance) { described.new }
11
-
12
- it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
13
-
14
- describe '#initialize' do
15
- it { instance.must_be_instance_of(described) }
16
- end
17
-
18
- end # Streams
19
-
20
- end # Views
21
-
22
- end # Vedeu
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Views
6
-
7
- describe ViewCollection do
8
-
9
- let(:described) { Vedeu::Views::ViewCollection }
10
- let(:instance) { described.new }
11
-
12
- it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
13
-
14
- describe '#initialize' do
15
- it { instance.must_be_instance_of(described) }
16
- end
17
-
18
- end # ViewCollection
19
-
20
- end # Views
21
-
22
- end # Vedeu
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe Null do
6
- end # Null
7
-
8
- end # Vedeu
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- lib_dir = File.dirname(__FILE__) + '/../lib'
4
- $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
-
6
- require 'vedeu'
7
-
8
- # This example application shows how configuration works.
9
- #
10
- # If you have cloned this repository from GitHub, you can run this example:
11
- #
12
- # ./examples/configuration_app.rb
13
- #
14
- # First, we use the configuration API to switch debugging on, and set the
15
- # logging to go to a file in the /tmp directory.
16
- #
17
- # By passing the arguments: --log /path/to/log_file.log when executing this
18
- # example, we can demonstrate that the client application configuration is
19
- # overridden by command line arguments.
20
- #
21
- # Use 'space' to refresh, 'q' to exit.
22
- #
23
- class VedeuConfigurationApp
24
-
25
- Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
26
-
27
- Vedeu.configure do
28
- # debug!
29
- log '/tmp/vedeu_configuration_app.log'
30
- end
31
-
32
- Vedeu.interface 'config' do
33
- geometry do
34
- width 40
35
- height 2
36
- centred!
37
- end
38
- end
39
-
40
- Vedeu.renders do
41
- view 'config' do
42
- lines do
43
- line Configuration.log.inspect + ' ' + Process.pid.to_s
44
- end
45
- end
46
- end
47
-
48
- Vedeu.keymap('config') do
49
- key(' ') { Vedeu.trigger(:_refresh_, 'config') }
50
-
51
- key('q') { Vedeu.trigger(:_exit_) }
52
- key(:escape) { Vedeu.trigger(:_mode_switch_) }
53
- key(:shift_tab) { Vedeu.trigger(:_focus_prev_) }
54
- key(:tab) { Vedeu.trigger(:_focus_next_) }
55
- end
56
-
57
- def self.start(argv = ARGV)
58
- Vedeu::Launcher.execute!(argv)
59
- end
60
-
61
- end # VedeuConfigurationApp
62
-
63
- VedeuConfigurationApp.start(ARGV)