flac2mp3 0.2.3 → 0.2.4

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,3 +1,8 @@
1
+ == 0.2.4 2008-04-28
2
+
3
+ * 1 bug fix:
4
+ * Numeric track descriptions were converted to integers, which caused setting the MP3 data (using ruby-mp3info) to raise an exception. They are now left as strings.
5
+
1
6
  == 0.2.3 2008-04-18
2
7
 
3
8
  * 1 bug fix:
data/lib/flac2mp3.rb CHANGED
@@ -39,7 +39,7 @@ module Flac2mp3
39
39
  data.tags.inject({}) do |hash, (key, value)|
40
40
  key = key.to_s.downcase.to_sym
41
41
  value = value.to_i if value.respond_to?(:match) and value.match(/^\d+$/)
42
- value = value.to_s if key == :title
42
+ value = value.to_s if string_fields.include?(key)
43
43
  hash[key] = value
44
44
  hash
45
45
  end
@@ -56,5 +56,11 @@ module Flac2mp3
56
56
  end
57
57
  end
58
58
  end
59
+
60
+ private
61
+
62
+ def string_fields
63
+ [:title, :description]
64
+ end
59
65
  end
60
66
  end
@@ -2,7 +2,7 @@ module Flac2mp3 #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -250,6 +250,20 @@ describe Flac2mp3, 'when getting FLAC tag data' do
250
250
  data = Flac2mp3.flacdata(@filename)
251
251
  data[:title].should == '45'
252
252
  end
253
+
254
+ it 'should leave numeric descriptions as strings' do
255
+ @tags[:description] = '1938' # This was my first run-in with this problem, from the Boilermakers' version of "Minor Swing" where for the description all I had was the year of the original
256
+
257
+ data = Flac2mp3.flacdata(@filename)
258
+ data[:description].should == '1938'
259
+ end
260
+
261
+ it 'should leave numeric titles as strings even if the title key is not a simple downcased symbol' do
262
+ @tags['DESCRIPTION'] = '1938'
263
+
264
+ data = Flac2mp3.flacdata(@filename)
265
+ data[:description].should == '1938'
266
+ end
253
267
  end
254
268
 
255
269
  describe Flac2mp3, 'when setting MP3 tag data' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flac2mp3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yossef Mendelssohn
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-18 00:00:00 -05:00
12
+ date: 2008-04-28 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency