sounder 1.0.0 → 1.0.2
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/README.md +2 -2
- data/lib/sounder/sound.rb +3 -1
- data/lib/sounder/sound_group.rb +1 -2
- data/lib/sounder/version.rb +1 -1
- data/spec/sounder/sound_group_spec.rb +3 -3
- data/spec/sounder/sound_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8df9741d168eeba2db6c05ee1c6d1d9532ecd663
|
4
|
+
data.tar.gz: 1398cba28a6d833eb95fa07869db03492d9aec5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e08ffcd9195685638dffec8ca961151067f31c0b0f0df7a916bbb1c7ecf1988d6a8ec1a637ea4b4537e9047f1aadedc53125b9c01c0abfdf7b45b0cf4e88428
|
7
|
+
data.tar.gz: 9c99e7251d3e7147ee47dc2d3c089d6870d79e84c59710d13aa43afea55463cb8a806ce7c92c49f74f1597ed5e935c419729aabe7501c7e8121511bd9ee94c6c
|
data/README.md
CHANGED
@@ -25,10 +25,10 @@ Or install it yourself as:
|
|
25
25
|
sound = Sounder::Sound.new "/path/to/audio/file"
|
26
26
|
sound.play
|
27
27
|
|
28
|
-
my_group = Sounder::SoundGroup.new
|
28
|
+
my_group = Sounder::SoundGroup.new(
|
29
29
|
:sound_one => File.expand_path('../../lib/support/sound1.m4a', __FILE__),
|
30
30
|
"sound_two" => File.expand_path('../../lib/support/sound2.m4a', __FILE__)
|
31
|
-
|
31
|
+
)
|
32
32
|
my_group.play "tw" # fuzzy matching of names
|
33
33
|
my_group.random # plays a random sound from the group
|
34
34
|
my_group.usage # returns a usage string with all the sound
|
data/lib/sounder/sound.rb
CHANGED
data/lib/sounder/sound_group.rb
CHANGED
@@ -21,13 +21,12 @@ module Sounder
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def usage
|
24
|
-
|
24
|
+
[ "random (picks a random sound)",
|
25
25
|
"<sound name> (it will fuzzy match the name)",
|
26
26
|
"Available sounds:"
|
27
27
|
] + @sounds.keys.map do |sound|
|
28
28
|
" #{sound}"
|
29
29
|
end
|
30
|
-
usage.join "\n"
|
31
30
|
end
|
32
31
|
|
33
32
|
|
data/lib/sounder/version.rb
CHANGED
@@ -54,9 +54,9 @@ describe Sounder do
|
|
54
54
|
describe '#usage' do
|
55
55
|
it "returns usage info in a string" do
|
56
56
|
group = Sounder::SoundGroup.new sounds
|
57
|
-
group.usage.should include "random"
|
58
|
-
group.usage.should include "sound_a"
|
59
|
-
group.usage.should include "sound_b"
|
57
|
+
group.usage.should include "random (picks a random sound)"
|
58
|
+
group.usage.should include " sound_a"
|
59
|
+
group.usage.should include " sound_b"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/spec/sounder/sound_spec.rb
CHANGED
@@ -15,6 +15,11 @@ describe Sounder do
|
|
15
15
|
sound.should_receive(:system).with %{/usr/bin/afplay "fake/file.m4a" &}
|
16
16
|
sound.play
|
17
17
|
end
|
18
|
+
it "is not super insecure" do
|
19
|
+
bad_sound = Sounder::Sound.new '";echo doing bad things;"'
|
20
|
+
bad_sound.should_receive(:system).with %{/usr/bin/afplay \"\\\"\\;echo\\ doing\\ bad\\ things\\;\\\"\" &}
|
21
|
+
bad_sound.play
|
22
|
+
end
|
18
23
|
end
|
19
24
|
end
|
20
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sounder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Zaninovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|