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/compat_onenine.rb | 17 ----------------- lib/dtas/partstats.rb | 3 +-- lib/dtas/pipeline.rb | 5 +---- lib/dtas/process.rb | 3 +-- lib/dtas/spawn_fix.rb | 10 ---------- 5 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 lib/dtas/compat_onenine.rb delete mode 100644 lib/dtas/spawn_fix.rb (limited to 'lib/dtas') diff --git a/lib/dtas/compat_onenine.rb b/lib/dtas/compat_onenine.rb deleted file mode 100644 index b65ea50..0000000 --- a/lib/dtas/compat_onenine.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2013-2020 all contributors -# License: GPL-3.0+ - -# Make Ruby 1.9.3 look like Ruby 2.0.0 to us -# This exists for Debian wheezy users using the stock Ruby 1.9.3 install. -# We'll drop this interface when Debian wheezy (7.0) becomes unsupported. -class String # :nodoc: - def b # :nodoc: - dup.force_encoding(Encoding::BINARY) - end -end unless String.method_defined?(:b) - -def IO # :nodoc: - def self.pipe # :nodoc: - super.each { |io| io.close_on_exec = true } - end -end if RUBY_VERSION.to_f <= 1.9 diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb index 45eff34..8e9ee95 100644 --- a/lib/dtas/partstats.rb +++ b/lib/dtas/partstats.rb @@ -1,5 +1,5 @@ # -*- encoding: binary -*- -# Copyright (C) 2013-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true require_relative '../dtas' @@ -11,7 +11,6 @@ require_relative 'sigevent' class DTAS::PartStats # :nodoc: CMD = 'sox "$INFILE" -n $TRIMFX $SOXFX stats $STATSOPTS' include DTAS::Process - include DTAS::SpawnFix attr_reader :key_idx attr_reader :key_width diff --git a/lib/dtas/pipeline.rb b/lib/dtas/pipeline.rb index eb2af89..1bebe87 100644 --- a/lib/dtas/pipeline.rb +++ b/lib/dtas/pipeline.rb @@ -1,12 +1,9 @@ -# Copyright (C) 2017-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true require_relative '../dtas' -require_relative 'spawn_fix' module DTAS::Pipeline # :nodoc: - include DTAS::SpawnFix - # Process.spawn wrapper which supports running Proc-like objects in # a separate process, not just external commands. # Returns the pid of the spawned process diff --git a/lib/dtas/process.rb b/lib/dtas/process.rb index f93a8c4..d00716f 100644 --- a/lib/dtas/process.rb +++ b/lib/dtas/process.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 all contributors +# Copyright (C) all contributors # License: GPL-3.0+ # frozen_string_literal: true require 'io/wait' @@ -11,7 +11,6 @@ require_relative 'nonblock' module DTAS::Process # :nodoc: PIDS = {} include DTAS::XS - include DTAS::SpawnFix def self.reaper begin diff --git a/lib/dtas/spawn_fix.rb b/lib/dtas/spawn_fix.rb deleted file mode 100644 index b586130..0000000 --- a/lib/dtas/spawn_fix.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2013-2020 all contributors -# License: GPL-3.0+ -# workaround for older Rubies: https://bugs.ruby-lang.org/issues/8770 -module DTAS::SpawnFix # :nodoc: - def spawn(*args) - super(*args) - rescue Errno::EINTR - retry - end if RUBY_VERSION.to_f <= 2.1 -end -- cgit v1.2.3-24-ge0c7