vedeu 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +2 -1
  3. data/bin/vedeu +1 -4
  4. data/lib/vedeu/all.rb +8 -12
  5. data/lib/vedeu/bindings/drb.rb +2 -2
  6. data/lib/vedeu/bindings/system.rb +11 -7
  7. data/lib/vedeu/{output/virtual_terminal.rb → buffers/virtual_buffer.rb} +15 -8
  8. data/lib/vedeu/{output/virtual_buffer.rb → buffers/virtual_buffers.rb} +4 -4
  9. data/lib/vedeu/cursor/cursor.rb +2 -6
  10. data/lib/vedeu/cursor/reposition.rb +11 -6
  11. data/lib/vedeu/esc/esc.rb +4 -0
  12. data/lib/vedeu/models/views/view.rb +1 -1
  13. data/lib/vedeu/output/output.rb +1 -1
  14. data/lib/vedeu/plugins.rb +7 -3
  15. data/lib/vedeu/plugins/plugin.rb +4 -4
  16. data/lib/vedeu/refresh/refresh.rb +31 -0
  17. data/lib/vedeu/refresh/refresh_buffer.rb +53 -0
  18. data/lib/vedeu/{cursor → refresh}/refresh_cursor.rb +4 -4
  19. data/lib/vedeu/refresh/refresh_group.rb +59 -0
  20. data/lib/vedeu/terminal.rb +2 -2
  21. data/lib/vedeu/version.rb +1 -1
  22. data/test/lib/vedeu/{output/virtual_terminal_test.rb → buffers/virtual_buffer_test.rb} +16 -12
  23. data/test/lib/vedeu/{output/virtual_buffer_test.rb → buffers/virtual_buffers_test.rb} +3 -3
  24. data/test/lib/vedeu/cursor/cursors_test.rb +2 -0
  25. data/test/lib/vedeu/distributed/client_test.rb +13 -9
  26. data/test/lib/vedeu/distributed/server_test.rb +5 -0
  27. data/test/lib/vedeu/distributed/subprocess_test.rb +12 -1
  28. data/test/lib/vedeu/models/views/view_test.rb +41 -0
  29. data/test/lib/vedeu/output/output_test.rb +1 -1
  30. data/test/lib/vedeu/output/renderers/html_test.rb +1 -1
  31. data/test/lib/vedeu/output/viewport_test.rb +15 -16
  32. data/test/lib/vedeu/plugins_test.rb +7 -0
  33. data/test/lib/vedeu/refresh/refresh_buffer_test.rb +50 -0
  34. data/test/lib/vedeu/{cursor → refresh}/refresh_cursor_test.rb +8 -6
  35. data/test/lib/vedeu/{output → refresh}/refresh_group_test.rb +4 -2
  36. data/test/lib/vedeu/refresh/refresh_test.rb +44 -0
  37. data/test/test_helper.rb +1 -1
  38. data/vedeu.gemspec +3 -3
  39. metadata +24 -55
  40. data/lib/vedeu/cli/generator/all.rb +0 -9
  41. data/lib/vedeu/cli/generator/application.rb +0 -133
  42. data/lib/vedeu/cli/generator/helpers.rb +0 -139
  43. data/lib/vedeu/cli/generator/templates/application/.gitignore +0 -1
  44. data/lib/vedeu/cli/generator/templates/application/.ruby-version +0 -1
  45. data/lib/vedeu/cli/generator/templates/application/Gemfile +0 -4
  46. data/lib/vedeu/cli/generator/templates/application/LICENSE.txt +0 -24
  47. data/lib/vedeu/cli/generator/templates/application/README.md +0 -18
  48. data/lib/vedeu/cli/generator/templates/application/app/controllers/application_controller.erb +0 -7
  49. data/lib/vedeu/cli/generator/templates/application/app/controllers/name.erb +0 -22
  50. data/lib/vedeu/cli/generator/templates/application/app/helpers/application_helper.erb +0 -9
  51. data/lib/vedeu/cli/generator/templates/application/app/helpers/name.erb +0 -11
  52. data/lib/vedeu/cli/generator/templates/application/app/models/keymaps/_global_.rb +0 -8
  53. data/lib/vedeu/cli/generator/templates/application/app/models/keymaps/name.erb +0 -3
  54. data/lib/vedeu/cli/generator/templates/application/app/views/interfaces/name.erb +0 -67
  55. data/lib/vedeu/cli/generator/templates/application/app/views/name.erb +0 -36
  56. data/lib/vedeu/cli/generator/templates/application/app/views/templates/name.erb +0 -0
  57. data/lib/vedeu/cli/generator/templates/application/application.erb +0 -22
  58. data/lib/vedeu/cli/generator/templates/application/bin/name +0 -9
  59. data/lib/vedeu/cli/generator/templates/application/config/app_name.erb +0 -1
  60. data/lib/vedeu/cli/generator/templates/application/config/configuration.erb +0 -33
  61. data/lib/vedeu/cli/generator/templates/application/lib/.gitkeep +0 -0
  62. data/lib/vedeu/cli/generator/templates/application/test/.gitkeep +0 -0
  63. data/lib/vedeu/cli/generator/templates/application/vendor/.gitkeep +0 -0
  64. data/lib/vedeu/cli/generator/view.rb +0 -86
  65. data/lib/vedeu/cli/main.rb +0 -39
  66. data/lib/vedeu/output/refresh.rb +0 -69
  67. data/lib/vedeu/output/refresh_group.rb +0 -41
  68. data/test/lib/vedeu/cli/generator/application_test.rb +0 -37
  69. data/test/lib/vedeu/cli/generator/helpers_test.rb +0 -197
  70. data/test/lib/vedeu/cli/generator/view_test.rb +0 -38
  71. data/test/lib/vedeu/cli/main_test.rb +0 -59
  72. data/test/lib/vedeu/output/refresh_test.rb +0 -63
