vedeu 0.4.57 → 0.4.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/bin/vedeu_drb_server +1 -0
  3. data/examples/drb_app.rb +1 -0
  4. data/lib/vedeu/all.rb +95 -65
  5. data/lib/vedeu/api.rb +0 -45
  6. data/lib/vedeu/application.rb +1 -0
  7. data/lib/vedeu/{bindings/all.rb → bindings.rb} +0 -6
  8. data/lib/vedeu/bindings/system.rb +1 -1
  9. data/lib/vedeu/cli/generator/templates/application/config/configuration.erb +1 -0
  10. data/lib/vedeu/configuration/api.rb +47 -3
  11. data/lib/vedeu/configuration/configuration.rb +6 -7
  12. data/lib/vedeu/distributed/templates/default_configuration.vedeu +1 -0
  13. data/lib/vedeu/{dsl/all.rb → dsl.rb} +0 -16
  14. data/lib/vedeu/dsl/composition.rb +4 -4
  15. data/lib/vedeu/events/event_collection.rb +9 -0
  16. data/lib/vedeu/input/keys.rb +9 -0
  17. data/lib/vedeu/main_loop.rb +2 -2
  18. data/lib/vedeu/models/chars.rb +9 -0
  19. data/lib/vedeu/models/interface_collection.rb +9 -0
  20. data/lib/vedeu/models/lines.rb +9 -0
  21. data/lib/vedeu/models/streams.rb +9 -0
  22. data/lib/vedeu/{null/all.rb → null.rb} +2 -8
  23. data/lib/vedeu/output/{renderers/all.rb → renderers.rb} +0 -0
  24. data/lib/vedeu/{repositories/all.rb → repositories.rb} +9 -0
  25. data/lib/vedeu/repositories/collection.rb +0 -36
  26. data/lib/vedeu/terminal.rb +1 -54
  27. data/lib/vedeu/terminal_mode.rb +57 -0
  28. data/lib/vedeu/version.rb +1 -1
  29. data/test/lib/vedeu/configuration/api_test.rb +24 -0
  30. data/test/lib/vedeu/events/event_collection_test.rb +18 -0
  31. data/test/lib/vedeu/input/keys_test.rb +18 -0
  32. data/test/lib/vedeu/models/chars_test.rb +18 -0
  33. data/test/lib/vedeu/models/interface_collection_test.rb +18 -0
  34. data/test/lib/vedeu/models/lines_test.rb +18 -0
  35. data/test/lib/vedeu/models/streams_test.rb +18 -0
  36. data/test/lib/vedeu/repositories/collection_test.rb +0 -78
  37. data/test/lib/vedeu/terminal_mode_test.rb +72 -0
  38. data/test/lib/vedeu/terminal_test.rb +6 -67
  39. data/test/support/stats.sh +3 -0
  40. metadata +27 -9
  41. data/lib/vedeu/input/all.rb +0 -18
  42. data/test/support/colour_test.sh +0 -100
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe Lines do
6
+
7
+ let(:described) { Vedeu::Lines }
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 # Lines
17
+
18
+ end # Vedeu
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe Streams do
6
+
7
+ let(:described) { Vedeu::Streams }
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 # Streams
17
+
18
+ end # Vedeu
@@ -122,82 +122,4 @@ module Vedeu
122
122
 
123
123
  end # Collection
124
124
 
125
- describe Chars do
126
-
127
- let(:described) { Vedeu::Chars }
128
- let(:instance) { described.new }
129
-
130
- it { described.superclass.must_equal(Vedeu::Collection) }
131
-
132
- describe '#initialize' do
133
- it { instance.must_be_instance_of(described) }
134
- end
135
-
136
- end # Chars
137
-
138
- describe EventCollection do
139
-
140
- let(:described) { Vedeu::EventCollection }
141
- let(:instance) { described.new }
142
-
143
- it { described.superclass.must_equal(Vedeu::Collection) }
144
-
145
- describe '#initialize' do
146
- it { instance.must_be_instance_of(described) }
147
- end
148
-
149
- end # EventCollection
150
-
151
- describe InterfaceCollection do
152
-
153
- let(:described) { Vedeu::InterfaceCollection }
154
- let(:instance) { described.new }
155
-
156
- it { described.superclass.must_equal(Vedeu::Collection) }
157
-
158
- describe '#initialize' do
159
- it { instance.must_be_instance_of(described) }
160
- end
161
-
162
- end # InterfaceCollection
163
-
164
- describe Keys do
165
-
166
- let(:described) { Vedeu::Keys }
167
- let(:instance) { described.new }
168
-
169
- it { described.superclass.must_equal(Vedeu::Collection) }
170
-
171
- describe '#initialize' do
172
- it { instance.must_be_instance_of(described) }
173
- end
174
-
175
- end # Keys
176
-
177
- describe Lines do
178
-
179
- let(:described) { Vedeu::Lines }
180
- let(:instance) { described.new }
181
-
182
- it { described.superclass.must_equal(Vedeu::Collection) }
183
-
184
- describe '#initialize' do
185
- it { instance.must_be_instance_of(described) }
186
- end
187
-
188
- end # Lines
189
-
190
- describe Streams do
191
-
192
- let(:described) { Vedeu::Streams }
193
- let(:instance) { described.new }
194
-
195
- it { described.superclass.must_equal(Vedeu::Collection) }
196
-
197
- describe '#initialize' do
198
- it { instance.must_be_instance_of(described) }
199
- end
200
-
201
- end # Streams
202
-
203
125
  end # Vedeu
