vedeu 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/application.rb +1 -0
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/dsl/components/border.rb +7 -1
- data/lib/vedeu/dsl/components/geometry.rb +5 -1
- data/lib/vedeu/dsl/components/keymap.rb +7 -1
- data/lib/vedeu/dsl/components/menu.rb +7 -2
- data/lib/vedeu/dsl/composition.rb +5 -1
- data/lib/vedeu/dsl/group.rb +5 -1
- data/lib/vedeu/dsl/interface.rb +5 -1
- data/lib/vedeu/dsl/line.rb +7 -1
- data/lib/vedeu/dsl/stream.rb +7 -1
- data/lib/vedeu/launcher.rb +3 -0
- data/lib/vedeu/models/group.rb +7 -2
- data/lib/vedeu/output/compositor.rb +0 -15
- data/lib/vedeu/output/esc.rb +4 -29
- data/test/lib/vedeu/dsl/group_test.rb +48 -0
- data/vedeu.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6fef3c64356f6fae8e4aa5d76793f341be2a743
|
4
|
+
data.tar.gz: a7f195736cbfd4e597a7381450b431a13d1b7ea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4223a8d24f54f96ac5dd2c1bcad229e9ec335bd5d4426091736426d9dd4a86005c7f270fb2b9ab374f59eb4e8a3fb9b0953f36f68aac65e40275bccb1ddfe8f3
|
7
|
+
data.tar.gz: 91c862b85ab11f9506648a135bde2aa1c2a54d7ad87ccafd017d998fa2f7856a5c12a2d64ee2bb84c9b067ab27071ea72bdf80ff4537bfe2a253ced83b400753
|
data/lib/vedeu/application.rb
CHANGED
@@ -48,6 +48,8 @@ module Vedeu
|
|
48
48
|
# Returns an instance of DSL::Border.
|
49
49
|
#
|
50
50
|
# @param model [Border]
|
51
|
+
# @param client [Object]
|
52
|
+
# @return [Vedeu::DSL::Border]
|
51
53
|
def initialize(model, client = nil)
|
52
54
|
@model = model
|
53
55
|
@client = client
|
@@ -273,7 +275,11 @@ module Vedeu
|
|
273
275
|
|
274
276
|
private
|
275
277
|
|
276
|
-
|
278
|
+
# @return [Object]
|
279
|
+
attr_reader :client
|
280
|
+
|
281
|
+
# @return [Border]
|
282
|
+
attr_reader :model
|
277
283
|
|
278
284
|
end # Border
|
279
285
|
|
@@ -59,6 +59,8 @@ module Vedeu
|
|
59
59
|
# Returns an instance of DSL::Keymap.
|
60
60
|
#
|
61
61
|
# @param model [Keymap]
|
62
|
+
# @param client [Object]
|
63
|
+
# @return [Vedeu::DSL::Keymap]
|
62
64
|
def initialize(model, client = nil)
|
63
65
|
@model = model
|
64
66
|
@client = client
|
@@ -124,7 +126,11 @@ module Vedeu
|
|
124
126
|
|
125
127
|
private
|
126
128
|
|
127
|
-
|
129
|
+
# @return [Object]
|
130
|
+
attr_reader :client
|
131
|
+
|
132
|
+
# @return [Keymap]
|
133
|
+
attr_reader :model
|
128
134
|
|
129
135
|
end # Keymap
|
130
136
|
|
@@ -14,7 +14,8 @@ module Vedeu
|
|
14
14
|
# Return a new instance of DSL::Menu.
|
15
15
|
#
|
16
16
|
# @param model [Vedeu::Menu]
|
17
|
-
# @
|
17
|
+
# @param client [Object]
|
18
|
+
# @return [Vedeu::DSL::Menu]
|
18
19
|
def initialize(model, client = nil)
|
19
20
|
@model = model
|
20
21
|
@client = client
|
@@ -74,7 +75,11 @@ module Vedeu
|
|
74
75
|
|
75
76
|
private
|
76
77
|
|
77
|
-
|
78
|
+
# @return [Object]
|
79
|
+
attr_reader :client
|
80
|
+
|
81
|
+
# @return [Menu]
|
82
|
+
attr_reader :model
|
78
83
|
|
79
84
|
end # Menu
|
80
85
|
|
data/lib/vedeu/dsl/group.rb
CHANGED
data/lib/vedeu/dsl/interface.rb
CHANGED
data/lib/vedeu/dsl/line.rb
CHANGED
@@ -45,6 +45,8 @@ module Vedeu
|
|
45
45
|
# Returns an instance of DSL::Line.
|
46
46
|
#
|
47
47
|
# @param model [Vedeu::Line]
|
48
|
+
# @param client [Object]
|
49
|
+
# @return [Vedeu::DSL::Line]
|
48
50
|
def initialize(model, client = nil)
|
49
51
|
@model = model
|
50
52
|
@client = client
|
@@ -111,7 +113,11 @@ module Vedeu
|
|
111
113
|
|
112
114
|
private
|
113
115
|
|
114
|
-
|
116
|
+
# @return [Object]
|
117
|
+
attr_reader :client
|
118
|
+
|
119
|
+
# @return [Line]
|
120
|
+
attr_reader :model
|
115
121
|
|
116
122
|
# @return [Hash]
|
117
123
|
def attributes
|
data/lib/vedeu/dsl/stream.rb
CHANGED
@@ -18,6 +18,8 @@ module Vedeu
|
|
18
18
|
# Returns an instance of DSL::Stream.
|
19
19
|
#
|
20
20
|
# @param model [Vedeu::Stream]
|
21
|
+
# @param client [Object]
|
22
|
+
# @return [Vedeu::DSL::Stream]
|
21
23
|
def initialize(model, client = nil)
|
22
24
|
@model = model
|
23
25
|
@client = client
|
@@ -34,7 +36,11 @@ module Vedeu
|
|
34
36
|
|
35
37
|
private
|
36
38
|
|
37
|
-
|
39
|
+
# @return [Object]
|
40
|
+
attr_reader :client
|
41
|
+
|
42
|
+
# @return [Stream]
|
43
|
+
attr_reader :model
|
38
44
|
|
39
45
|
# @return [Hash]
|
40
46
|
def attributes
|
data/lib/vedeu/launcher.rb
CHANGED
data/lib/vedeu/models/group.rb
CHANGED
@@ -31,7 +31,9 @@ module Vedeu
|
|
31
31
|
# @param member [String]
|
32
32
|
# @return [Group]
|
33
33
|
def add(member)
|
34
|
-
|
34
|
+
@members = members.add(member)
|
35
|
+
|
36
|
+
Group.new({ name: name, members: @members }).store
|
35
37
|
end
|
36
38
|
|
37
39
|
# Return the members as a Set.
|
@@ -46,7 +48,9 @@ module Vedeu
|
|
46
48
|
# @param member [String]
|
47
49
|
# @return [Group]
|
48
50
|
def remove(member)
|
49
|
-
|
51
|
+
@members = members.delete(member)
|
52
|
+
|
53
|
+
Group.new({ name: name, members: @members }).store
|
50
54
|
end
|
51
55
|
|
52
56
|
# Remove all members from the group.
|
@@ -58,6 +62,7 @@ module Vedeu
|
|
58
62
|
|
59
63
|
private
|
60
64
|
|
65
|
+
# @return [Hash]
|
61
66
|
def defaults
|
62
67
|
{
|
63
68
|
members: [],
|
@@ -28,21 +28,6 @@ module Vedeu
|
|
28
28
|
@name = name
|
29
29
|
end
|
30
30
|
|
31
|
-
# @todo What do we do about resizing terminals. I don't want to overwrite
|
32
|
-
# the stored geometry and when the terminal returns to original size not also
|
33
|
-
# return the interface back to its originally prescribed dimensions.
|
34
|
-
#
|
35
|
-
# @note
|
36
|
-
# If the buffer has geometry stored, we should check whether this is different
|
37
|
-
# to the geometries repository- the client application is wanting to resize
|
38
|
-
# or move the interface.
|
39
|
-
#
|
40
|
-
# If it is different, overwrite the old geometry with the new.
|
41
|
-
#
|
42
|
-
# If the buffer does not have geometry stored, retrieve the geometry for this
|
43
|
-
# interface from the geometries repository so we can draw this buffer in the
|
44
|
-
# correct place.
|
45
|
-
#
|
46
31
|
# @return [Array<Interface>]
|
47
32
|
def compose
|
48
33
|
buffer.map do |view|
|
data/lib/vedeu/output/esc.rb
CHANGED
@@ -107,9 +107,11 @@ module Vedeu
|
|
107
107
|
# @param value [String|Symbol]
|
108
108
|
# @return [String]
|
109
109
|
def string(value = '')
|
110
|
-
|
110
|
+
name = value.to_sym
|
111
111
|
|
112
|
-
|
112
|
+
return '' if name.empty?
|
113
|
+
|
114
|
+
send(name) rescue ''
|
113
115
|
end
|
114
116
|
|
115
117
|
# Return the escape sequence to render a border character.
|
@@ -124,33 +126,6 @@ module Vedeu
|
|
124
126
|
|
125
127
|
private
|
126
128
|
|
127
|
-
# @return [Hash]
|
128
|
-
def sequences
|
129
|
-
{
|
130
|
-
bg_reset: proc { bg_reset },
|
131
|
-
blink: proc { blink },
|
132
|
-
blink_off: proc { blink_off },
|
133
|
-
bold: proc { bold },
|
134
|
-
bold_off: proc { bold_off },
|
135
|
-
clear: proc { clear },
|
136
|
-
clear_line: proc { clear_line },
|
137
|
-
clear_last_line: proc { clear_last_line },
|
138
|
-
colour_reset: proc { colour_reset },
|
139
|
-
dim: proc { dim },
|
140
|
-
fg_reset: proc { fg_reset },
|
141
|
-
hide_cursor: proc { hide_cursor },
|
142
|
-
negative: proc { negative },
|
143
|
-
normal: proc { normal },
|
144
|
-
positive: proc { positive },
|
145
|
-
reset: proc { reset },
|
146
|
-
screen_init: proc { screen_init },
|
147
|
-
screen_exit: proc { screen_exit },
|
148
|
-
show_cursor: proc { show_cursor },
|
149
|
-
underline: proc { underline },
|
150
|
-
underline_off: proc { underline_off },
|
151
|
-
}
|
152
|
-
end
|
153
|
-
|
154
129
|
# @return [String]
|
155
130
|
def bg_reset
|
156
131
|
"\e[49m"
|
@@ -43,10 +43,58 @@ module Vedeu
|
|
43
43
|
}
|
44
44
|
|
45
45
|
it { subject.must_be_instance_of(Vedeu::Group) }
|
46
|
+
|
47
|
+
it { subject.members.must_equal(Set['editor_interface']) }
|
46
48
|
end
|
47
49
|
|
48
50
|
end # Group
|
49
51
|
|
52
|
+
describe 'integration' do
|
53
|
+
|
54
|
+
context 'it does not work without a name' do
|
55
|
+
subject {
|
56
|
+
Vedeu.group('') do
|
57
|
+
add('main_interface')
|
58
|
+
end
|
59
|
+
}
|
60
|
+
|
61
|
+
it { proc { subject }.must_raise(MissingRequired) }
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'it adds interface names to the group' do
|
65
|
+
subject {
|
66
|
+
Vedeu.group('my_group') do
|
67
|
+
add('main_interface')
|
68
|
+
add('status_interface')
|
69
|
+
add('command_interface')
|
70
|
+
end
|
71
|
+
}
|
72
|
+
|
73
|
+
it { subject.members.size.must_equal(3) }
|
74
|
+
|
75
|
+
it { subject.members.must_equal(
|
76
|
+
Set['main_interface', 'status_interface', 'command_interface']
|
77
|
+
) }
|
78
|
+
end
|
79
|
+
|
80
|
+
context 'it does not add duplicate names to the group' do
|
81
|
+
subject {
|
82
|
+
Vedeu.group('my_group') do
|
83
|
+
add('main_interface')
|
84
|
+
add('status_interface')
|
85
|
+
add('main_interface')
|
86
|
+
end
|
87
|
+
}
|
88
|
+
|
89
|
+
it { subject.members.size.must_equal(2) }
|
90
|
+
|
91
|
+
it { subject.members.must_equal(
|
92
|
+
Set['main_interface', 'status_interface']
|
93
|
+
) }
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
50
98
|
end # DSL
|
51
99
|
|
52
100
|
end # Vedeu
|
data/vedeu.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'vedeu'
|
7
|
-
spec.version = '0.4.
|
7
|
+
spec.version = '0.4.5'
|
8
8
|
spec.authors = ['Gavin Laking']
|
9
9
|
spec.email = ['gavinlaking@gmail.com']
|
10
10
|
spec.summary = %q{A terminal case of wonderland.}
|
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.4.
|
4
|
+
version: 0.4.5
|
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-03-
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|