@@ -0,0 +1,50 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe RefreshBuffer do
6
+
7
+ let(:described) { Vedeu::RefreshBuffer }
8
+ let(:instance) { described.new(_name) }
9
+ let(:_name) { 'Vedeu::RefreshBuffer' }
10
+
11
+ describe '#initialize' do
12
+ it { instance.must_be_instance_of(described) }
13
+ it { instance.instance_variable_get('@name').must_equal(_name) }
14
+ end
15
+
16
+ describe '.by_name' do
17
+ subject { described.by_name(_name) }
18
+
19
+ context 'when the name is not present' do
20
+ let(:_name) { '' }
21
+
22
+ it { proc { subject }.must_raise(Vedeu::MissingRequired) }
23
+ end
24
+
25
+ # describe '.by_name' do
26
+ # let(:_name) { 'aluminium' }
27
+ # let(:buffer) { Vedeu::Null::Buffer.new(name: _name) }
28
+
29
+ # subject { described.by_name(_name) }
30
+
31
+ # it {
32
+ # Vedeu.buffers.expects(:by_name).with(_name).returns(buffer)
33
+ # buffer.expects(:render)
34
+ # subject
35
+ # }
36
+ # end
37
+
38
+ context 'when the name is present' do
39
+ # @todo Add more tests.
40
+ # it { skip }
41
+ end
42
+ end
43
+
44
+ describe '#by_name' do
45
+ it { instance.must_respond_to(:by_name) }
46
+ end
47
+
48
+ end # RefreshBuffer
49
+
50
+ end # Vedeu
@@ -16,7 +16,7 @@ module Vedeu
16
16
  it { instance.instance_variable_get('@name').must_equal(_name) }
17
17
  end
18
18
 
19
- describe '.render' do
19
+ describe '.by_name' do
20
20
  before do
21
21
  Vedeu.geometry 'refresh_cursor' do
22
22
  x 1
@@ -27,9 +27,11 @@ module Vedeu
27
27
  Vedeu::Cursor.new(name: 'refresh_cursor', ox: ox, oy: oy).store
28
28
 
29
29
  Vedeu::Terminal.stubs(:output).returns(expected)
