volay 1.0.0 → 1.0.1
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/lib/volay/config.rb +3 -7
- data/lib/volay/mixer/default.rb +5 -5
- data/lib/volay/utils.rb +2 -2
- data/lib/volay/version.rb +1 -1
- data/lib/volay/widget/events.rb +1 -1
- data/lib/volay/widget/system_tray.rb +8 -8
- data/lib/volay/widget/volume_control.rb +1 -1
- data/spec/volay/config_spec.rb +2 -2
- data/volay.gemspec +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd580ba8ac11f36e9f3e847750a0d4b51983f32b
|
4
|
+
data.tar.gz: acd26736bdc28129060744495a8497fbf1192e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a9c6e51712c4f66fdcc69f462996c992c42178ea1913d9b6cdf178be6ed13d5ab7863a018e2760682eccb6177a5d83a4b9d1c20851f92ec81b2d0ab1bfb59ce
|
7
|
+
data.tar.gz: d17a5fce31b7fb69dde055ecaf547106e9842549133eb8156cba23aa2557b0195b690cb60ebacd97168675bc95daacd10426e82257e01e62c99421707b7c5038
|
data/lib/volay/config.rb
CHANGED
@@ -57,13 +57,9 @@ module Volay
|
|
57
57
|
# Initialize mixer for controlling volume
|
58
58
|
#
|
59
59
|
def self.mixer
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
else
|
64
|
-
fail MixerNotFound
|
65
|
-
end
|
66
|
-
end
|
60
|
+
raise MixerNotFound unless which('amixer')
|
61
|
+
|
62
|
+
@mixer ||= Volay::Mixer::Alsa.new
|
67
63
|
end
|
68
64
|
|
69
65
|
##
|
data/lib/volay/mixer/default.rb
CHANGED
@@ -8,28 +8,28 @@ module Volay
|
|
8
8
|
# Up the volume
|
9
9
|
#
|
10
10
|
def up(*)
|
11
|
-
|
11
|
+
raise NotImplementedError
|
12
12
|
end
|
13
13
|
|
14
14
|
##
|
15
15
|
# Down the volume
|
16
16
|
#
|
17
17
|
def down(*)
|
18
|
-
|
18
|
+
raise NotImplementedError
|
19
19
|
end
|
20
20
|
|
21
21
|
##
|
22
22
|
# Set the volume
|
23
23
|
#
|
24
24
|
def value=(*)
|
25
|
-
|
25
|
+
raise NotImplementedError
|
26
26
|
end
|
27
27
|
|
28
28
|
##
|
29
29
|
# Toggle mute
|
30
30
|
#
|
31
31
|
def toggle
|
32
|
-
|
32
|
+
raise NotImplementedError
|
33
33
|
end
|
34
34
|
|
35
35
|
##
|
@@ -37,7 +37,7 @@ module Volay
|
|
37
37
|
# percent and muted
|
38
38
|
#
|
39
39
|
def current
|
40
|
-
|
40
|
+
raise NotImplementedError
|
41
41
|
end
|
42
42
|
|
43
43
|
##
|
data/lib/volay/utils.rb
CHANGED
@@ -19,10 +19,10 @@ module Volay
|
|
19
19
|
def update_status_icon
|
20
20
|
icon = status_icon
|
21
21
|
@app.get_object('status_icon')
|
22
|
-
|
22
|
+
.set_stock(icon)
|
23
23
|
@app.get_object('toggle_mute').set_active(@app.mixer.muted?)
|
24
24
|
@app.get_object('toggle_mute_image')
|
25
|
-
|
25
|
+
.set_stock(icon)
|
26
26
|
end
|
27
27
|
|
28
28
|
def status_icon
|
data/lib/volay/version.rb
CHANGED
data/lib/volay/widget/events.rb
CHANGED
@@ -59,7 +59,7 @@ module Volay
|
|
59
59
|
#
|
60
60
|
def get_position(window)
|
61
61
|
_e, screen, rectangle, orientation = @app.get_object('status_icon')
|
62
|
-
|
62
|
+
.geometry
|
63
63
|
window.set_screen(screen)
|
64
64
|
monitor_num = screen.get_monitor_at_point(rectangle.x, rectangle.y)
|
65
65
|
monitor = screen.get_monitor_geometry(monitor_num)
|
@@ -75,16 +75,16 @@ module Volay
|
|
75
75
|
posy = rectangle.y
|
76
76
|
end
|
77
77
|
else
|
78
|
-
|
79
|
-
|
78
|
+
total = rectangle.y + rectangle.height + window_height
|
79
|
+
if total <= monitor.y + monitor.height
|
80
80
|
posy = rectangle.y + rectangle.height
|
81
81
|
else
|
82
82
|
posy = rectangle.y - window_height
|
83
|
-
if
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
posx = if rectangle.x + window_width <= monitor.x + monitor.width
|
84
|
+
rectangle.x
|
85
|
+
else
|
86
|
+
monitor.x + monitor.width - window_width
|
87
|
+
end
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
data/spec/volay/config_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe 'Volay::Config' do
|
|
29
29
|
let(:config) do
|
30
30
|
FileUtils.mkdir_p('/usr/bin')
|
31
31
|
File.write('/usr/bin/ruby', '')
|
32
|
-
File.chmod(
|
32
|
+
File.chmod(0o777, '/usr/bin/ruby')
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should find ruby executable' do
|
@@ -47,7 +47,7 @@ describe 'Volay::Config' do
|
|
47
47
|
def app_mixer(prog)
|
48
48
|
FileUtils.mkdir_p('/usr/bin')
|
49
49
|
File.write("/usr/bin/#{prog}", '')
|
50
|
-
File.chmod(
|
50
|
+
File.chmod(0o777, "/usr/bin/#{prog}")
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'should not return pulseaudio' do
|
data/volay.gemspec
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Rambaud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-shellout
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,9 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.5.1
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: The Volume system tray
|
208
208
|
test_files: []
|
209
|
-
has_rdoc:
|