airhorn 0.0.4 → 0.1.0
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/audio/airhorns.wav +0 -0
- data/bin/airhorn +1 -1
- data/bin/airhorns +4 -0
- data/lib/airhorn.rb +5 -5
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1239f624b5d3532d0ec355a46de50893cb9b543
|
4
|
+
data.tar.gz: d8f67f03a1e1f2ba050c1ba6b032bbfc4bb3a361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8da1431d338058c456781b3732758f99f9776fc142847955cc54ed21918eefec31c7f0ef1a712f2796401a6e6823ed3172c4e1411c1db4fd7f5f6201ac45b546
|
7
|
+
data.tar.gz: 80c497820834603f5c2d5aa0ae29a1a9ae9ac813662f35b401cbbca01e006f8960ad3fca0b5c0212b8f74e1d387a6105cf5c3ec284cae605309168cf8b75d901
|
data/audio/airhorns.wav
ADDED
Binary file
|
data/bin/airhorn
CHANGED
data/bin/airhorns
ADDED
data/lib/airhorn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Airhorn
|
2
|
-
def self.blow (
|
3
|
-
pid = play audio_file_path(
|
2
|
+
def self.blow (file = 'airhorn.wav', duration = 1.5)
|
3
|
+
pid = play audio_file_path(file), duration
|
4
4
|
return if pid.nil?
|
5
5
|
tpid = spawn('printf "B"; while sleep 0.1; do printf "R"; done')
|
6
6
|
Process.wait pid
|
@@ -8,13 +8,13 @@ class Airhorn
|
|
8
8
|
return
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.play (file_path)
|
11
|
+
def self.play (file_path, duration)
|
12
12
|
if system 'command -v afplay >/dev/null 2>&1'
|
13
13
|
# mac
|
14
|
-
spawn("afplay -t
|
14
|
+
spawn("afplay -t #{duration.to_s} #{file_path} >/dev/null 2>&1")
|
15
15
|
elsif system 'command -v aplay >/dev/null 2>&1'
|
16
16
|
# linux
|
17
|
-
spawn("aplay -d
|
17
|
+
spawn("aplay -d #{duration.ceil.to_s} #{file_path} >/dev/null 2>&1")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airhorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kim
|
@@ -14,12 +14,15 @@ description:
|
|
14
14
|
email: christopherjkim@gmail.com
|
15
15
|
executables:
|
16
16
|
- airhorn
|
17
|
+
- airhorns
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
19
20
|
files:
|
20
|
-
- lib/airhorn.rb
|
21
21
|
- audio/airhorn.wav
|
22
|
+
- audio/airhorns.wav
|
22
23
|
- bin/airhorn
|
24
|
+
- bin/airhorns
|
25
|
+
- lib/airhorn.rb
|
23
26
|
homepage: http://github.com/dy-dx/airhorn
|
24
27
|
licenses: []
|
25
28
|
metadata: {}
|
@@ -29,17 +32,17 @@ require_paths:
|
|
29
32
|
- lib
|
30
33
|
required_ruby_version: !ruby/object:Gem::Requirement
|
31
34
|
requirements:
|
32
|
-
- -
|
35
|
+
- - ">="
|
33
36
|
- !ruby/object:Gem::Version
|
34
37
|
version: '0'
|
35
38
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
39
|
requirements:
|
37
|
-
- -
|
40
|
+
- - ">="
|
38
41
|
- !ruby/object:Gem::Version
|
39
42
|
version: '0'
|
40
43
|
requirements: []
|
41
44
|
rubyforge_project:
|
42
|
-
rubygems_version: 2.
|
45
|
+
rubygems_version: 2.2.2
|
43
46
|
signing_key:
|
44
47
|
specification_version: 4
|
45
48
|
summary: BRRRRR
|