From c3b34b1693e7b35841d87dae0dce8ccecebe9008 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 20 Jan 2022 18:34:16 +0000 Subject: require Ruby 2.3+ This allows us to jettison a bunch of compatibility code since we've started using Etc.nprocessors and String#- (uminus) in more places. The Ruby core team doesn't support <= 2.5, even. --- lib/dtas.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib/dtas.rb') diff --git a/lib/dtas.rb b/lib/dtas.rb index 1eac704..eb8f49d 100644 --- a/lib/dtas.rb +++ b/lib/dtas.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true @@ -9,15 +9,8 @@ module DTAS # try to use the monotonic clock in Ruby >= 2.1, it is immune to clock # offset adjustments and generates less garbage (Float vs Time object) # :stopdoc: - begin + def self.now # :nodoc: ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - def self.now # :nodoc: - ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - end - rescue NameError, NoMethodError - def self.now # :nodoc: - Time.now.to_f # Ruby <= 2.0 - end end @null = nil @@ -48,7 +41,5 @@ module DTAS # :startdoc: end -require_relative 'dtas/compat_onenine' -require_relative 'dtas/spawn_fix' require_relative 'dtas/encoding' DTAS.extend(DTAS::Encoding) -- cgit v1.2.3-24-ge0c7