lib/watchr.rb in watchr-0.5.4 vs lib/watchr.rb in watchr-0.5.5
- old
+ new
@@ -20,14 +20,21 @@
autoload :Base, 'watchr/event_handlers/base'
autoload :Unix, 'watchr/event_handlers/unix'
autoload :Portable, 'watchr/event_handlers/portable'
end
+ VERSION = '0.5.5'
+
class << self
attr_accessor :options
attr_accessor :handler
+ # backwards compatibility
+ def version #:nodoc:
+ Watchr::VERSION
+ end
+
# Options proxy.
#
# Currently supported options:
# * debug<Boolean> Debugging state. More verbose.
#
@@ -82,16 +89,19 @@
# ===== Returns
# handler<Class>:: handler class for current architecture
#
def handler
@handler ||=
- #case ENV['HANDLER'] || RUBY_PLATFORM
case ENV['HANDLER'] || Config::CONFIG['host_os']
when /mswin|windows|cygwin/i
Watchr::EventHandler::Portable
when /sunos|solaris|darwin|mach|osx|bsd|linux/i, 'unix'
- #Watchr::EventHandler::Unix
- Watchr::EventHandler::Portable
+ begin
+ require 'rev'
+ Watchr::EventHandler::Unix
+ rescue LoadError, RuntimeError
+ Watchr::EventHandler::Portable
+ end
else
Watchr::EventHandler::Portable
end
end
end