apetag 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/apetag.rb +1 -1
- data/test/test_apetag.rb +4 -0
- metadata +2 -2
data/apetag.rb
CHANGED
@@ -406,7 +406,7 @@ class ApeTag
|
|
406
406
|
return @id3 = '' if file_size < 128 || check_id3 == false
|
407
407
|
file.seek(-128, IO::SEEK_END)
|
408
408
|
data = file.read(128)
|
409
|
-
@id3 = data[0...3] == 'TAG'
|
409
|
+
@id3 = data[0...3] == 'TAG' ? data : ''
|
410
410
|
end
|
411
411
|
|
412
412
|
# Turn fields hash from a hash of arbitrary objects to a hash of ApeItems
|
data/test/test_apetag.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
2
3
|
require 'apetag'
|
3
4
|
require 'stringio'
|
4
5
|
require 'test/unit'
|
@@ -341,6 +342,9 @@ class ApeTagTest < Test::Unit::TestCase
|
|
341
342
|
assert_nothing_raised{ApeTag.new(StringIO.new(EXAMPLE_APE_TAG.dup)).update{|x| x['Album'].pop}}
|
342
343
|
assert_nothing_raised{ApeTag.new(StringIO.new(EXAMPLE_APE_TAG.dup)).update{|x| x['Album'].shift}}
|
343
344
|
|
345
|
+
# Test ID3v1.0 tag
|
346
|
+
assert_nothing_raised{ApeTag.new(StringIO.new(EXAMPLE_APE_TAG[0...-128] + EXAMPLE_APE_TAG[-128..-1].gsub("\0", " "))).update{|x| x}}
|
347
|
+
|
344
348
|
# Test updating with invalid value
|
345
349
|
assert_raises(ApeTagError){ApeTag.new(StringIO.new(EMPTY_APE_TAG.dup)).update{|x| x['Album']="\xfe"}}
|
346
350
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: apetag
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2007-08-
|
6
|
+
version: 1.1.1
|
7
|
+
date: 2007-08-20 00:00:00 -07:00
|
8
8
|
summary: APEv2 Tag Parser/Generator
|
9
9
|
require_paths:
|
10
10
|
- .
|