Merge pull request #17 from dkg/master

tune build framework for more compile/test flexibility
- don't try to access xdo until after we verify it's not null. (#18,
  reported by zarelit)
- consume regexp argument only if present. This fixes a warning reported
in #14.

Tests showing no more warning:

  # find all windows with pid 2593
  % ./xdotool search --pid 2593
  54525953
  54527731
  54525955

  # find all windows with pid 2593 *and* name matches 'tmux'
  % ./xdotool search --all --name --pid 2593 tmux
  54525955

  # find all visible windows with pid 2593
  % ./xdotool search --onlyvisible --pid 2593
  54525955
Fix handling of empty files in type command.
Merge pull request #29 from calmofthestorm/type_file_bug

Fix handling of empty files in type command.
Add --repeat and --repeat-delay to allow repetition of a key sequence
with an optional delay in between each full sequence.
Fix sending wrong keys when using multiple keyboard layouts

This patch fixes following bugs.
https://code.google.com/p/semicomplete/issues/detail?id=13
https://code.google.com/p/semicomplete/issues/detail?id=21
https://code.google.com/p/semicomplete/issues/detail?id=41#c1
https://code.google.com/p/semicomplete/issues/detail?id=76
Merge pull request #39 from kealthou/fix_multiple_layout_issue

Fix sending wrong keys when using multiple keyboard layouts
Use relative paths when requiring xdo_test_helper.rb

The current directory is not in the $LOAD_PATH of more recent versions
of the Ruby interpreter (ruby1.9.1 and ruby2.0). So the location of
the file must be indicated.

Thanks to Cédric Boutillier <boutil@debian.org> for this fix.
pass file descriptors to child processes in test suite

From http://www.ruby-doc.org/core-2.1.2/IO.html#close_on_exec-3D-method:

> Ruby sets close-on-exec flags of all file descriptors by default
>  since Ruby 2.0.0.

This change ensures that the file descriptor used to retrieve the
window ID will be preserved across the exec, otherwise the test suite
hangs.

This change also rewrites the exec() call to avoid one layer of
possible command execution (the shell invocation by xterm itself still
remains).