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
@@ -1,139 +0,0 @@
1
- module Vedeu
2
-
3
- module Generator
4
-
5
- # Provides functionality used by the generators to build the client
6
- # application.
7
- #
8
- # :nocov:
9
- module Helpers
10
-
11
- include Vedeu::Common
12
-
13
- # @return [String]
14
- def app_name
15
- @app_name ||= File.read('./config/app_name')
16
- end
17
-
18
- # @return [String]
19
- def app_bin_path
20
- name + '/bin/'
21
- end
22
-
23
- # @return [String]
24
- def app_config_path
25
- name + '/config/'
26
- end
27
-
28
- # @return [String]
29
- def app_controllers_path
30
- name + '/app/controllers/'
31
- end
32
-
33
- # @return [String]
34
- def app_helpers_path
35
- name + '/app/helpers/'
36
- end
37
-
38
- # @return [String]
39
- def app_models_path
40
- name + '/app/models/'
41
- end
42
-
43
- # @return [String]
44
- def app_keymaps_path
45
- name + '/app/models/keymaps/'
46
- end
47
-
48
- # @return [String]
49
- def app_views_path
50
- name + '/app/views/'
51
- end
52
-
53
- # @param destination [String]
54
- # @return [void]
55
- def make_directory(destination)
56
- Vedeu.log_stdout(type: :create, message: "#{destination}")
57
-
58
- FileUtils.mkdir_p(destination)
59
- end
60
-
61
- # @param source [String]
62
- # @param destination [String]
63
- # @return [void]
64
- def copy_file(source, destination)
65
- if File.exist?(destination)
66
- skipped_file(destination)
67
-
68
- else
69
- Vedeu.log_stdout(type: :create, message: "#{destination}")
70
-
71
- FileUtils.cp(source, destination)
72
- end
73
- end
74
-
75
- # @param source [String]
76
- # @param destination [String]
77
- # @return [void]
78
- def make_file(source, destination)
79
- if File.exist?(destination)
80
- skipped_file(destination)
81
-
82
- else
83
- Vedeu.log_stdout(type: :create, message: "#{destination}")
84
-
85
- File.write(destination, parse(source))
86
- end
87
- end
88
-
89
- # @param destination [String]
90
- # @return [void]
91
- def skipped_file(destination)
92
- Vedeu.log_stdout(type: :create,
93
- message: "#{destination} " +
94
- Esc.red { 'already exists, skipped.' })
95
- end
96
-
97
- # @param destination [String]
98
- # @return [void]
99
- def touch_file(destination)
100
- Vedeu.log_stdout(type: :create, message: "#{destination}")
101
-
102
- FileUtils.touch(destination)
103
- end
104
-
105
- # @return [String]
106
- def name
107
- @_name ||= @name.downcase
108
- end
109
- alias_method :app_root_path, :name
110
-
111
- # @return [String]
112
- def name_as_class
113
- name.downcase.split(/_|-/).map(&:capitalize).join
114
- end
115
-
116
- # @return [String]
117
- def output(message = '')
118
- Vedeu.log_stdout(type: :info, message: message)
119
-
120
- message
121
- end
122
-
123
- # @param source [String]
124
- # @return [String]
125
- def parse(source)
126
- Vedeu::Templating::Template.parse(self, source)
127
- end
128
-
129
- # @return [String]
130
- def source
131
- File.dirname(__FILE__) + '/templates/application/.'
132
- end
133
-
134
- end # Helpers
135
- # :nocov:
136
-
137
- end # Generator
138
-
139
- end # Vedeu
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'vedeu'
4
- # gem 'ruby-prof' # uncomment when using the `debug!` configuration option.
@@ -1,24 +0,0 @@
1
- Copyright (c) 2014 Your Name Here
2
-
3
- Note: You may wish to change this license to suit your legal needs.
4
-
5
- MIT License
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining
8
- a copy of this software and associated documentation files (the
9
- "Software"), to deal in the Software without restriction, including
10
- without limitation the rights to use, copy, modify, merge, publish,
11
- distribute, sublicense, and/or sell copies of the Software, and to
12
- permit persons to whom the Software is furnished to do so, subject to
13
- the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be
16
- included in all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,18 +0,0 @@
1
- # <%= object.name_as_class %>
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Dependencies
9
-
10
- * Installation
11
-
12
- * Configuration
13
-
14
- * Runtime instructions
15
-
16
- * How to contribute
17
-
18
- * Author information
@@ -1,7 +0,0 @@
1
- module <%= object.name_as_class %>
2
-
3
- class ApplicationController < Vedeu::ApplicationController
4
-
5
- end
6
-
7
- end
@@ -1,22 +0,0 @@
1
- require_relative 'application_controller'
2
- require_relative '../views/<%= object.name %>'
3
-
4
- module <%= object.app_name %>
5
-
6
- class <%= object.name_as_class %>Controller < <%= object.app_name -%>::ApplicationController
7
-
8
- controller :<%= object.name %>
9
- action :list
10
- action :show
11
- # add more actions and implement or remove existing actions
12
-
13
- def list
14
- end
15
-
16
- def show
17
- <%= object.app_name %>::<%= object.name_as_class %>View.render(params)
18
- end
19
-
20
- end
21
-
22
- end
@@ -1,9 +0,0 @@
1
- module <%= object.name_as_class %>
2
-
3
- module ApplicationHelper
4
-
5
- include Vedeu::ApplicationHelper
6
-
7
- end
8
-
9
- end
@@ -1,11 +0,0 @@
1
- require_relative 'application_helper'
2
-
3
- module <%= object.app_name %>
4
-
5
- module <%= object.name_as_class %>Helper
6
-
7
- include <%= object.app_name -%>::ApplicationHelper
8
-
9
- end
10
-
11
- end
@@ -1,8 +0,0 @@
1
- Vedeu.keymap('_global_') do
2
- # see http://www.rubydoc.info/gems/vedeu/Vedeu/DSL/Keymap
3
-
4
- key('q') { Vedeu.trigger(:_exit_) }
5
- key(:esc) { Vedeu.trigger(:_mode_switch_) }
6
- key(:shift_tab) { Vedeu.trigger(:_focus_previous_) }
7
- key(:tab) { Vedeu.trigger(:_focus_next_) }
8
- end
@@ -1,3 +0,0 @@
1
- Vedeu.keymap('<%= object.name %>') do
2
- # see http://www.rubydoc.info/gems/vedeu/Vedeu/DSL/Keymap
3
- end
@@ -1,67 +0,0 @@
1
- Vedeu.interface '<%= object.name %>' do
2
- # border do
3
- # Define colour and style of border
4
- # colour foreground: '#ffffff', background: '#000000'
5
- # style 'normal'
6
-
7
- # Define visibility of border
8
- #
9
- # Uncomment one of these:
10
- # enable!
11
- # disable!
12
- #
13
- # Individually control each border:
14
- # hide_bottom!
15
- # hide_left!
16
- # hide_right!
17
- # hide_top!
18
- # show_bottom!
19
- # show_left!
20
- # show_right!
21
- # show_top!
22
-
23
- # Define characters used to draw border
24
- # bottom_right '+'
25
- # bottom_left '+'
26
- # horizontal '-'
27
- # top_right '+'
28
- # top_left '+'
29
- # vertical '|'
30
-
31
- # Define the title of the interface
32
- # title '<%= object.name %>'
33
- # end
34
-
35
- # background
36
-
37
- # colour
38
-
39
- # cursor!
40
-
41
- # See Vedeu::DSL::Interface#delay
42
- # delay 1.0
43
-
44
- # focus!
45
-
46
- # foreground
47
-
48
- # geometry do
49
- # centred!
50
- # x 1
51
- # y 1
52
- # xn 11
53
- # yn 11
54
- # height 10
55
- # width 10
56
- # end
57
-
58
- # group ''
59
-
60
- # hide!
61
-
62
- # show!
63
-
64
- # style
65
-
66
- # zindex
67
- end
@@ -1,36 +0,0 @@
1
- module <%= object.app_name %>
2
-
3
- class <%= object.name_as_class %>View < Vedeu::ApplicationView
4
-
5
- def render
6
- Vedeu.renders do
7
-
8
- # Build up the view programmatically...
9
- #
10
- # view '<%= object.name %>' do
11
- # lines do
12
- # line 'some content...'
13
- # end
14
- # end
15
-
16
- # ...or use the template in 'app/views/templates/<%= object.name %>'
17
- #
18
- template_for('<%= object.name %>',
19
- template('<%= object.name %>'),
20
- object,
21
- options)
22
- end
23
- end
24
-
25
- private
26
-
27
- def object
28
- end
29
-
30
- def options
31
- {}
32
- end
33
-
34
- end
35
-
36
- end
@@ -1,22 +0,0 @@
1
- require_relative 'config/configuration'
2
- # When manually setting the entry point below, uncomment this line:
3
- # require_relative 'app/controllers/some_controller'
4
-
5
- module <%= object.name_as_class %>
6
-
7
- class Application
8
-
9
- # Change this to be the controller you would like to start the
10
- # application from.
11
- #
12
- # def self.entry_point
13
- # <%= object.name_as_class %>::SomeController.new
14
- # end
15
-
16
- # Vedeu::Bootstrap.start(ARGV, entry_point)
17
-
18
- Vedeu::Bootstrap.start(ARGV)
19
-
20
- end
21
-
22
- end
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
4
-
5
- require 'bundler/setup' # Set up gems listed in the Gemfile.
6
-
7
- require 'vedeu'
8
-
9
- require_relative '../application'
@@ -1 +0,0 @@
1
- <%= object.name_as_class -%>
@@ -1,33 +0,0 @@
1
- Vedeu.configure do
2
- # base_path
3
-
4
- # colour_mode 16_777_216 # Some terminals don't render colour at all when this
5
- # value is not one of 8, 16, 256 or 16777216.
6
-
7
- # compression false
8
-
9
- # debug! # Requires "gem 'ruby-prof'" in your Gemfile.
10
- # drb!
11
- # drb_host 'localhost'
12
- # drb_port 21420
13
- # drb_width 80
14
- # drb_height 25
15
-
16
- # terminal_mode :raw
17
- # cooked!
18
- # raw!
19
-
20
- log "/tmp/<%= object.name %>.log"
21
-
22
- # renderers
23
-
24
- # run_once!
25
-
26
- # interactive!
27
- # standalone!
28
-
29
- # Not used yet
30
- # stdin File.open("/dev/tty", "r")
31
- # stdout File.open("/dev/tty", "w")
32
- # stderr File.open("/tmp/vedeu_error.log", "w+")
33
- end