vedeu 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/api.rb +8 -0
- data/lib/vedeu/application.rb +2 -0
- data/lib/vedeu/bindings.rb +3 -0
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/cursor/cursor.rb +1 -1
- data/lib/vedeu/cursor/move.rb +1 -1
- data/lib/vedeu/cursor/refresh_cursor.rb +2 -0
- data/lib/vedeu/cursor/toggle.rb +1 -1
- data/lib/vedeu/debug.rb +36 -1
- data/lib/vedeu/distributed/client.rb +2 -0
- data/lib/vedeu/distributed/subprocess.rb +2 -0
- data/lib/vedeu/distributed/test_application.rb +2 -0
- data/lib/vedeu/distributed/uri.rb +2 -0
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/events/trigger.rb +2 -0
- data/lib/vedeu/geometry/all.rb +0 -1
- data/lib/vedeu/geometry/area.rb +22 -0
- data/lib/vedeu/geometry/centre.rb +2 -0
- data/lib/vedeu/geometry/content.rb +2 -0
- data/lib/vedeu/geometry/coordinate.rb +2 -0
- data/lib/vedeu/geometry/dimension.rb +2 -0
- data/lib/vedeu/geometry/geometry.rb +8 -3
- data/lib/vedeu/geometry/grid.rb +2 -0
- data/lib/vedeu/geometry/index_position.rb +21 -0
- data/lib/vedeu/geometry/limit.rb +2 -0
- data/lib/vedeu/geometry/position.rb +1 -1
- data/lib/vedeu/geometry/position_index.rb +2 -0
- data/lib/vedeu/geometry/position_validator.rb +2 -0
- data/lib/vedeu/input/input.rb +1 -1
- data/lib/vedeu/input/key.rb +1 -1
- data/lib/vedeu/input/keymap.rb +2 -0
- data/lib/vedeu/input/mapper.rb +8 -0
- data/lib/vedeu/launcher.rb +2 -0
- data/lib/vedeu/main_loop.rb +1 -3
- data/lib/vedeu/models/cell.rb +2 -0
- data/lib/vedeu/models/composition.rb +1 -1
- data/lib/vedeu/models/group.rb +1 -1
- data/lib/vedeu/models/interface.rb +35 -3
- data/lib/vedeu/models/line.rb +6 -1
- data/lib/vedeu/models/menu.rb +1 -1
- data/lib/vedeu/models/stream.rb +6 -17
- data/lib/vedeu/output/all.rb +3 -2
- data/lib/vedeu/output/background.rb +26 -0
- data/lib/vedeu/output/border.rb +105 -25
- data/lib/vedeu/output/clear.rb +17 -10
- data/lib/vedeu/output/colour.rb +1 -1
- data/lib/vedeu/output/compositor.rb +4 -1
- data/lib/vedeu/output/foreground.rb +26 -0
- data/lib/vedeu/output/html_char.rb +2 -0
- data/lib/vedeu/output/null_border.rb +49 -0
- data/lib/vedeu/output/output.rb +8 -44
- data/lib/vedeu/output/renderers/all.rb +3 -0
- data/lib/vedeu/output/{renderer.rb → renderers/file_renderer.rb} +14 -6
- data/lib/vedeu/output/{html_renderer.rb → renderers/html_renderer.rb} +3 -1
- data/lib/vedeu/output/renderers/terminal_renderer.rb +50 -0
- data/lib/vedeu/output/text.rb +1 -1
- data/lib/vedeu/output/translator.rb +21 -2
- data/lib/vedeu/output/viewport.rb +17 -50
- data/lib/vedeu/output/virtual_terminal.rb +2 -0
- data/lib/vedeu/output/wordwrap.rb +2 -0
- data/lib/vedeu/repositories/all.rb +82 -0
- data/lib/vedeu/repositories/collection.rb +16 -0
- data/lib/vedeu/repositories/repository.rb +2 -0
- data/lib/vedeu/support/log.rb +3 -0
- data/lib/vedeu/support/sentence.rb +2 -0
- data/lib/vedeu/support/template.rb +2 -0
- data/lib/vedeu/support/terminal.rb +6 -1
- data/lib/vedeu/support/trace.rb +2 -0
- data/lib/vedeu/support/visible.rb +6 -0
- data/test/lib/vedeu/dsl/components/border_test.rb +0 -270
- data/test/lib/vedeu/dsl/shared/text_test.rb +19 -0
- data/test/lib/vedeu/geometry/area_test.rb +32 -0
- data/test/lib/vedeu/geometry/index_position_test.rb +36 -0
- data/test/lib/vedeu/models/interface_test.rb +42 -1
- data/test/lib/vedeu/models/line_test.rb +15 -1
- data/test/lib/vedeu/models/stream_test.rb +15 -1
- data/test/lib/vedeu/output/background_test.rb +4 -2
- data/test/lib/vedeu/output/border_test.rb +229 -127
- data/test/lib/vedeu/output/clear_test.rb +14 -0
- data/test/lib/vedeu/output/foreground_test.rb +4 -2
- data/test/lib/vedeu/output/null_border_test.rb +53 -0
- data/test/lib/vedeu/output/output_test.rb +2 -0
- data/test/lib/vedeu/output/{renderer_test.rb → renderers/file_renderer_test.rb} +5 -5
- data/test/lib/vedeu/output/renderers/html_renderer_test.rb +71 -0
- data/test/lib/vedeu/output/renderers/terminal_renderer_test.rb +24 -0
- data/test/lib/vedeu/output/viewport_test.rb +100 -74
- data/vedeu.gemspec +1 -1
- metadata +15 -11
- data/lib/vedeu/geometry/bounding_area.rb +0 -136
- data/test/lib/vedeu/geometry/bounding_area_test.rb +0 -123
- data/test/lib/vedeu/output/html_renderer_test.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9fe2d78e6318aca74ab320786c9074d8b745eff
|
4
|
+
data.tar.gz: 824f82bca58a42308ad10bec73fd49fbd1c20884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 103b80280897cd8904924011ef77a0060256f60a5475c1725ad118a0b606861eaa7c0f4938fe2b4c1e06fb6edd9ff84809ee209aa57b07a73b49f8b12ba61c8f
|
7
|
+
data.tar.gz: d39f7987ca6a1f517ad469d3be912d7748e2f7592128689eb3aace31cc5e59c57f5c2d62200d4c4f9abc009e91b017f6ecb8a2de5c420ac28983649c42356925
|
data/lib/vedeu/api.rb
CHANGED
@@ -46,6 +46,14 @@ module Vedeu
|
|
46
46
|
# @see Vedeu::Canvas.canvas
|
47
47
|
def_delegators Vedeu::Canvas, :canvas
|
48
48
|
|
49
|
+
# @!method background_colours
|
50
|
+
# @see Vedeu::BackgroundColours.background_colours
|
51
|
+
def_delegators Vedeu::BackgroundColours, :background_colours
|
52
|
+
|
53
|
+
# @!method foreground_colours
|
54
|
+
# @see Vedeu::ForegroundColours.foreground_colours
|
55
|
+
def_delegators Vedeu::ForegroundColours, :foreground_colours
|
56
|
+
|
49
57
|
# @!method cursors
|
50
58
|
# @see Vedeu::Cursors.cursors
|
51
59
|
def_delegators Vedeu::Cursors, :cursors
|
data/lib/vedeu/application.rb
CHANGED
data/lib/vedeu/bindings.rb
CHANGED
@@ -84,6 +84,9 @@ module Vedeu
|
|
84
84
|
# events. Please see those events for their behaviour.
|
85
85
|
Vedeu.bind(:_resize_, { delay: 0.25 }) { Vedeu.resize }
|
86
86
|
|
87
|
+
Vedeu.bind(:tick) { |time| Vedeu.log(type: :debug, message: "Tick: #{time}") }
|
88
|
+
Vedeu.bind(:tock) { |time| Vedeu.log(type: :debug, message: "Tock: #{time}") }
|
89
|
+
|
87
90
|
# Hide the cursor of the named interface or interface currently in focus.
|
88
91
|
Vedeu.bind(:_cursor_hide_) do |name|
|
89
92
|
named = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
|
data/lib/vedeu/cursor/cursor.rb
CHANGED
data/lib/vedeu/cursor/move.rb
CHANGED
data/lib/vedeu/cursor/toggle.rb
CHANGED
data/lib/vedeu/debug.rb
CHANGED
@@ -9,18 +9,53 @@ module Vedeu
|
|
9
9
|
def self.debug(filename = 'profile.html', &block)
|
10
10
|
require 'ruby-prof'
|
11
11
|
|
12
|
+
RubyProf.measure_mode = RubyProf::WALL_TIME
|
13
|
+
# RubyProf.measure_mode = RubyProf::PROCESS_TIME
|
14
|
+
# RubyProf.measure_mode = RubyProf::CPU_TIME
|
15
|
+
# RubyProf.measure_mode = RubyProf::ALLOCATIONS
|
16
|
+
# RubyProf.measure_mode = RubyProf::MEMORY
|
17
|
+
# RubyProf.measure_mode = RubyProf::GC_TIME
|
18
|
+
# RubyProf.measure_mode = RubyProf::GC_RUNS
|
19
|
+
|
12
20
|
RubyProf.start
|
13
21
|
|
14
22
|
yield
|
15
23
|
|
16
24
|
result = RubyProf.stop
|
17
|
-
result.eliminate_methods!([
|
25
|
+
result.eliminate_methods!([
|
26
|
+
/^Array/,
|
27
|
+
/^Hash/,
|
28
|
+
])
|
18
29
|
|
19
30
|
File.open('/tmp/' + filename, 'w') do |file|
|
20
31
|
RubyProf::CallStackPrinter.new(result).print(file)
|
21
32
|
|
22
33
|
# Used with QTCacheGrind to analyse performance.
|
23
34
|
# RubyProf::CallTreePrinter.new(result).print(file)
|
35
|
+
|
36
|
+
# Creates a flat report in text format
|
37
|
+
# RubyProf::FlatPrinter
|
38
|
+
|
39
|
+
# - same as above but more verbose
|
40
|
+
# RubyProf::FlatPrinterWithLineNumbers
|
41
|
+
|
42
|
+
# - Creates a call graph report in text format
|
43
|
+
# RubyProf::GraphPrinter
|
44
|
+
|
45
|
+
# - Creates a call graph report in HTML (separate files per thread)
|
46
|
+
# RubyProf::GraphHtmlPrinter
|
47
|
+
|
48
|
+
# - Creates a call graph report in GraphViz's DOT format which can be converted to an image
|
49
|
+
# RubyProf::DotPrinter
|
50
|
+
|
51
|
+
# - Creates a call tree report compatible with KCachegrind.
|
52
|
+
# RubyProf::CallTreePrinter
|
53
|
+
|
54
|
+
# - Creates a HTML visualization of the Ruby stack
|
55
|
+
# RubyProf::CallStackPrinter
|
56
|
+
|
57
|
+
# - Uses the other printers to create several reports in one profiling run
|
58
|
+
# RubyProf::MultiPrinter
|
24
59
|
end
|
25
60
|
end
|
26
61
|
# :nocov:
|
data/lib/vedeu/events/event.rb
CHANGED
data/lib/vedeu/events/trigger.rb
CHANGED
data/lib/vedeu/geometry/all.rb
CHANGED
data/lib/vedeu/geometry/area.rb
CHANGED
@@ -44,6 +44,8 @@ module Vedeu
|
|
44
44
|
new(y: y, yn: yn, x: x, xn: xn)
|
45
45
|
end
|
46
46
|
|
47
|
+
# Returns a new instance of Vedeu::Area.
|
48
|
+
#
|
47
49
|
# @param y [Fixnum]
|
48
50
|
# @param yn [Fixnum]
|
49
51
|
# @param x [Fixnum]
|
@@ -149,6 +151,26 @@ module Vedeu
|
|
149
151
|
x - offset
|
150
152
|
end
|
151
153
|
|
154
|
+
# @return [Vedeu::Position]
|
155
|
+
def top_left
|
156
|
+
Vedeu::Position[y, x]
|
157
|
+
end
|
158
|
+
|
159
|
+
# @return [Vedeu::Position]
|
160
|
+
def bottom_left
|
161
|
+
Vedeu::Position[yn, x]
|
162
|
+
end
|
163
|
+
|
164
|
+
# @return [Vedeu::Position]
|
165
|
+
def top_right
|
166
|
+
Vedeu::Position[y, xn]
|
167
|
+
end
|
168
|
+
|
169
|
+
# @return [Vedeu::Position]
|
170
|
+
def bottom_right
|
171
|
+
Vedeu::Position[yn, xn]
|
172
|
+
end
|
173
|
+
|
152
174
|
private
|
153
175
|
|
154
176
|
end # Area
|
@@ -27,6 +27,8 @@ module Vedeu
|
|
27
27
|
new({ v: v, vn: vn }).centre
|
28
28
|
end
|
29
29
|
|
30
|
+
# Returns a new instance of Vedeu::Centre.
|
31
|
+
#
|
30
32
|
# @param attributes [Hash<Symbol => Fixnum>]
|
31
33
|
# @option attributes v [Fixnum] The starting coordinate value.
|
32
34
|
# @option attributes vn [Fixnum] The ending coordinate value.
|
@@ -10,6 +10,8 @@ module Vedeu
|
|
10
10
|
new(attributes).pair
|
11
11
|
end
|
12
12
|
|
13
|
+
# Returns a new instance of Vedeu::Dimension.
|
14
|
+
#
|
13
15
|
# @param attributes [Hash<Symbol => Fixnum, NilClass>]
|
14
16
|
# @option attributes d [Fixnum|NilClass] The starting value (y or x).
|
15
17
|
# @option attributes dn [Fixnum|NilClass] The ending value (yn or xn).
|
@@ -32,7 +32,8 @@ module Vedeu
|
|
32
32
|
extend Forwardable
|
33
33
|
include Vedeu::Model
|
34
34
|
|
35
|
-
def_delegators :area,
|
35
|
+
def_delegators :area,
|
36
|
+
:north,
|
36
37
|
:east,
|
37
38
|
:south,
|
38
39
|
:west,
|
@@ -45,7 +46,11 @@ module Vedeu
|
|
45
46
|
:yn,
|
46
47
|
:x,
|
47
48
|
:height,
|
48
|
-
:width
|
49
|
+
:width,
|
50
|
+
:top_left,
|
51
|
+
:top_right,
|
52
|
+
:bottom_left,
|
53
|
+
:bottom_right
|
49
54
|
|
50
55
|
# @!attribute [rw] centred
|
51
56
|
# @return [Boolean]
|
@@ -83,7 +88,7 @@ module Vedeu
|
|
83
88
|
# @return [Fixnum]
|
84
89
|
attr_writer :yn
|
85
90
|
|
86
|
-
# Returns a new instance of Geometry.
|
91
|
+
# Returns a new instance of Vedeu::Geometry.
|
87
92
|
#
|
88
93
|
# @param attributes [Hash]
|
89
94
|
# @option attributes centred [Boolean]
|
data/lib/vedeu/geometry/grid.rb
CHANGED
@@ -13,6 +13,27 @@ module Vedeu
|
|
13
13
|
new(iy, ix, oy, ox).[]
|
14
14
|
end
|
15
15
|
|
16
|
+
# @param name [String] The name of the interface.
|
17
|
+
# @param iy [Fixnum]
|
18
|
+
# @param ix [Fixnum]
|
19
|
+
# @return [Vedeu::Position]
|
20
|
+
def self.from_interface(name, iy, ix)
|
21
|
+
if Vedeu.interfaces.registered?(name)
|
22
|
+
interface = Vedeu.interfaces.find(name)
|
23
|
+
oy = interface.border.by
|
24
|
+
ox = interface.border.bx
|
25
|
+
|
26
|
+
else
|
27
|
+
oy = 1
|
28
|
+
ox = 1
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
new(iy, ix, oy, ox).[]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns a new instance of Vedeu::IndexPosition.
|
36
|
+
#
|
16
37
|
# @param iy [Fixnum]
|
17
38
|
# @param ix [Fixnum]
|
18
39
|
# @param oy [Fixnum]
|
data/lib/vedeu/geometry/limit.rb
CHANGED
data/lib/vedeu/input/input.rb
CHANGED
data/lib/vedeu/input/key.rb
CHANGED
data/lib/vedeu/input/keymap.rb
CHANGED
@@ -18,6 +18,8 @@ module Vedeu
|
|
18
18
|
# @return [String]
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
|
+
# Returns a new instance of Vedeu::Keymap.
|
22
|
+
#
|
21
23
|
# @param attributes [Hash]
|
22
24
|
# @option attributes name [String] The name of the keymap.
|
23
25
|
# @option attributes keys [Vedeu::Keys|Array] A collection of keys.
|