30
+
31
+ Vedeu.stubs(:trigger)
30
32
  end
31
33
 
32
- subject { described.render(_name) }
34
+ subject { described.by_name(_name) }
33
35
 
34
36
  it 'renders the cursor in the terminal' do
35
37
  Vedeu::Terminal.expects(:output).with("\e[1;1H\e[?25l")
@@ -41,21 +43,21 @@ module Vedeu
41
43
  let(:oy) { 3 }
42
44
 
43
45
  it 'refreshes the view' do
44
- Vedeu::Refresh.expects(:by_name)
46
+ Vedeu.expects(:trigger).with(:_refresh_, _name)
45
47
  subject
46
48
  end
47
49
  end
48
50
 
49
51
  context 'when the cursors offset position is inside the viewable area' do
50
52
  it 'does not refresh the view' do
51
- Vedeu::Refresh.expects(:by_name).never
53
+ Vedeu.expects(:trigger).with(:_refresh_, _name).never
52
54
  subject
53
55
  end
54
56
  end
55
57
  end
56
58
 
57
- describe '#render' do
58
- it { instance.must_respond_to(:render) }
59
+ describe '#by_name' do
60
+ it { instance.must_respond_to(:by_name) }
59
61
  end
60
62
 
61
63
  end # RefreshCursor
@@ -23,8 +23,10 @@ module Vedeu
23
23
  end
24
24
 
25
25
  context 'when the name is present' do
26
- # @todo Add more tests.
27
- # it { skip }
26
+ it {
27
+ Vedeu::RefreshGroup.expects(:by_name).with(_name)
28
+ subject
29
+ }
28
30
  end
29
31
  end
30
32
 
@@ -0,0 +1,44 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe Refresh do
6
+
7
+ let(:described) { Vedeu::Refresh }
8
+ let(:instance) { described.new }
9
+
10
+ describe '.all' do
11
+ before { Vedeu.stubs(:trigger) }
12
+
13
+ subject { described.all }
14
+
15
+ it { subject.must_be_instance_of(Array) }
16
+
17
+ context 'when there are no registered interfaces' do
18
+ before { Vedeu.interfaces.reset }
19
+
20
+ it { subject.must_equal([]) }
21
+ end
22
+
23
+ context 'when there are registered interfaces' do
24
+ let(:interface) { Vedeu::Interface.new(name: 'Vedeu::Refresh') }
25
+ let(:interfaces) { [interface] }
26
+
27
+ before { Vedeu.interfaces.stubs(:zindexed).returns(interfaces) }
28
+
29
+ it {
30
+ Vedeu.expects(:trigger).with(:_refresh_, 'Vedeu::Refresh')
31
+ subject
32
+ }
33
+
34
+ it { subject.must_equal([interface]) }
35
+ end
36
+ end
37
+
38
+ describe '#all' do
39
+ it { instance.must_respond_to(:all) }
40
+ end
41
+
42
+ end # Refresh
43
+
44
+ end # Vedeu
@@ -20,7 +20,6 @@ unless ENV['NO_SIMPLECOV']
20
20
  add_group 'bindings', 'vedeu/bindings'
21
21
  add_group 'borders', 'vedeu/borders'
22
22
  add_group 'buffers', 'vedeu/buffers'
23
- add_group 'cli', 'vedeu/cli'
24
23
  add_group 'colours', 'vedeu/colours'
25
24
  add_group 'configuration', 'vedeu/configuration'
26
25
  add_group 'cursor', 'vedeu/cursor'
@@ -35,6 +34,7 @@ unless ENV['NO_SIMPLECOV']
35
34
  add_group 'null', 'vedeu/null'
36
35
  add_group 'output', 'vedeu/output'
37
36
  add_group 'plugins', 'vedeu/plygins'
37
+ add_group 'refresh', 'vedeu/refresh'
38
38
  add_group 'repositories', 'vedeu/repositories'
39
39
  add_group 'runtime', 'vedeu/runtime'
