ruby-audioinfo 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/.gitignore +7 -1
- data/.rubocop_todo.yml +3 -3
- data/Gemfile.lock +1 -1
- data/lib/audioinfo.rb +17 -23
- data/lib/audioinfo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f9fc4a57204013fea05e2d88e3fbec568b833a5aa7627e345d740b6601a685
|
4
|
+
data.tar.gz: 2f7d5b623dcf6a04dc6a203cb4c4e115057625dbb7d5b910b6632a94d591e37d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b27b66d77f3e02a1892ace15d6daf124f048c0c2fb3b2864f085bd0557020b6787d5ba295dfba5b7e793822ddb153814f9b213a8fdd2c1cc0ab4a550c562fc54
|
7
|
+
data.tar.gz: 2f7e0694eccc686992e16ab9fed24dc573529906a945322bb05411d627a2734b041ea2f6da9c3543e5af78bcd41c6765184245d0c526509f720c22dad202fac6
|
data/.github/workflows/ruby.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -53,17 +53,17 @@ Metrics/ClassLength:
|
|
53
53
|
# Offense count: 4
|
54
54
|
# Configuration parameters: IgnoredMethods.
|
55
55
|
Metrics/CyclomaticComplexity:
|
56
|
-
Max:
|
56
|
+
Max: 29
|
57
57
|
|
58
58
|
# Offense count: 8
|
59
59
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
60
60
|
Metrics/MethodLength:
|
61
|
-
Max:
|
61
|
+
Max: 117
|
62
62
|
|
63
63
|
# Offense count: 4
|
64
64
|
# Configuration parameters: IgnoredMethods.
|
65
65
|
Metrics/PerceivedComplexity:
|
66
|
-
Max:
|
66
|
+
Max: 24
|
67
67
|
|
68
68
|
# Offense count: 6
|
69
69
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
data/Gemfile.lock
CHANGED
data/lib/audioinfo.rb
CHANGED
@@ -149,10 +149,12 @@ class AudioInfo
|
|
149
149
|
@length = @info.SECS
|
150
150
|
mapping = MUSICBRAINZ_FIELDS.invert
|
151
151
|
|
152
|
-
faad_info(filename).
|
153
|
-
name, value =
|
152
|
+
faad_info(filename).scan(/^MusicBrainz (.+): (.+)$/) do |match|
|
153
|
+
name, value = match
|
154
154
|
key = mapping[name]
|
155
|
-
|
155
|
+
next unless key
|
156
|
+
|
157
|
+
@musicbrainz_infos[key] = value.strip.gsub("\u0000", '')
|
156
158
|
end
|
157
159
|
|
158
160
|
when 'flac'
|
@@ -375,29 +377,21 @@ class AudioInfo
|
|
375
377
|
rescue ApeTagError
|
376
378
|
end
|
377
379
|
|
378
|
-
def faad_info(
|
379
|
-
|
380
|
-
stderr, stderr_w = IO.pipe
|
381
|
-
|
382
|
-
fork do
|
383
|
-
stdout.close
|
384
|
-
stderr.close
|
385
|
-
$stdout.reopen(stdout_w)
|
386
|
-
$stderr.reopen(stderr_w)
|
387
|
-
exec 'faad', '-i', file
|
388
|
-
end
|
380
|
+
def faad_info(path)
|
381
|
+
require 'open3'
|
389
382
|
|
390
|
-
|
391
|
-
|
392
|
-
pid, status = Process.wait2
|
383
|
+
output = ''
|
384
|
+
status = nil
|
393
385
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
386
|
+
begin
|
387
|
+
Open3.popen3('faad', '-i', path) do |_stdin, _stdout, stderr, wait_thr|
|
388
|
+
output = stderr.read.chomp
|
389
|
+
status = wait_thr.value
|
390
|
+
end
|
391
|
+
rescue StandardError
|
392
|
+
end
|
398
393
|
|
399
|
-
|
400
|
-
status.exitstatus.zero? ? err : ''
|
394
|
+
status&.exitstatus&.zero? ? output : ''
|
401
395
|
end
|
402
396
|
|
403
397
|
def shell_escape(s)
|
data/lib/audioinfo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-audioinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Pierronnet
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: apetag
|