about summary refs log tree commit homepage
path: root/lib/dtas.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-01-20 18:34:16 +0000
committerEric Wong <e@80x24.org>2022-01-21 19:54:41 +0000
commitc3b34b1693e7b35841d87dae0dce8ccecebe9008 (patch)
treed83d7e9f368a4817f6682165b47148ca27b1998b /lib/dtas.rb
parentf0da7e664140cb1000d22db5509168b3d82b728b (diff)
downloaddtas-c3b34b1693e7b35841d87dae0dce8ccecebe9008.tar.gz
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.
Diffstat (limited to 'lib/dtas.rb')
-rw-r--r--lib/dtas.rb13
1 files changed, 2 insertions, 11 deletions
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 <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 # 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)