40
40
  add_group 'templating', 'vedeu/templating'
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'simplecov-console', '0.2.0'
33
33
  spec.add_development_dependency 'yard', '0.8.7.6'
34
34
 
35
- spec.add_dependency 'bundler', '~> 1.10'
36
- spec.add_dependency 'rake', '~> 10.4'
37
- spec.add_dependency 'thor', '0.19.1'
35
+ spec.add_dependency 'bundler', '~> 1.10'
36
+ spec.add_dependency 'rake', '~> 10.4'
37
+ spec.add_dependency 'vedeu_cli', '0.0.4'
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -193,19 +193,19 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '10.4'
195
195
  - !ruby/object:Gem::Dependency
196
- name: thor
196
+ name: vedeu_cli
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - '='
200
200
  - !ruby/object:Gem::Version
201
- version: 0.19.1
201
+ version: 0.0.4
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
- version: 0.19.1
208
+ version: 0.0.4
209
209
  description: A framework for building GUI/TUI terminal/console applications.
210
210
  email:
211
211
  - gavinlaking@gmail.com
@@ -276,32 +276,8 @@ files:
276
276
  - lib/vedeu/borders/render_border.rb
277
277
  - lib/vedeu/buffers/buffer.rb
278
278
  - lib/vedeu/buffers/buffers.rb
279
- - lib/vedeu/cli/generator/all.rb
280
- - lib/vedeu/cli/generator/application.rb
281
- - lib/vedeu/cli/generator/helpers.rb
282
- - lib/vedeu/cli/generator/templates/application/.gitignore
283
- - lib/vedeu/cli/generator/templates/application/.ruby-version
284
- - lib/vedeu/cli/generator/templates/application/Gemfile
285
- - lib/vedeu/cli/generator/templates/application/LICENSE.txt
286
- - lib/vedeu/cli/generator/templates/application/README.md
287
- - lib/vedeu/cli/generator/templates/application/app/controllers/application_controller.erb
288
- - lib/vedeu/cli/generator/templates/application/app/controllers/name.erb
289
- - lib/vedeu/cli/generator/templates/application/app/helpers/application_helper.erb
290
- - lib/vedeu/cli/generator/templates/application/app/helpers/name.erb
291
- - lib/vedeu/cli/generator/templates/application/app/models/keymaps/_global_.rb
292
- - lib/vedeu/cli/generator/templates/application/app/models/keymaps/name.erb
293
- - lib/vedeu/cli/generator/templates/application/app/views/interfaces/name.erb
294
- - lib/vedeu/cli/generator/templates/application/app/views/name.erb
295
- - lib/vedeu/cli/generator/templates/application/app/views/templates/name.erb
296
- - lib/vedeu/cli/generator/templates/application/application.erb
297
- - lib/vedeu/cli/generator/templates/application/bin/name
298
- - lib/vedeu/cli/generator/templates/application/config/app_name.erb
299
- - lib/vedeu/cli/generator/templates/application/config/configuration.erb
300
- - lib/vedeu/cli/generator/templates/application/lib/.gitkeep
301
- - lib/vedeu/cli/generator/templates/application/test/.gitkeep
302
- - lib/vedeu/cli/generator/templates/application/vendor/.gitkeep
303
- - lib/vedeu/cli/generator/view.rb
304
- - lib/vedeu/cli/main.rb
279
+ - lib/vedeu/buffers/virtual_buffer.rb
280
+ - lib/vedeu/buffers/virtual_buffers.rb
305
281
  - lib/vedeu/colours/background.rb
306
282
  - lib/vedeu/colours/backgrounds.rb
307
283
  - lib/vedeu/colours/colour.rb
@@ -316,7 +292,6 @@ files:
316
292
  - lib/vedeu/cursor/cursor.rb
317
293
  - lib/vedeu/cursor/cursors.rb
318
294
  - lib/vedeu/cursor/move.rb
319
- - lib/vedeu/cursor/refresh_cursor.rb
320
295
  - lib/vedeu/cursor/reposition.rb
321
296
  - lib/vedeu/distributed/client.rb
322
297
  - lib/vedeu/distributed/server.rb
