humpday 0.0.4 → 1.0.0

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: 56e61a97678b9c0958360f7669bf5416892c193c
4
- data.tar.gz: 319b3864b7e7389f1c91a9d62ba3b9822061862d
3
+ metadata.gz: 0d91f0cc751ee2997fe4d9b90d4d01a9b440e27a
4
+ data.tar.gz: 795ceb4d2b350e99ce723a2bd1fcd7a4fac1aff6
5
5
  SHA512:
6
- metadata.gz: a2ac5dbb5e07cd2bae2cf69f043017a618667e2e60164ff004ba2ade539a4268323e4271cec1f977ca1b9b96be0c4da531fe24169addab66c4235889d07374a7
7
- data.tar.gz: 2d5f9ff5e04e720b37c65c55f5a0af28b3675ef214453eb16ec21f87cf3dbc72b0c5a60459f6a80519552dff25e16065ced29f874dc094fe8b80efe5a3b385a8
6
+ metadata.gz: 0740764b7a1b81323f865ec781ed5560cdcf314bba54dacda19bab3d05b041d159832753fa11e7c35ffef27e6c863311ac1f4eeab1c8f6d5c87b952ef5030fee
7
+ data.tar.gz: c5b39d238a02739168b6965234dc1796f0281a86041132acc135eec656028bbebdf02a7c71526da1196bd3352e812891ccf74769f7967385dd70e516a1e9967a
data/bin/humpday CHANGED
@@ -1,8 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'sounder'
4
+ require_relative '../lib/humpday'
4
5
 
5
- audio_file = File.expand_path('../../lib/support/humpday.m4a', __FILE__)
6
+ if ARGV.size == 1 && ARGV[0] == 'random'
7
+ Humpday.random
8
+ elsif ARGV.size == 1 && ARGV[0] != '-h' && ARGV[0] != 'help' && ARGV[0] != '--help'
9
+ begin
10
+ Humpday.play ARGV[0]
11
+ rescue Humpday::UnknownSoundError
12
+ abort "#{ARGV[0]} is not a known sound"
13
+ end
14
+ else
15
+ puts Humpday.usage
16
+ end
6
17
 
7
- # Sounder::System.set_volume 100
8
- Sounder.play audio_file
@@ -1,3 +1,3 @@
1
1
  module Humpday
2
- VERSION = "0.0.4"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/humpday.rb ADDED
@@ -0,0 +1,44 @@
1
+ require 'humpday/version'
2
+
3
+ module Humpday
4
+
5
+ class UnknownSoundError < ArgumentError; end
6
+
7
+ SOUNDS = {
8
+ 'uhoh' => 'uhoh',
9
+ 'guess_what_day' => 'guess_what_day_it_is',
10
+ 'guess_what_day2' => 'guess_what_day_it_is2',
11
+ 'huh' => 'huh_anybody',
12
+ 'cmon' => 'aw_cmon_i_know_you_can_hear_me',
13
+ 'laugh' => 'laugh',
14
+ 'whoowhoa' => 'whoowhoa',
15
+ 'humpday' => 'humpday'
16
+ }
17
+
18
+ def self.play sound_name
19
+ sound = SOUNDS.fetch(sound_name) { raise UnknownSoundError }
20
+ audio_file = File.expand_path("../../lib/support/#{sound}.m4a", __FILE__)
21
+ Sounder.play audio_file
22
+ end
23
+
24
+ def self.random
25
+ self.play SOUNDS.keys.sample
26
+ end
27
+
28
+ def self.usage
29
+ [ "humpday version #{Humpday::VERSION}",
30
+ "Usage: humpday help (this)",
31
+ "Usage: humpday random (picks a random sound)",
32
+ "Usage: humpday <sound name>",
33
+ "Sounds:",
34
+ " uhoh",
35
+ " guess_what_day",
36
+ " guess_what_day2",
37
+ " huh",
38
+ " cmon",
39
+ " laugh",
40
+ " whoowhoa",
41
+ " humpday"
42
+ ].join "\n"
43
+ end
44
+ end
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humpday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 1.0.0
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-07-31 00:00:00.000000000 Z
11
+ date: 2013-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sounder
@@ -67,8 +67,16 @@ files:
67
67
  - Rakefile
68
68
  - bin/humpday
69
69
  - humpday.gemspec
70
+ - lib/humpday.rb
70
71
  - lib/humpday/version.rb
72
+ - lib/support/aw_cmon_i_know_you_can_hear_me.m4a
73
+ - lib/support/guess_what_day_it_is.m4a
74
+ - lib/support/guess_what_day_it_is2.m4a
75
+ - lib/support/huh_anybody.m4a
71
76
  - lib/support/humpday.m4a
77
+ - lib/support/laugh.m4a
78
+ - lib/support/uhoh.m4a
79
+ - lib/support/whoowhoa.m4a
72
80
  homepage: ''
73
81
  licenses:
74
82
  - MIT