@@ -0,0 +1,72 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe TerminalMode do
6
+
7
+ let(:described) { Vedeu::TerminalMode }
8
+
9
+ describe '.raw_mode?' do
10
+ subject { described.raw_mode? }
11
+
12
+ it 'returns true if the terminal is in raw mode' do
13
+ described.raw_mode!
14
+ subject.must_equal(true)
15
+ end
16
+
17
+ it 'returns false if the terminal is not in raw mode' do
18
+ described.cooked_mode!
19
+ subject.must_equal(false)
20
+ end
21
+ end
22
+
23
+ describe '.cooked_mode?' do
24
+ subject { described.cooked_mode? }
25
+
26
+ it 'returns true if the terminal is in cooked mode' do
27
+ described.cooked_mode!
28
+ subject.must_equal(true)
29
+ end
30
+
31
+ it 'returns false if the terminal is not in cooked mode' do
32
+ described.raw_mode!
33
+ subject.must_equal(false)
34
+ end
35
+ end
36
+
37
+ describe '.switch_mode!' do
38
+ subject { described.switch_mode! }
39
+
40
+ it 'returns a Symbol' do
41
+ subject.must_be_instance_of(Symbol)
42
+ end
43
+
44
+ it 'returns :cooked if previously :raw' do
45
+ described.raw_mode!
46
+ subject.must_equal(:cooked)
47
+ end
48
+
49
+ it 'returns :raw if previously :cooked' do
50
+ described.cooked_mode!
51
+ subject.must_equal(:raw)
52
+ end
53
+ end
54
+
55
+ describe '.mode' do
56
+ subject { described.mode }
57
+
58
+ before do
59
+ described.raw_mode!
60
+ Configuration.stubs(:terminal_mode).returns(:raw)
61
+ end
62
+
63
+ it { subject.must_be_instance_of(Symbol) }
64
+
65
+ it 'returns the configured terminal mode' do
66
+ subject.must_equal(:raw)
67
+ end
68
+ end
69
+
70
+ end # TerminalMode
71
+
72
+ end # Vedeu
@@ -5,12 +5,11 @@ module Vedeu
5
5
  describe Terminal do
6
6
 
7
7
  let(:described) { Vedeu::Terminal }
8
-
9
- let(:console) { IO.console }
8
+ let(:console) { IO.console }
10
9
 
11
10
  before do
12
- IO.console.stubs(:winsize).returns([25, 80])
13
- IO.console.stubs(:print)
11
+ console.stubs(:winsize).returns([25, 80])
12
+ console.stubs(:print)
14
13
  end
15
14
 
16
15
  describe '.open' do
@@ -50,7 +49,7 @@ module Vedeu
50
49
 
51
50
  before do
52
51
  Terminal.stubs(:mode).returns(mode)
53
- IO.console.stubs(:gets).returns(input)
52
+ console.stubs(:gets).returns(input)
54
53
  end
55
54
 
56
55
  it { subject.must_equal('Some input') }
@@ -62,9 +61,9 @@ module Vedeu
62
61
 
63
62
  before do
64
63
  Terminal.stubs(:mode).returns(mode)
65
- IO.console.stubs(:getch).returns(input)
64
+ console.stubs(:getch).returns(input)
66
65
  input.stubs(:ord).returns(27)
67
- IO.console.stubs(:read_nonblock)
66
+ console.stubs(:read_nonblock)
68
67
  end
69
68
 
70
69
  it { subject.must_be_instance_of(String) }
