pouf 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pouf.rb +20 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5d6ea2b042746cd8f4ed374838abc96ab1fe545
4
- data.tar.gz: a30c9057a1c7f67611fffc8f1e66bcd0b5a1da7b
3
+ metadata.gz: 9d9038bd7008ea73958eaefddc1dfc420c06bbf1
4
+ data.tar.gz: 100f3bc0862b5b0df28ad56ee2be12dd7e377dc5
5
5
  SHA512:
6
- metadata.gz: 3575ca079b5cec0f779829a8e1f9f8c3ab702d36e991271f54d7b70fd69eca9534ab6e32e9222721babcc78e991edcc97ae0de1054aa07fd64d08cc165d11d22
7
- data.tar.gz: 2acc7c2e46d31cd3e8f40d140fc3242acf6af57225cf775e39f2c9b060ce0b596933eb71c0c3a7988a1a4a63d961b18b75baa267c494aaf0d939a0feff2eefef
6
+ metadata.gz: f30fb1732e679e9cdbe2c1c400bc8b10a064f7d842fab03ddecf97339684a1b77c2313841df0b7c6c6d8620e23477d84bb658a8a7a18115568e5dfa7dd31e08e
7
+ data.tar.gz: cac9e4f33153cf0db4b0999a4f6652afac426db5f2cc8f0efa5c91a34a94214b0c6a70915f4652743eae0e96043e36e512a4e6881f9806df16882028103e699e
@@ -9,12 +9,29 @@ module Pouf
9
9
  SOUNDS_DIR = File.expand_path("~/.pouf/sounds")
10
10
 
11
11
  def version
12
- '0.1.0'
12
+ '0.1.1'
13
+ end
14
+
15
+ def play_cmd
16
+ return ENV['POUF_CMD'].split(' ') if ENV['POUF_CMD']
17
+ case RUBY_PLATFORM
18
+ when /darwin/ then ['afplay']
19
+ when /linux/ then ['mpg123', '-q']
20
+ else nil
21
+ end
13
22
  end
14
23
 
15
24
  def play_sound filename
16
- # only OSX for now
17
- system 'afplay', filename if filename
25
+ return unless filename
26
+
27
+ cmd = play_cmd
28
+
29
+ if cmd
30
+ system *cmd, filename
31
+ else
32
+ puts 'pouf is unsupported for your platform for now'
33
+ end
34
+
18
35
  end
19
36
 
20
37
  def alias2filename name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pouf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baptiste Fontaine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-23 00:00:00.000000000 Z
11
+ date: 2014-01-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Quickly play random short sounds from the command-line
14
14
  email: batifon@yahoo.fr