diff --git a/lib/timeout_interrupt.rb b/lib/timeout_interrupt.rb index 5c46ff8..438783a 100644 --- a/lib/timeout_interrupt.rb +++ b/lib/timeout_interrupt.rb @@ -1,23 +1,6 @@ require 'ffi/libc' require 'timeout' -# Provided by ffi-libc-lib and extended by this library, if needed. -# Older version of ffi-libc does not provide {FFI::LibC.alarm} -module FFI - module LibC - # @!method alarm(seconds) - # Sets an alarm. After `seconds` it will send an ALRM-signal to this process. - # - # Predefined alarm will be reset and will forget. - # @note Older implementations of ffi-libc does not provide {alarm}, but we need it. - # So we detect, if it is not provided and attach it. - # @param seconds [0] Clears alarm. - # @param seconds [Integer] How many seconds should be waited, before ALRM-signal should be send? - # @return (nil) - attach_function :alarm, [:uint], :uint unless FFI::LibC.respond_to? :alarm - end -end - # Helper module for `TimeoutInterrupt` # @see TimeoutInterrupt module TimeoutInterruptSingleton diff --git a/timeout-interrupt.gemspec b/timeout-interrupt.gemspec index ccdc70e..bbe276e 100644 --- a/timeout-interrupt.gemspec +++ b/timeout-interrupt.gemspec @@ -26,5 +26,5 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.require_paths = ["lib"] - spec.add_runtime_dependency %q + spec.add_runtime_dependency %q, '>= 0.1.1' end