dumon 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/lib/dumon/omanager.rb +5 -4
- data/lib/dumon/version.rb +1 -0
- data/test/test_omanager.rb +61 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c573b733f78dfc52576264eb8a6f7ed64957b46
|
4
|
+
data.tar.gz: 2bd608cec4d1fbc8e0d04180415f66f8a7c44db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c6010aafb8bd533bcbca5e0c95966260deaefc67d7635a6575450800f17f231983600e2d9bc9bfddeda2b9cdac717d0f8028d6b3832b2b5cb1d081d3979d8ab
|
7
|
+
data.tar.gz: ac948a72bdc893721380eef74f4e2aa085b65cf97fe1f71eda58043d5d1c33bbc6c89eb51ae3d29469b8a5289bb34d88515af61eef266109951802295fbab437
|
data/.gitignore
CHANGED
data/lib/dumon/omanager.rb
CHANGED
@@ -180,13 +180,14 @@ module Dumon
|
|
180
180
|
rslt = {}
|
181
181
|
|
182
182
|
output = nil
|
183
|
+
|
183
184
|
xrandr_out = `#{self.stool} -q`
|
184
185
|
xrandr_out.each_line do |line|
|
185
|
-
if line =~
|
186
|
-
output = line[
|
186
|
+
if line =~ /^[\w-]+ connected /
|
187
|
+
output = line[/^[\w-]+/]
|
187
188
|
rslt[output] = {:resolutions => []}
|
188
189
|
end
|
189
|
-
if line =~ /^\s
|
190
|
+
if line =~ /^\s*[0-9x]+\s+\d+/ and not output.nil?
|
190
191
|
resolution = line[/[0-9x]+/]
|
191
192
|
rslt[output][:default] = resolution if line.include? '+'
|
192
193
|
rslt[output][:current] = resolution if line.include? '*'
|
@@ -204,7 +205,7 @@ module Dumon
|
|
204
205
|
assert(!rslt.empty?, 'no outputs found')
|
205
206
|
rslt.each do |output,out_meta|
|
206
207
|
verify_options(out_meta, {:resolutions=>:mandatory, :default=>:mandatory, :current=>:optional})
|
207
|
-
assert(out_meta[:resolutions].size
|
208
|
+
assert(out_meta[:resolutions].size >= 1, "no resolution found, output=#{output}")
|
208
209
|
end
|
209
210
|
|
210
211
|
@outputs = rslt
|
data/lib/dumon/version.rb
CHANGED
@@ -2,6 +2,7 @@ module Dumon
|
|
2
2
|
|
3
3
|
# Version history.
|
4
4
|
VERSION_HISTORY = [
|
5
|
+
['0.2.8', '2013-07-10', 'BF #15: Problem with nvidia graphic driver'],
|
5
6
|
['0.2.7', '2013-05-08', 'BF #14: Failure if applied profile with unconnected output; Enh #7'],
|
6
7
|
['0.2.6', '2013-04-23', 'BF #13: Failure if no default resolution provided by output'],
|
7
8
|
['0.2.5', '2013-04-02', 'BF #12: Profile dialog fails if configuration is empty'],
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'dumon'
|
3
|
+
|
4
|
+
###
|
5
|
+
# This class tests Dumon::OutDeviceManager class.
|
6
|
+
class TestOutDeviceManager < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def test_BF15
|
9
|
+
|
10
|
+
Dumon::XrandrManager.class_eval do
|
11
|
+
def stool # mock the instance method to produce expected output
|
12
|
+
xrand_out = <<nxo
|
13
|
+
Screen 0: minimum 8 x 8, current 3520 x 1080, maximum 16384 x 16384
|
14
|
+
VGA-0 disconnected (normal left inverted right x axis y axis)
|
15
|
+
LVDS-0 connected 1600x900+1920+0 (normal left inverted right x axis y axis) 345mm x 194mm
|
16
|
+
1600x900 60.0*+ 50.0
|
17
|
+
|
18
|
+
DP-0 disconnected (normal left inverted right x axis y axis)
|
19
|
+
DP-1 disconnected (normal left inverted right x axis y axis)
|
20
|
+
DP-2 disconnected (normal left inverted right x axis y axis)
|
21
|
+
DP-3 disconnected (normal left inverted right x axis y axis)
|
22
|
+
DP-4 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
|
23
|
+
1920x1080 60.0*+ 59.9 50.0 30.0 30.0 25.0
|
24
|
+
|
25
|
+
1680x1050 60.0
|
26
|
+
|
27
|
+
1440x900 59.9
|
28
|
+
|
29
|
+
1280x1024 75.0 60.0
|
30
|
+
|
31
|
+
1280x720 60.0 59.9 50.0
|
32
|
+
|
33
|
+
1152x864 60.0
|
34
|
+
|
35
|
+
1024x768 75.0 70.1 60.0
|
36
|
+
|
37
|
+
800x600 75.0 72.2 60.3 56.2
|
38
|
+
|
39
|
+
720x576 50.0 25.0
|
40
|
+
|
41
|
+
720x480 59.9 30.0
|
42
|
+
|
43
|
+
640x480 75.0 72.8 59.9 59.9
|
44
|
+
|
45
|
+
DP-5 disconnected (normal left inverted right x axis y axis)
|
46
|
+
nxo
|
47
|
+
"echo \"#{xrand_out}\""
|
48
|
+
end
|
49
|
+
end
|
50
|
+
omanager = Dumon::XrandrManager.new
|
51
|
+
omanager.read
|
52
|
+
outs = omanager.outputs
|
53
|
+
assert_not_nil outs
|
54
|
+
assert_equal 2, outs.keys.size
|
55
|
+
assert outs.keys.include? 'LVDS-0'
|
56
|
+
assert outs.keys.include? 'DP-4'
|
57
|
+
assert_equal 1, outs['LVDS-0'][:resolutions].size
|
58
|
+
assert_equal 11, outs['DP-4'][:resolutions].size
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vaclav Sykora
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gtk2
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/rrutils.rb
|
51
51
|
- lib/rrutils/confdb.rb
|
52
52
|
- lib/rrutils/options.rb
|
53
|
+
- test/test_omanager.rb
|
53
54
|
- test/test_rrutils_options.rb
|
54
55
|
homepage: http://github.com/veny/dumon
|
55
56
|
licenses: []
|
@@ -76,4 +77,5 @@ signing_key:
|
|
76
77
|
specification_version: 4
|
77
78
|
summary: Dual monitor manager for Linux.
|
78
79
|
test_files:
|
80
|
+
- test/test_omanager.rb
|
79
81
|
- test/test_rrutils_options.rb
|