Class: Taunt
- Inherits:
-
Object
- Object
- Taunt
- Defined in:
- lib/taunt.rb
Instance Method Summary collapse
-
#initialize(taunt_home) ⇒ Taunt
constructor
A new instance of Taunt.
- #taunt! ⇒ Object
Constructor Details
#initialize(taunt_home) ⇒ Taunt
Returns a new instance of Taunt.
3 4 5 6 |
# File 'lib/taunt.rb', line 3 def initialize(taunt_home) @taunt_home = taunt_home @taunts = Dir.glob("#{taunt_home}/.taunt/**/*.{#{supported_formats.join(',')}}") end |
Instance Method Details
#taunt! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/taunt.rb', line 8 def taunt! taunt = @taunts[rand(@taunts.length)] unless taunt puts "you need to put some taunt sounds in #{@taunt_home}" exit 1 end process = fork do Process.daemon `#{play_command} #{taunt} &` end Process.detach(process) end |