@@ -410,8 +385,6 @@ files:
410
385
  - lib/vedeu/output/presentation.rb
411
386
  - lib/vedeu/output/presentation/colour.rb
412
387
  - lib/vedeu/output/presentation/style.rb
413
- - lib/vedeu/output/refresh.rb
414
- - lib/vedeu/output/refresh_group.rb
415
388
  - lib/vedeu/output/renderers.rb
416
389
  - lib/vedeu/output/renderers/escape_sequence.rb
417
390
  - lib/vedeu/output/renderers/file.rb
@@ -425,11 +398,13 @@ files:
425
398
  - lib/vedeu/output/templates/html_renderer.vedeu
426
399
  - lib/vedeu/output/text.rb
427
400
  - lib/vedeu/output/viewport.rb
428
- - lib/vedeu/output/virtual_buffer.rb
429
- - lib/vedeu/output/virtual_terminal.rb
430
401
  - lib/vedeu/output/wordwrap.rb
431
402
  - lib/vedeu/plugins.rb
432
403
  - lib/vedeu/plugins/plugin.rb
404
+ - lib/vedeu/refresh/refresh.rb
405
+ - lib/vedeu/refresh/refresh_buffer.rb
406
+ - lib/vedeu/refresh/refresh_cursor.rb
407
+ - lib/vedeu/refresh/refresh_group.rb
433
408
  - lib/vedeu/repositories.rb
434
409
  - lib/vedeu/repositories/collection.rb
435
410
  - lib/vedeu/repositories/model.rb
@@ -471,10 +446,8 @@ files:
471
446
  - test/lib/vedeu/borders/render_border_test.rb
472
447
  - test/lib/vedeu/buffers/buffer_test.rb
473
448
  - test/lib/vedeu/buffers/buffers_test.rb
474
- - test/lib/vedeu/cli/generator/application_test.rb
475
- - test/lib/vedeu/cli/generator/helpers_test.rb
476
- - test/lib/vedeu/cli/generator/view_test.rb
477
- - test/lib/vedeu/cli/main_test.rb
449
+ - test/lib/vedeu/buffers/virtual_buffer_test.rb
450
+ - test/lib/vedeu/buffers/virtual_buffers_test.rb
478
451
  - test/lib/vedeu/colours/background_test.rb
479
452
  - test/lib/vedeu/colours/backgrounds_test.rb
480
453
  - test/lib/vedeu/colours/colour_test.rb
@@ -489,7 +462,6 @@ files:
489
462
  - test/lib/vedeu/cursor/cursor_test.rb
490
463
  - test/lib/vedeu/cursor/cursors_test.rb
491
464
  - test/lib/vedeu/cursor/move_test.rb
492
- - test/lib/vedeu/cursor/refresh_cursor_test.rb
493
465
  - test/lib/vedeu/cursor/reposition_test.rb
494
466
  - test/lib/vedeu/distributed/client_test.rb
495
467
  - test/lib/vedeu/distributed/server_test.rb
@@ -570,8 +542,6 @@ files:
570
542
  - test/lib/vedeu/output/presentation/colour_test.rb
571
543
  - test/lib/vedeu/output/presentation/style_test.rb
572
544
  - test/lib/vedeu/output/presentation_test.rb
573
- - test/lib/vedeu/output/refresh_group_test.rb
574
- - test/lib/vedeu/output/refresh_test.rb
575
545
  - test/lib/vedeu/output/renderers/escape_sequence_test.rb
576
546
  - test/lib/vedeu/output/renderers/file_test.rb
577
547
  - test/lib/vedeu/output/renderers/html_test.rb
@@ -584,11 +554,13 @@ files:
584
554
  - test/lib/vedeu/output/style_test.rb
585
555
  - test/lib/vedeu/output/text_test.rb
586
556
  - test/lib/vedeu/output/viewport_test.rb
587
- - test/lib/vedeu/output/virtual_buffer_test.rb
588
- - test/lib/vedeu/output/virtual_terminal_test.rb
589
557
  - test/lib/vedeu/output/wordwrap_test.rb
