ruby-mp3info 0.6 → 0.6.1

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.
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- === 0.6 / 1970-01-01
1
+ === 0.6.1 / 2008-02-28
2
+
3
+ * FIXED: fails to read id3v2 tags when iconv fails
4
+
5
+ === 0.6 / 2008-02-24
2
6
 
3
7
  * FIXED: correct handling of encoding in id3v2 tags
4
8
 
data/lib/mp3info.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: mp3info.rb 64 2008-02-24 02:11:57Z moumar $
1
+ # $Id: mp3info.rb 69 2008-02-28 09:29:08Z moumar $
2
2
  # License:: Ruby
3
3
  # Author:: Guillaume Pierronnet (mailto:moumar_AT__rubyforge_DOT_org)
4
4
  # Website:: http://ruby-mp3info.rubyforge.org/
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  class Mp3Info
20
20
 
21
- VERSION = "0.6"
21
+ VERSION = "0.6.1"
22
22
 
23
23
  LAYER = [ nil, 3, 2, 1]
24
24
  BITRATE = [
data/lib/mp3info/id3v2.rb CHANGED
@@ -231,7 +231,11 @@ class ID3v2 < DelegateClass(Hash)
231
231
  # we need to convert the string in order to match
232
232
  # the requested encoding
233
233
  if encoding && encoding != @text_encoding_index
234
- out = Iconv.iconv(@options[:encoding], TEXT_ENCODINGS[encoding], out)[0]
234
+ begin
235
+ return Iconv.iconv(@options[:encoding], TEXT_ENCODINGS[encoding], out)[0]
236
+ rescue Iconv::Failure
237
+ return out
238
+ end
235
239
  end
236
240
  out
237
241
  end
@@ -386,6 +386,14 @@ EOF
386
386
  end
387
387
  end
388
388
 
389
+ def test_should_raises_exception_when_writing_badly_encoded_frames
390
+ assert_raises(Iconv::Failure) do
391
+ Mp3Info.open(TEMP_FILE, :encoding => 'utf-8') do |mp3|
392
+ mp3.tag2['TEST'] = "all\xc3"
393
+ end
394
+ end
395
+ end
396
+
389
397
  def write_temp_file(tag)
390
398
  Mp3Info.open(TEMP_FILE) do |mp3|
391
399
  mp3.tag2.update(tag)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mp3info
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.6"
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Pierronnet
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-24 00:00:00 +01:00
12
+ date: 2008-02-28 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency