hughbien/thyme — pull request #10 by dtinth (2014-10-04 07:30:45+00:00)
Title: Add `tick` hook and `daemon?` method.

This pull request has two parts:

`tick` callback
------------------
For integration with other systems other than Tmux, for example, integration with Mac OS X status bar, a `tick` hook is required.

```ruby
before do
$ui = Gui.new
end

tick do |seconds_left|
$ui.tick(seconds_left)
end

after do |seconds_left|
$ui.destroy
end
```

`daemon?` method
-------------------------
Checking whether Thyme is in daemon mode is useful when you want to do some action that requires $stdin/$stdout access (which is only possible when not running in daemon mode). For example:

```ruby
after do |seconds_left|
$ui.destroy
if seconds_left == 0
unless daemon?
begin
print "Start another Pomodoro?"
gets
exec "thyme"
rescue Interrupt
puts "Bye bye"
end
end
end
end
```