From: Eric Wong <e@80x24.org>
To: dtas-all@nongnu.org
Subject: [PATCH 3/9] dtas: drop unnecessary "require 'yaml'" statements
Date: Sun, 23 Jan 2022 21:37:40 +0000 [thread overview]
Message-ID: <20220123213746.21085-4-e@80x24.org> (raw)
In-Reply-To: <20220123213746.21085-1-e@80x24.org>
We use DTAS.yaml_load to wrap all YAML.*load calls, but
we still need "require 'yaml'" for various .to_yaml calls.
---
bin/dtas-console | 1 -
bin/dtas-msinkctl | 1 -
bin/dtas-player | 3 +--
bin/dtas-readahead | 1 -
bin/dtas-splitfx | 1 -
bin/dtas-tl | 1 -
lib/dtas/edit_client.rb | 1 -
lib/dtas/player.rb | 1 +
lib/dtas/sink.rb | 3 +--
lib/dtas/source/splitfx.rb | 1 -
test/player_integration.rb | 3 +--
test/test_encoding.rb | 1 -
test/test_splitfx.rb | 1 -
test/test_tfx.rb | 1 -
14 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/bin/dtas-console b/bin/dtas-console
index a519ba9..eedd0f0 100755
--- a/bin/dtas-console
+++ b/bin/dtas-console
@@ -11,7 +11,6 @@
require 'dtas/process'
require 'dtas/format'
include DTAS::Process
-require 'yaml'
begin
require 'curses'
rescue LoadError
diff --git a/bin/dtas-msinkctl b/bin/dtas-msinkctl
index 6fb3863..79c7f26 100755
--- a/bin/dtas-msinkctl
+++ b/bin/dtas-msinkctl
@@ -2,7 +2,6 @@
# 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
-require 'yaml'
require 'dtas/unix_client'
usage = "#$0 <active-set|active-add|active-sub|nonblock|active> SINK"
c = DTAS::UNIXClient.new
diff --git a/bin/dtas-player b/bin/dtas-player
index 21bc45f..c926e5f 100755
--- a/bin/dtas-player
+++ b/bin/dtas-player
@@ -1,9 +1,8 @@
#!/usr/bin/env ruby
-# 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
Thread.abort_on_exception = $stderr.sync = $stdout.sync = true
-require 'yaml'
require 'dtas/player'
sock = (ENV["DTAS_PLAYER_SOCK"] || File.expand_path("~/.dtas/player.sock"))
state = (ENV["DTAS_PLAYER_STATE"] ||
diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index 996142c..d3c6e79 100755
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -12,7 +12,6 @@
@ffprobe = 'ffprobe'
@avprobe = 'avprobe'
-require 'yaml'
require 'io/wait'
require 'dtas/unix_client'
require 'dtas/process'
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx
index 05e71e5..6ce6521 100755
--- a/bin/dtas-splitfx
+++ b/bin/dtas-splitfx
@@ -2,7 +2,6 @@
# 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
-require 'yaml'
require 'optparse'
require 'dtas/splitfx'
usage = "#$0 [-n|--dry-run][-j [JOBS]][-s|--silent] SPLITFX_FILE.yml [TARGET]"
diff --git a/bin/dtas-tl b/bin/dtas-tl
index c1af933..2b34937 100755
--- a/bin/dtas-tl
+++ b/bin/dtas-tl
@@ -23,7 +23,6 @@ def fix_enc!(str, enc)
def do_edit(c)
require 'dtas/edit_client'
- require 'yaml'
require 'tempfile'
extend DTAS::EditClient
tmp = Tempfile.new(%w(dtas-tl-edit .txt))
diff --git a/lib/dtas/edit_client.rb b/lib/dtas/edit_client.rb
index 036d036..2bdc4d8 100644
--- a/lib/dtas/edit_client.rb
+++ b/lib/dtas/edit_client.rb
@@ -2,7 +2,6 @@
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'tempfile'
-require 'yaml'
require_relative 'unix_client'
require_relative 'disclaimer'
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index 3db15c3..06ba788 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -2,6 +2,7 @@
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'shellwords'
+require 'yaml'
require_relative '../dtas'
require_relative 'xs'
require_relative 'source'
diff --git a/lib/dtas/sink.rb b/lib/dtas/sink.rb
index 735cdef..966bab4 100644
--- a/lib/dtas/sink.rb
+++ b/lib/dtas/sink.rb
@@ -1,7 +1,6 @@
-# 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
-require 'yaml'
require_relative '../dtas'
require_relative 'pipe'
require_relative 'process'
diff --git a/lib/dtas/source/splitfx.rb b/lib/dtas/source/splitfx.rb
index afeb6a3..2268404 100644
--- a/lib/dtas/source/splitfx.rb
+++ b/lib/dtas/source/splitfx.rb
@@ -1,7 +1,6 @@
# 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
-require 'yaml'
require_relative 'sox'
require_relative '../splitfx'
require_relative '../watchable'
diff --git a/test/player_integration.rb b/test/player_integration.rb
index 4ad0e0c..66d1c6e 100644
--- a/test/player_integration.rb
+++ b/test/player_integration.rb
@@ -1,11 +1,10 @@
-# 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
require './test/helper'
require 'dtas/player'
require 'dtas/state_file'
require 'dtas/unix_client'
-require 'yaml'
require 'tempfile'
require 'shellwords'
require 'timeout'
diff --git a/test/test_encoding.rb b/test/test_encoding.rb
index 666d185..5cd5da7 100644
--- a/test/test_encoding.rb
+++ b/test/test_encoding.rb
@@ -3,7 +3,6 @@
# frozen_string_literal: true
require './test/helper'
require 'dtas'
-require 'yaml'
class TestEncoding < Testcase
def test_encoding
diff --git a/test/test_splitfx.rb b/test/test_splitfx.rb
index e3bd19d..f2e0e09 100644
--- a/test/test_splitfx.rb
+++ b/test/test_splitfx.rb
@@ -1,7 +1,6 @@
# 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
-require 'yaml'
require 'dtas/splitfx'
require 'thread'
require_relative 'helper'
diff --git a/test/test_tfx.rb b/test/test_tfx.rb
index 51b1900..be68079 100644
--- a/test/test_tfx.rb
+++ b/test/test_tfx.rb
@@ -4,7 +4,6 @@
require './test/helper'
require 'dtas/tfx'
require 'dtas/format'
-require 'yaml'
class TestTFX < Testcase
def rate
next prev parent reply other threads:[~2022-01-23 21:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 21:37 [PATCH 0/9] various cuts for memory savings Eric Wong
2022-01-23 21:37 ` [PATCH 1/9] deduplicate and freeze pathnames + metadata Eric Wong
2022-01-23 21:37 ` [PATCH 2/9] player: remove omap conversion Eric Wong
2022-01-23 21:37 ` Eric Wong [this message]
2022-01-23 21:37 ` [PATCH 4/9] dtas-tl prune: cull missing files from tracklist Eric Wong
2022-01-23 21:37 ` [PATCH 5/9] dtas-tl: drop encoding hacks, use binary stdout+stderr Eric Wong
2022-01-23 21:37 ` [PATCH 6/9] use IO#wait_readable consistently Eric Wong
2022-01-23 21:37 ` [PATCH 7/9] get rid of DTAS::Nonblock wrapper for Ruby <= 2.0 Eric Wong
2022-01-23 21:37 ` [PATCH 8/9] unix_accepted: drop Ruby < 2.3 support code Eric Wong
2022-01-23 21:37 ` [PATCH 9/9] do not check IO#closed? before calling IO#close Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://80x24.org/dtas/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220123213746.21085-4-e@80x24.org \
--to=e@80x24.org \
--cc=dtas-all@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
http://80x24.org/dtas.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).