2006-10-19 Daniel Brockman Release 0.3. * Rakefile: No longer depend on rubygems. * gemspec.rb: Move contents into `Rakefile'. * VERSION: New file. * setup.rb: New file (copied from upstream). * README.utf-8: Update to reflect changes. * lib/event-loop/timer.rb: Make lots and lots of changes without having enough patience to document them here. * lib/event-loop/signal-system.rb (SignalEmitterModule#define_signal_handler): Define `prehandle_...' and `posthandle_...' instead of `handle_...' and `after_handle_...'. (SignalEmitter#__signal__): Invoke `prehandle_...' and `posthandle_...'. 2006-04-23 Daniel Brockman * lib/event-loop/timer.rb: New file extracted from `lib/event-loop/event-loop.rb'. (Timer#initialize): New instance variable `@alarm_handler'. (Timer#replace_alarm_handler): New method. (Timer#initialize, Timer#restart, Timer#start): Use it. (Timer#initialize): Remove option parameter `:start?'. (TimerTest#test_start_monitoring_timer_while_running): Explicitly call `#start'. (Timer#start, Timer#stop): Set `@running'. (Timer#stop): Don't clear `@start_time'. (Timer#stopped?, Timer#running?): Check `@running' instead of `@start_time'. (Timer#started?): New method. (Timer#start_time, Timer#end_time, Timer#time_left, Timer#ready?): Fail if `@start_time' is nil. (Timer#end_time=, Timer#time_left=): New methods. (Timer#initialize): Make `interval' a mandatory positional parameter. Remove `:interval' keyword parameter. * lib/event-loop/io.rb: New file extracted from `lib/event-loop/event-loop.rb'. * lib/event-loop/event-loop.rb (EventLoop::Utitilies.validate_keyword_arguments): New method extracted from EventLoop::Timer::initialize. (EventLoop#initialize): Document why we have to explicitly extend the notify source with EventLoop::Watchable. 2006-02-06 Daniel Brockman * lib/event-loop/event-loop.rb (Numeric#seconds, Numeric#minutes) (Numeric#hours, Numeric#days, Numeric#weeks, Numeric#years) (Integer#years): New methods. 2006-02-05 Daniel Brockman * Rakefile (check): Run tests with `ruby -w'. Suggested by Tilman Sauerbeck. 2006-02-05 Tilman Sauerbeck * lib/event-loop/event-loop.rb (EventLoop#restart) (EventLoop#start): Add parentheses (this avoids warnings). 2006-01-31 Daniel Brockman Release 0.2. This time I won't use Ruby 1.8.3 to build the Gem package. Thanks to Tilman Sauerbeck for pointing out that problem. * lib/event-loop/event-loop.rb (Timer#interval=): Only invoke EventLoop#check_timer when the timer is running. (Timer#start, Timer#restart): Accept blocks (for convenience). (EventLoop#monitor_timer): Actually check the timer. (TimerTest): Create new event loops for each test. (TimerTest::test_start_monitoring_timer_while_running): New test. (Time.measure): New method. * Rakefile (README): Convert Unicode copyright symbols to conventional ASCII ones. Add note warning that README is automatically generated. * GFDL: New file. * README.utf-8: License this document under the GFDL. (Table of Contents): New section. (time-stamp-format, time-stamp-start, time-stamp-end): New local variables (for Emacs). 2006-01-30 Daniel Brockman * README.utf-8 (Event Sources): New section. Suggested by Luke Kanies. * lib/event-loop/event-loop.rb (Timer#end_time): Raise an exception if the timer is not running. (TimerTest#test_monitor_unstarted_timer): New test case. (Timer#restart, Timer#sound_alarm, Timer#start, Timer#stop) (EventLoop#wake_up): For convenience, return self. 2006-01-25 Daniel Brockman Release 0.1. * README.utf-8: Improve the documentation, explaining more in-depth how IO objects and timers interact with event loops, and providing some meaningful examples, including one that shows how to use the `IO#will_block' property, and one at the end that provides an outline for the typical application. * lib/event-loop/event-loop.rb (Timer.new): Fail if given unrecognized keyword arguments. Suggested by Luke Kanies. (Timer): Add reader for property `event_loop'. (EventLoop): Rename property `sleeping?' to `asleep?', for symmetry with `awake?'. (EventLoop.with_current): Warn the user if `EventLoop.current' is permanently changed within the dynamic extent of `with_current'. 2005-11-17 Daniel Brockman Release 0.0.20051116. * lib/event-loop/signal-system.rb (SignalEmitterModule.extended): Use `fcall' instead of `send' on Ruby 1.9. 2005-09-28 Daniel Brockman Release 0.0.20050928. * lib/event-loop/signal-system.rb (SignalEmitter#__maybe_initialize_signal_emitter): Avoid warnings about using an uninitialized instance variable. 2005-09-04 Daniel Brockman Release 0.0.20050904. * Rakefile (upload): Print an error message if this target is used by someone other than the maintaner. (README): Warn if the Unicode string handling is broken. 2005-09-04 Tilman Sauerbeck * Rakefile: Add `install' target. 2005-08-28 Daniel Brockman Release 0.0.20050829.0000. * lib/event-loop/signal-system.rb (SignalEmitterClass): Rename to SignalEmitterModule. (SignalEmitterModule.extended): New method. 2005-08-26 Daniel Brockman * lib/event-loop/signal-system.rb (SignalEmitterClass#define_signal_handler): New method. (SignalEmitterClass#define_signal): Use it. (SignalObserver#absorb_signals): New method. (SignalObserver#absorb_signal, SignalObserver#map_signal): New soft aliases. * lib/event-loop/better-definers.rb (Module#define_guarded_writers): Pass the block along to `guard_writers' (fixes an obvious bug). * lib/event-loop/signal-system.rb (SignalEmitter): New attribute `allow_dynamic_signals?'. (SignalEmitter#__signal__): Fail for undefined signals unless these are explicitly allowed (by the new attribute). 2005-08-25 Daniel Brockman Release 0.0.20050825.1600. * README.utf-8: Update installation instructions, thank Tilman some more for the gem specification, and add a section explaining what timer tolerances are for. * lib/event-loop.rb: New file. * event-loop.rb, signal-system.rb, better-definers.rb: Move source files to `lib/event-loop/'. Change `require' statements accordingly. * lib/, lib/event-loop/: New directories. * Rakefile: Add new `upload' target. * Makefile: Move `check' target to Rakefile and delete. * gemspec.rb: Clean up and copyedit. :-) 2005-08-23 Tilman Sauerbeck * Rakefile: New file. * gemspec.rb: New file. 2005-08-23 Daniel Brockman * event-loop.rb (EventLoop#select, EventLoop#run): Don't call `maybe_initialize_pipe'. * event-loop.rb (EventLoop#maybe_initialize_pipe): Remove unused method. 2005-08-21 Daniel Brockman Release 0.0.20050821.2356. * README.utf-8: Fix typos. * better-definers.rb (Module#define_soft_aliases): Parenthesize splatted arguments to avoid warnings. * event-loop.rb (EventLoop#initialize): Initialize @awake. 2005-08-20 Daniel Brockman * signal-system.rb (SignalObserver#ignore_signal): Fix fatal bug. (SignalEmitter#__signal__): Don't pass `self' as first argument. * better-definers.rb (Module#guard_writers): Use `define_hard_alias' rather than `define_alias'. * signal-system.rb: Likewise. * event-loop.rb: Use qualified names in `require'. (EventLoop#maybe_initialize_pipe): Use `sysread(256)' instead of `read' to read from the notification pipe. * Makefile (check): Pass `-I..' option to `ruby'. 2005-08-19 Daniel Brockman * README.utf-8 (IO Events): Update documentation to reflect the changes related to Watchable::Automatic. * event-loop.rb (Watchable::Automatic): New module. (Watchable#remove_signal_handler, Watchable#add_signal_handler): Move to new module. (Watchable#monitor_events, Watchable#ignore_events): New methods. (Watchable#close_read, Watchable#close_write) (Watchable#close): Use them. (IO#on_readable, IO#on_writable, IO#on_exceptional): Extend with Watchable::Automatic instead of just Watchable. (EventLoop#maybe_initialize_pipe): Use `read' instead of `sysread(1)' to read from the notification pipe. (Symbol#io_state?): New convenience method. * event-loop.rb (EventLoop#check_timer): New method. (EventLoop#monitor_timer): Use it. (EventLoop#select): New private method. (EventLoop#iterate): Refactor using new `select' helper method. * event-loop.rb (Timer.new): New option `event_loop'. Each timer is now associated with exactly one event loop. (Timer#fire_alarm): Only restart the timer if it is still running when the alarm returns. (Timer#start, Timer#stop): Use @event_loop instead of EventLoop. (Timer#fire_alarm): Rename to `sound_alarm'. (Timer#stopped?, Timer#running?): Instead of checking @running, assume that @start_time is nil iff the timer is running. * event-loop.rb (Timer#initialize): Allow a single numeric argument as a shorthand for specifying the interval. (Timer#interval=): New method. * ChangeLog: New file.