taunt 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +6 -2
  2. data/VERSION +1 -1
  3. data/lib/taunt.rb +7 -9
  4. data/taunt.gemspec +2 -2
  5. metadata +3 -3
data/README.md CHANGED
@@ -4,7 +4,7 @@ taunt
4
4
  Need your computer to hurl abuse at you? Broke the build? Dude walked in everyone hates?
5
5
  Use this gem to TAUNT!
6
6
 
7
- Plays whatever sounds you dump into `~/.taunt` at random whenever you execute `taunt`
7
+ Plays whatever sounds you dump into `~/.taunt` at random whenever you execute `taunt` _(ideally, you'd throw all the [Team Fortress 2](http://www.teamfortress.com/) sound files in there)_
8
8
 
9
9
  Hate it? Hit me up on [@madlep](http://twitter.com/#!/madlep) or spam me on [julian.doherty.ml@gmail.com](mailto:julian.doherty.ml@gmail.com)
10
10
 
@@ -22,7 +22,11 @@ Alternatively, just supply an argument if you want to play from a different dire
22
22
 
23
23
  Todo
24
24
  ----
25
- - Only works on OS X so far (feel free to patch if you want Windows/Linux/whatever support)
25
+ - Works on OS X (via [afplay](http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/afplay.1.html)) and Linux (via [aplay](http://linux.die.net/man/1/aplay)). (feel free to patch if you want Windows/whatever support)
26
+
27
+ Credits
28
+ -------
29
+ [madlep](https://github.com/madlep) original code, [chobomuffin](https://github.com/chobomuffin) Linux support
26
30
 
27
31
  Copyright
28
32
  ---------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/lib/taunt.rb CHANGED
@@ -7,24 +7,22 @@ class Taunt
7
7
 
8
8
  def taunt!
9
9
  taunt = @taunts[rand(@taunts.length)]
10
- unless darwin?
11
- puts "only do OS X so far sorry :("
12
- exit 1
13
- end
14
-
15
10
  unless taunt
16
11
  puts "you need to put some taunt sounds in #{@taunt_home}"
17
12
  exit 1
18
13
  end
19
14
  process = fork do
20
- `afplay #{taunt} &`
15
+ Process.daemon
16
+ `#{play_command} #{taunt} &`
21
17
  end
22
18
  Process.detach(process)
23
19
  end
24
20
 
25
21
  private
26
- def darwin?
27
- RUBY_PLATFORM =~ /darwin/
22
+ def play_command
23
+ %w{afplay aplay}.each {|command|
24
+ return command if system("which #{command}")
25
+ }
28
26
  end
29
27
 
30
28
  def supported_formats
@@ -33,4 +31,4 @@ class Taunt
33
31
  %w{m4a m4b m4p mp3 caf aiff au sd2 wav snd amr}
34
32
  end
35
33
 
36
- end
34
+ end
data/taunt.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{taunt}
8
- s.version = "0.1.1"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julian Doherty (madlep)"]
12
- s.date = %q{2011-05-17}
12
+ s.date = %q{2011-05-18}
13
13
  s.default_executable = %q{taunt}
14
14
  s.description = %q{Need your computer to hurl abuse at you? Broke the build? Dude walked in everyone hates? use this gem to taunt them}
15
15
  s.email = %q{julian.doherty.ml@gmail.com}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: taunt
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Julian Doherty (madlep)
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-17 00:00:00 +10:00
13
+ date: 2011-05-18 00:00:00 +10:00
14
14
  default_executable: taunt
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -95,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
- hash: -1869860378632372882
98
+ hash: -2857068910153263608
99
99
  segments:
100
100
  - 0
101
101
  version: "0"