From 0f73acc225656517526b317a05ecab7e1311141b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 29 Aug 2013 09:29:40 +0000 Subject: remove "encoding: binary" header use We don't need it since IO#read(bytes, buf) will convert to ASCII-8BIT anyways. Everywhere else, we ensure path names are already binary. We do this mainly at the client layer before using Shellwords to escape the paths. We also must be careful about parsing output from soxi/avprobe which can show us metadata in whatever encoding is in the file. We must still handle data from parsing command output as binary, as the encoding of file metadata tends to vary. This also should buy us Syck compatibility for Ruby 1.9.3 users on Debian systems where Ruby 1.9.3 still uses Syck. --- lib/dtas/format.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/dtas/format.rb') diff --git a/lib/dtas/format.rb b/lib/dtas/format.rb index 35682a7..690a21f 100644 --- a/lib/dtas/format.rb +++ b/lib/dtas/format.rb @@ -1,4 +1,3 @@ -# -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) # class represents an audio format (type/bits/channels/sample rate/...) @@ -9,6 +8,7 @@ require_relative 'serialize' class DTAS::Format # :nodoc: include DTAS::Process include DTAS::Serialize + NATIVE_ENDIAN = [1].pack("l") == [1].pack("l>") ? "big" : "little" attr_accessor :type # s32, f32, f64 ... any point in others? @@ -63,10 +63,6 @@ class DTAS::Format # :nodoc: %W(-f #{@type}_#{endian2},#@channels,#@rate) end - def inspect - "<#{self.class}(#{Shellwords.join(to_sox_arg)})>" - end - def to_hsh to_hash.delete_if { |k,v| v == FORMAT_DEFAULTS[k] } end -- cgit v1.2.3-24-ge0c7