volay 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df1228f2ed17835ea69682d354967b12b0fbcfe7
4
- data.tar.gz: 856899d78500be2d1ca8c559ce11dc979c3e2c37
3
+ metadata.gz: bd580ba8ac11f36e9f3e847750a0d4b51983f32b
4
+ data.tar.gz: acd26736bdc28129060744495a8497fbf1192e3a
5
5
  SHA512:
6
- metadata.gz: af6cc7ffc098daec0e3bd0c7a27f089a5bee8aa064cdf36a8c3ffe1c3a4daa01226feb7389dd2b7ed4c1b19d8062e80e6b8b3adfc2837dca25230378bc886beb
7
- data.tar.gz: 888efe7fecae589434f74da3bd68a932ed0377e43c610f20014afd348beaeca2a46b8ab1b03e3369a9a50a20a05acc9c41d20899cf78c61d332e4d3ecaeb49a5
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
- @mixer ||= begin
61
- if which('amixer')
62
- Volay::Mixer::Alsa.new
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
  ##
@@ -8,28 +8,28 @@ module Volay
8
8
  # Up the volume
9
9
  #
10
10
  def up(*)
11
- fail NotImplementedError
11
+ raise NotImplementedError
12
12
  end
13
13
 
14
14
  ##
15
15
  # Down the volume
16
16
  #
17
17
  def down(*)
18
- fail NotImplementedError
18
+ raise NotImplementedError
19
19
  end
20
20
 
21
21
  ##
22
22
  # Set the volume
23
23
  #
24
24
  def value=(*)
25
- fail NotImplementedError
25
+ raise NotImplementedError
26
26
  end
27
27
 
28
28
  ##
29
29
  # Toggle mute
30
30
  #
31
31
  def toggle
32
- fail NotImplementedError
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
- fail NotImplementedError
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
- .set_stock(icon)
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
- .set_stock(icon)
25
+ .set_stock(icon)
26
26
  end
27
27
 
28
28
  def status_icon
data/lib/volay/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Volay module
2
2
  module Volay
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'.freeze
4
4
  end
@@ -13,7 +13,7 @@ module Volay
13
13
  @app = app
14
14
 
15
15
  methods.each do |name|
16
- next unless name.match(/^on_/)
16
+ next unless name =~ /^on_/
17
17
  @app.signals_list[name.to_s] = method(name)
18
18
  end
19
19
  end
@@ -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
- .geometry
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
- if (rectangle.y + rectangle.height + window_height <=
79
- monitor.y + monitor.height)
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 (rectangle.x + window_width <= monitor.x + monitor.width)
84
- posx = rectangle.x
85
- else
86
- posx = monitor.x + monitor.width - window_width
87
- end
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
 
@@ -9,7 +9,7 @@ module Volay
9
9
  #
10
10
  def on_system_tray_window_show
11
11
  @app.get_object('volume_adjustement')
12
- .value = @app.mixer.percent
12
+ .value = @app.mixer.percent
13
13
  @app.utils.update_status_icon
14
14
  end
15
15
 
@@ -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(0777, '/usr/bin/ruby')
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(0777, "/usr/bin/#{prog}")
50
+ File.chmod(0o777, "/usr/bin/#{prog}")
51
51
  end
52
52
 
53
53
  it 'should not return pulseaudio' do
data/volay.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.required_ruby_version = '>= 1.9.3'
16
16
 
17
- s.add_dependency 'mixlib-cli', '~>1.5'
17
+ s.add_dependency 'mixlib-cli', '=1.5.0'
18
18
  s.add_dependency 'mixlib-shellout', '~>2.2'
19
19
  s.add_dependency 'gtk3', '~>3.0'
20
20
 
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.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-01-14 00:00:00.000000000 Z
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: '1.5'
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: '1.5'
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.4.8
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: