Skip to content

Commit

Permalink
Renamed main file.
Browse files Browse the repository at this point in the history
Now papagaio will work on both linux and mac.
  • Loading branch information
marano committed Feb 24, 2011
1 parent 7295267 commit 6b40ae4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
14 changes: 14 additions & 0 deletions os_functions.rb
@@ -0,0 +1,14 @@
module OsFunctions

def is_mac?
RUBY_PLATFORM.downcase.include?("darwin")
end

def is_windows?
RUBY_PLATFORM.downcase.include?("mswin")
end

def is_linux?
RUBY_PLATFORM.downcase.include?("linux")
end
end
27 changes: 27 additions & 0 deletions papagaio.rb
@@ -0,0 +1,27 @@
require 'rubygems'
require 'bundler'

Bundler.require

require 'os_functions'

scheduler = Rufus::Scheduler.start_new

include OsFunctions

lines = File.readlines 'lines.txt'

def say line
if is_mac?
system "say \"#{line}\""
elsif is_linux?
system "espeak \"#{line}\""
end
end

scheduler.every '5s' do
say "alo"
end

scheduler.join

13 changes: 0 additions & 13 deletions scheduler.rb

This file was deleted.

0 comments on commit 6b40ae4

Please sign in to comment.