humpday 1.0.0 → 1.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/README.md +5 -1
- data/bin/humpday +1 -1
- data/lib/humpday/version.rb +1 -1
- data/lib/humpday.rb +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713e4c636e0d5a5ecbc3bd919989c9e4a61aedcc
|
4
|
+
data.tar.gz: 30b223624e8b671764020e818a827372c8f2221a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f2e0da9cb44c122b3b0f3859eab2a222f2fae0e6da921eb4e483e3961e39725c860ab04e1c22b4992a0dbb6a5c30bf81ba61c8152075fc4b053f7802aba53bd
|
7
|
+
data.tar.gz: 8cbffb0fc86c8f6b7c17fb46cfa4127a5672040303f17140c8350033c2408730caa77bf18d23944f74e94146e89624e06227a8c485cb7e0e37bb2ee7cce276cb
|
data/README.md
CHANGED
data/bin/humpday
CHANGED
@@ -9,7 +9,7 @@ elsif ARGV.size == 1 && ARGV[0] != '-h' && ARGV[0] != 'help' && ARGV[0] != '--he
|
|
9
9
|
begin
|
10
10
|
Humpday.play ARGV[0]
|
11
11
|
rescue Humpday::UnknownSoundError
|
12
|
-
abort "#{ARGV[0]}
|
12
|
+
abort "#{ARGV[0]} does not match a known sound"
|
13
13
|
end
|
14
14
|
else
|
15
15
|
puts Humpday.usage
|
data/lib/humpday/version.rb
CHANGED
data/lib/humpday.rb
CHANGED
@@ -7,7 +7,7 @@ module Humpday
|
|
7
7
|
SOUNDS = {
|
8
8
|
'uhoh' => 'uhoh',
|
9
9
|
'guess_what_day' => 'guess_what_day_it_is',
|
10
|
-
'
|
10
|
+
'guess_what_day_2'=> 'guess_what_day_it_is2',
|
11
11
|
'huh' => 'huh_anybody',
|
12
12
|
'cmon' => 'aw_cmon_i_know_you_can_hear_me',
|
13
13
|
'laugh' => 'laugh',
|
@@ -15,7 +15,9 @@ module Humpday
|
|
15
15
|
'humpday' => 'humpday'
|
16
16
|
}
|
17
17
|
|
18
|
-
def self.play
|
18
|
+
def self.play name
|
19
|
+
sound_name = self.fuzzy_find name
|
20
|
+
raise UnknownSoundError if sound_name.nil?
|
19
21
|
sound = SOUNDS.fetch(sound_name) { raise UnknownSoundError }
|
20
22
|
audio_file = File.expand_path("../../lib/support/#{sound}.m4a", __FILE__)
|
21
23
|
Sounder.play audio_file
|
@@ -29,11 +31,11 @@ module Humpday
|
|
29
31
|
[ "humpday version #{Humpday::VERSION}",
|
30
32
|
"Usage: humpday help (this)",
|
31
33
|
"Usage: humpday random (picks a random sound)",
|
32
|
-
"Usage: humpday <sound name>",
|
34
|
+
"Usage: humpday <sound name> (it will fuzzy match the name)",
|
33
35
|
"Sounds:",
|
34
36
|
" uhoh",
|
35
37
|
" guess_what_day",
|
36
|
-
"
|
38
|
+
" guess_what_day_2",
|
37
39
|
" huh",
|
38
40
|
" cmon",
|
39
41
|
" laugh",
|
@@ -41,4 +43,9 @@ module Humpday
|
|
41
43
|
" humpday"
|
42
44
|
].join "\n"
|
43
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def self.fuzzy_find name
|
49
|
+
SOUNDS.keys.select { |sn| sn.include? name }.first
|
50
|
+
end
|
44
51
|
end
|