@@ -121,66 +120,6 @@ module Vedeu
121
120
  end
122
121
  end
123
122
 
124
- describe '.raw_mode?' do
125
- subject { described.raw_mode? }
126
-
127
- it 'returns true if the terminal is in raw mode' do
128
- described.raw_mode!
129
- subject.must_equal(true)
130
- end
131
-
132
- it 'returns false if the terminal is not in raw mode' do
133
- described.cooked_mode!
134
- subject.must_equal(false)
135
- end
136
- end
137
-
138
- describe '.cooked_mode?' do
139
- subject { described.cooked_mode? }
140
-
141
- it 'returns true if the terminal is in cooked mode' do
142
- described.cooked_mode!
143
- subject.must_equal(true)
144
- end
145
-
146
- it 'returns false if the terminal is not in cooked mode' do
147
- described.raw_mode!
148
- subject.must_equal(false)
149
- end
150
- end
151
-
152
- describe '.switch_mode!' do
153
- subject { described.switch_mode! }
154
-
155
- it 'returns a Symbol' do
156
- subject.must_be_instance_of(Symbol)
157
- end
158
-
159
- it 'returns :cooked if previously :raw' do
160
- described.raw_mode!
161
- subject.must_equal(:cooked)
162
- end
163
-
164
- it 'returns :raw if previously :cooked' do
165
- described.cooked_mode!
166
- subject.must_equal(:raw)
167
- end
168
- end
169
-
170
- describe '.mode' do
171
- subject { described.mode }
172
-
173
- before do
174
- Configuration.stubs(:terminal_mode).returns(:raw)
175
- Terminal.switch_mode! if Terminal.mode == :cooked
176
- end
177
-
178
- it { subject.must_be_instance_of(Symbol) }
179
-
180
- it 'returns the configured terminal mode' do
181
- subject.must_equal(:raw)
182
- end
183
- end
184
123
 
185
124
  describe '.cursor' do
186
125
  subject { described.cursor }
@@ -1,5 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Displays the number of lines of Vedeu application code and the corresponding
4
+ # number of lines of Vedeu test code per commit.
5
+
3
6
  set -e
4
7
 