590
558
  - test/lib/vedeu/plugins/plugin_test.rb
591
559
  - test/lib/vedeu/plugins_test.rb
560
+ - test/lib/vedeu/refresh/refresh_buffer_test.rb
561
+ - test/lib/vedeu/refresh/refresh_cursor_test.rb
562
+ - test/lib/vedeu/refresh/refresh_group_test.rb
563
+ - test/lib/vedeu/refresh/refresh_test.rb
592
564
  - test/lib/vedeu/repositories/collection_test.rb
593
565
  - test/lib/vedeu/repositories/model_test.rb
594
566
  - test/lib/vedeu/repositories/registerable_test.rb
@@ -636,7 +608,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
636
608
  version: '0'
637
609
  requirements: []
638
610
  rubyforge_project:
639
- rubygems_version: 2.4.5
611
+ rubygems_version: 2.4.8
640
612
  signing_key:
641
613
  specification_version: 4
642
614
  summary: A terminal case of wonderland.
@@ -660,10 +632,8 @@ test_files:
660
632
  - test/lib/vedeu/borders/render_border_test.rb
661
633
  - test/lib/vedeu/buffers/buffer_test.rb
662
634
  - test/lib/vedeu/buffers/buffers_test.rb
663
- - test/lib/vedeu/cli/generator/application_test.rb
664
- - test/lib/vedeu/cli/generator/helpers_test.rb
665
- - test/lib/vedeu/cli/generator/view_test.rb
666
- - test/lib/vedeu/cli/main_test.rb
635
+ - test/lib/vedeu/buffers/virtual_buffer_test.rb
636
+ - test/lib/vedeu/buffers/virtual_buffers_test.rb
667
637
  - test/lib/vedeu/colours/background_test.rb
668
638
  - test/lib/vedeu/colours/backgrounds_test.rb
669
639
  - test/lib/vedeu/colours/colour_test.rb
@@ -678,7 +648,6 @@ test_files:
678
648
  - test/lib/vedeu/cursor/cursor_test.rb
679
649
  - test/lib/vedeu/cursor/cursors_test.rb
680
650
  - test/lib/vedeu/cursor/move_test.rb
681
- - test/lib/vedeu/cursor/refresh_cursor_test.rb
682
651
  - test/lib/vedeu/cursor/reposition_test.rb
683
652
  - test/lib/vedeu/distributed/client_test.rb
684
653
  - test/lib/vedeu/distributed/server_test.rb
@@ -759,8 +728,6 @@ test_files:
759
728
  - test/lib/vedeu/output/presentation/colour_test.rb
760
729
  - test/lib/vedeu/output/presentation/style_test.rb
761
730
  - test/lib/vedeu/output/presentation_test.rb
762
- - test/lib/vedeu/output/refresh_group_test.rb
763
- - test/lib/vedeu/output/refresh_test.rb
764
731
  - test/lib/vedeu/output/renderers/escape_sequence_test.rb
765
732
  - test/lib/vedeu/output/renderers/file_test.rb
766
733
  - test/lib/vedeu/output/renderers/html_test.rb
@@ -773,11 +740,13 @@ test_files:
773
740
  - test/lib/vedeu/output/style_test.rb
774
741
  - test/lib/vedeu/output/text_test.rb
775
742
  - test/lib/vedeu/output/viewport_test.rb
776
- - test/lib/vedeu/output/virtual_buffer_test.rb
777
- - test/lib/vedeu/output/virtual_terminal_test.rb
778
743
  - test/lib/vedeu/output/wordwrap_test.rb
779
744
  - test/lib/vedeu/plugins/plugin_test.rb
780
745
  - test/lib/vedeu/plugins_test.rb
746
+ - test/lib/vedeu/refresh/refresh_buffer_test.rb
747
+ - test/lib/vedeu/refresh/refresh_cursor_test.rb
748
+ - test/lib/vedeu/refresh/refresh_group_test.rb
749
+ - test/lib/vedeu/refresh/refresh_test.rb
781
750
  - test/lib/vedeu/repositories/collection_test.rb
