Module: Utils::Timer Private
- Defined in:
- utils/timer.rb
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Class Method Summary collapse
- .remaining(time) ⇒ Float, ... private
- .remaining!(time) ⇒ Float, ... private
Class Method Details
.remaining(time) ⇒ Float, ...
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
9 10 11 12 13 |
# File 'utils/timer.rb', line 9 def self.remaining(time) return unless time [0, time - Time.now].max end |
.remaining!(time) ⇒ Float, ...
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
16 17 18 19 20 21 |
# File 'utils/timer.rb', line 16 def self.remaining!(time) r = remaining(time) raise Timeout::Error if r && r <= 0 r end |