5
8
  function main {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.57
4
+ version: 0.4.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
@@ -270,7 +270,7 @@ files:
270
270
  - lib/vedeu/application/controller.rb
271
271
  - lib/vedeu/application/helper.rb
272
272
  - lib/vedeu/application/view.rb
273
- - lib/vedeu/bindings/all.rb
273
+ - lib/vedeu/bindings.rb
274
274
  - lib/vedeu/bindings/drb.rb
275
275
  - lib/vedeu/bindings/menus.rb
276
276
  - lib/vedeu/bindings/movement.rb
@@ -336,7 +336,7 @@ files:
336
336
  - lib/vedeu/distributed/templates/default_views.vedeu
337
337
  - lib/vedeu/distributed/test_application.rb
338
338
  - lib/vedeu/distributed/uri.rb
339
- - lib/vedeu/dsl/all.rb
339
+ - lib/vedeu/dsl.rb
340
340
  - lib/vedeu/dsl/border.rb
341
341
  - lib/vedeu/dsl/composition.rb
342
342
  - lib/vedeu/dsl/geometry.rb
@@ -351,6 +351,7 @@ files:
351
351
  - lib/vedeu/dsl/use.rb
352
352
  - lib/vedeu/dsl/view.rb
353
353
  - lib/vedeu/events/event.rb
354
+ - lib/vedeu/events/event_collection.rb
354
355
  - lib/vedeu/events/events.rb
355
356
  - lib/vedeu/events/trigger.rb
356
357
  - lib/vedeu/exceptions.rb
@@ -364,30 +365,34 @@ files:
364
365
  - lib/vedeu/geometry/position.rb
365
366
  - lib/vedeu/geometry/position_index.rb
366
367
  - lib/vedeu/geometry/position_validator.rb
367
- - lib/vedeu/input/all.rb
368
368
  - lib/vedeu/input/input.rb
369
369
  - lib/vedeu/input/key.rb
370
370
  - lib/vedeu/input/keymap.rb
371
371
  - lib/vedeu/input/keymaps.rb
372
+ - lib/vedeu/input/keys.rb
372
373
  - lib/vedeu/input/mapper.rb
373
374
  - lib/vedeu/launcher.rb
374
375
  - lib/vedeu/log.rb
375
376
  - lib/vedeu/main_loop.rb
376
377
  - lib/vedeu/models/cell.rb
377
378
  - lib/vedeu/models/char.rb
379
+ - lib/vedeu/models/chars.rb
378
380
  - lib/vedeu/models/composition.rb
379
381
  - lib/vedeu/models/escape.rb
380
382
  - lib/vedeu/models/focus.rb
381
383
  - lib/vedeu/models/group.rb
382
384
  - lib/vedeu/models/groups.rb
383
385
  - lib/vedeu/models/interface.rb
386
+ - lib/vedeu/models/interface_collection.rb
384
387
  - lib/vedeu/models/interfaces.rb
385
388
  - lib/vedeu/models/line.rb
389
+ - lib/vedeu/models/lines.rb
386
390
  - lib/vedeu/models/menu.rb
387
391
  - lib/vedeu/models/menus.rb
388
392
  - lib/vedeu/models/stream.rb
393
+ - lib/vedeu/models/streams.rb
389
394
  - lib/vedeu/models/toggleable.rb
390
- - lib/vedeu/null/all.rb
395
+ - lib/vedeu/null.rb
391
396
  - lib/vedeu/null/border.rb
392
397
  - lib/vedeu/null/buffer.rb
393
398
  - lib/vedeu/null/generic.rb
@@ -405,7 +410,7 @@ files:
405
410
  - lib/vedeu/output/refresh.rb
406
411
  - lib/vedeu/output/refresh_group.rb
407
412
  - lib/vedeu/output/render_border.rb
408
- - lib/vedeu/output/renderers/all.rb
413
+ - lib/vedeu/output/renderers.rb
409
414
  - lib/vedeu/output/renderers/escape_sequence.rb
410
415
  - lib/vedeu/output/renderers/file.rb
411
416
  - lib/vedeu/output/renderers/html.rb
@@ -421,7 +426,7 @@ files:
421
426
  - lib/vedeu/output/virtual_buffer.rb
422
427
  - lib/vedeu/output/virtual_terminal.rb
423
428
  - lib/vedeu/output/wordwrap.rb
424
- - lib/vedeu/repositories/all.rb
429
+ - lib/vedeu/repositories.rb
425
430
  - lib/vedeu/repositories/collection.rb
426
431
  - lib/vedeu/repositories/model.rb
427
432
  - lib/vedeu/repositories/registerable.rb
@@ -432,6 +437,7 @@ files:
432
437
  - lib/vedeu/templating/preprocessor.rb
433
438
  - lib/vedeu/templating/template.rb
434
439
  - lib/vedeu/terminal.rb
440
+ - lib/vedeu/terminal_mode.rb
435
441
  - lib/vedeu/timer.rb
436
442
  - lib/vedeu/traps.rb
437
443
  - lib/vedeu/version.rb
@@ -490,6 +496,7 @@ files:
490
496
  - test/lib/vedeu/dsl/text_test.rb
491
497
  - test/lib/vedeu/dsl/use_test.rb
492
498
  - test/lib/vedeu/dsl/view_test.rb
499
+ - test/lib/vedeu/events/event_collection_test.rb
493
500
  - test/lib/vedeu/events/event_test.rb
494
501
  - test/lib/vedeu/events/events_test.rb
495
502
  - test/lib/vedeu/events/trigger_test.rb
@@ -508,23 +515,28 @@ files:
508
515
  - test/lib/vedeu/input/key_test.rb
509
516
  - test/lib/vedeu/input/keymap_test.rb
510
517
  - test/lib/vedeu/input/keymaps_test.rb
518
+ - test/lib/vedeu/input/keys_test.rb
511
519
  - test/lib/vedeu/input/mapper_test.rb
512
520
  - test/lib/vedeu/launcher_test.rb
513
521
  - test/lib/vedeu/log_test.rb
514
522
  - test/lib/vedeu/main_loop_test.rb
515
523
  - test/lib/vedeu/models/cell_test.rb
516
524
  - test/lib/vedeu/models/char_test.rb
525
+ - test/lib/vedeu/models/chars_test.rb
517
526
  - test/lib/vedeu/models/composition_test.rb
518
527
  - test/lib/vedeu/models/escape_test.rb
519
528
  - test/lib/vedeu/models/focus_test.rb
520
529
  - test/lib/vedeu/models/group_test.rb
521
530
  - test/lib/vedeu/models/groups_test.rb
531
+ - test/lib/vedeu/models/interface_collection_test.rb
522
532
  - test/lib/vedeu/models/interface_test.rb
523
533
  - test/lib/vedeu/models/interfaces_test.rb
524
534
  - test/lib/vedeu/models/line_test.rb
535
+ - test/lib/vedeu/models/lines_test.rb
525
536
  - test/lib/vedeu/models/menu_test.rb
526
537
  - test/lib/vedeu/models/menus_test.rb
527
538
  - test/lib/vedeu/models/stream_test.rb
539
+ - test/lib/vedeu/models/streams_test.rb
528
540
  - test/lib/vedeu/models/toggleable_test.rb
529
541
  - test/lib/vedeu/null/border_test.rb
530
542
  - test/lib/vedeu/null/buffer_test.rb
@@ -568,12 +580,12 @@ files:
568
580
  - test/lib/vedeu/templating/helpers_test.rb
569
581
  - test/lib/vedeu/templating/preprocessor_test.rb
570
582
  - test/lib/vedeu/templating/template_test.rb
583
+ - test/lib/vedeu/terminal_mode_test.rb
571
584
  - test/lib/vedeu/terminal_test.rb
572
585
  - test/lib/vedeu/timer_test.rb
573
586
  - test/lib/vedeu/traps_test.rb
574
587
  - test/lib/vedeu_test.rb
575
588
  - test/support/all_seeds.sh
576
- - test/support/colour_test.sh
577
589
  - test/support/helpers/model_test_class.rb
578
590
  - test/support/stats.sh
579
591
  - test/support/templates/inline.erb
@@ -660,6 +672,7 @@ test_files:
660
672
  - test/lib/vedeu/dsl/text_test.rb
661
673
  - test/lib/vedeu/dsl/use_test.rb
662
674
  - test/lib/vedeu/dsl/view_test.rb
675
+ - test/lib/vedeu/events/event_collection_test.rb
663
676
  - test/lib/vedeu/events/event_test.rb
664
677
  - test/lib/vedeu/events/events_test.rb
665
678
  - test/lib/vedeu/events/trigger_test.rb
@@ -678,23 +691,28 @@ test_files:
678
691
  - test/lib/vedeu/input/key_test.rb
679
692
  - test/lib/vedeu/input/keymap_test.rb
680
693
  - test/lib/vedeu/input/keymaps_test.rb
694
+ - test/lib/vedeu/input/keys_test.rb
681
695
  - test/lib/vedeu/input/mapper_test.rb
682
696
  - test/lib/vedeu/launcher_test.rb
683
697
  - test/lib/vedeu/log_test.rb
684
698
  - test/lib/vedeu/main_loop_test.rb
685
699
  - test/lib/vedeu/models/cell_test.rb
686
700
  - test/lib/vedeu/models/char_test.rb
701
+ - test/lib/vedeu/models/chars_test.rb
687
702
  - test/lib/vedeu/models/composition_test.rb
688
703
  - test/lib/vedeu/models/escape_test.rb
689
704
  - test/lib/vedeu/models/focus_test.rb
690
705
  - test/lib/vedeu/models/group_test.rb
691
706
  - test/lib/vedeu/models/groups_test.rb
707
+ - test/lib/vedeu/models/interface_collection_test.rb
692
708
  - test/lib/vedeu/models/interface_test.rb
693
709
  - test/lib/vedeu/models/interfaces_test.rb
694
710
  - test/lib/vedeu/models/line_test.rb
711
+ - test/lib/vedeu/models/lines_test.rb
695
712
  - test/lib/vedeu/models/menu_test.rb
696
713
  - test/lib/vedeu/models/menus_test.rb
697
714
  - test/lib/vedeu/models/stream_test.rb
715
+ - test/lib/vedeu/models/streams_test.rb
698
716
  - test/lib/vedeu/models/toggleable_test.rb
699
717
  - test/lib/vedeu/null/border_test.rb
700
718
  - test/lib/vedeu/null/buffer_test.rb
@@ -738,12 +756,12 @@ test_files:
738
756
  - test/lib/vedeu/templating/helpers_test.rb
739
757
  - test/lib/vedeu/templating/preprocessor_test.rb
740
758
  - test/lib/vedeu/templating/template_test.rb
759
+ - test/lib/vedeu/terminal_mode_test.rb
741
760
  - test/lib/vedeu/terminal_test.rb
742
761
  - test/lib/vedeu/timer_test.rb
743
762
  - test/lib/vedeu/traps_test.rb
744
763
  - test/lib/vedeu_test.rb
745
764
  - test/support/all_seeds.sh
746
- - test/support/colour_test.sh
747
765
  - test/support/helpers/model_test_class.rb
748
766
  - test/support/stats.sh
749
767
  - test/support/templates/inline.erb