782
751
  - test/lib/vedeu/repositories/model_test.rb
783
752
  - test/lib/vedeu/repositories/registerable_test.rb
@@ -1,9 +0,0 @@
1
- module Vedeu
2
-
3
- # Provides helper classes for the various rake tasks.
4
- #
5
- module Generator
6
-
7
- end # Generator
8
-
9
- end # Vedeu
@@ -1,133 +0,0 @@
1
- module Vedeu
2
-
3
- module Generator
4
-
5
- # Generates the client application directory and file structure.
6
- #
7
- # @example
8
- # ```bash
9
- # vedeu new your_app_name_here
10
- # ```
11
- #
12
- # :nocov:
13
- class Application
14
-
15
- include Vedeu::Generator::Helpers
16
-
17
- # @param name [String] The name of the application.
18
- # @return [Vedeu::Generator::Application]
19
- def self.generate(name)
20
- new(name).generate
21
- end
22
-
23
- # Returns a new instance of Vedeu::Generator::Application.
24
- #
25
- # @param name [String] The name of the application.
26
- # @return [Vedeu::Generator::Application]
27
- def initialize(name)
28
- @name = name
29
- end
30
-
31
- # @return [void]
32
- def generate
33
- make_directory_structure
34
-
35
- copy_app_root_files
36
- copy_application_bootstrapper
37
- copy_application_controller
38
- copy_application_helper
39
- copy_global_keymap
40
- copy_application_executable
41
- make_application_executable
42
- copy_configuration
43
- copy_app_name
44
- end
45
-
46
- private
47
-
48
- # @return [void]
49
- def make_directory_structure
50
- directories.each { |directory| make_directory(name + directory) }
51
- end
52
-
53
- # @return [void]
54
- def copy_application_bootstrapper
55
- make_file(source + '/application.erb',
56
- app_root_path + '/application.rb')
57
- end
58
-
59
- # @return [void]
60
- def copy_application_controller
61
- make_file(source + '/app/controllers/application_controller.erb',
62
- app_controllers_path + 'application_controller.rb')
63
- end
64
-
65
- # @return [void]
66
- def copy_application_executable
67
- copy_file(source + '/bin/name', app_bin_path + "#{name}")
68
- end
69
-
70
- # @return [void]
71
- def copy_application_helper
72
- make_file(source + '/app/helpers/application_helper.erb',
73
- app_helpers_path + 'application_helper.rb')
74
- end
75
-
76
- # @return [void]
77
- def copy_configuration
78
- make_file(source + '/config/configuration.erb',
79
- app_config_path + 'configuration.rb')
80
- end
81
-
82
- # @return [void]
83
- def copy_app_name
84
- make_file(source + '/config/app_name.erb',
85
- app_config_path + 'app_name')
86
- end
87
-
88
- # @return [void]
89
- def copy_app_root_files
90
- [
91
- '/Gemfile',
92
- '/.gitignore',
93
- '/LICENSE.txt',
94
- '/README.md',
95
- '/.ruby-version',
96
- ].each do |file|
97
- copy_file((source + file), (app_root_path + file))
98
- end
99
- end
100
-
101
- # @return [void]
102
- def make_application_executable
103
- FileUtils.chmod(0755, "#{name}/bin/#{name}")
104
- end
105
-
106
- # @return [void]
107
- def copy_global_keymap
108
- copy_file(source + '/app/models/keymaps/_global_.rb',
109
- app_keymaps_path + '_global_.rb')
110
- end
111
-
112
- # @return [Array<String>]
113
- def directories
114
- [
115
- '/app/controllers',
116
- '/app/helpers',
117
- '/app/models/keymaps',
118
- '/app/views/interfaces',
119
- '/app/views/templates',
120
- '/bin',
121
- '/config',
122
- '/lib',
123
- '/test',
124
- '/vendor',
125
- ]
126
- end
127
-
128
- end # Application
129
- # :nocov:
130
-
131
- end # Generator
132
-
133
- end # Vedeu