Class: Sanic
- Inherits:
-
Object
- Object
- Sanic
- Defined in:
- lib/sanic.rb
Class Method Summary collapse
Class Method Details
.play ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sanic.rb', line 4 def self.play song = File.('../sanic.mp3', __FILE__) logo = File.('../sanic.txt', __FILE__) os = Launchy::Application.new.host_os_family.host_os puts File.open(logo).each_line { |line| puts line } case os when /windows/ `start #{ song }` when /darwin/ `afplay #{ song }` when /nix/ `aplay #{ song }` when /linux/ `mpg321 -q #{ song }` when /cygwin/ `cygstart #{ song }` end end |