flac2mp3 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.1 2008-03-30
2
+
3
+ * 1 bug fix:
4
+ * Numeric track titles 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.0 2007-12-07
2
7
 
3
8
  * 1 major enhancement:
data/bin/flac2mp3 CHANGED
File without changes
data/lib/flac2mp3.rb CHANGED
@@ -37,8 +37,10 @@ module Flac2mp3
37
37
  def flacdata(filename)
38
38
  data = FlacInfo.new(filename)
39
39
  data.tags.inject({}) do |hash, (key, value)|
40
+ key = key.to_s.downcase.to_sym
40
41
  value = value.to_i if value.respond_to?(:match) and value.match(/^\d+$/)
41
- hash[key.to_s.downcase.to_sym] = value
42
+ value = value.to_s if key == :title
43
+ hash[key] = value
42
44
  hash
43
45
  end
44
46
  end
@@ -2,7 +2,7 @@ module Flac2mp3 #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/script/destroy CHANGED
File without changes
data/script/generate CHANGED
File without changes
@@ -236,6 +236,20 @@ describe Flac2mp3, 'when getting FLAC tag data' do
236
236
  data = Flac2mp3.flacdata(@filename)
237
237
  data[:track].should == 12
238
238
  end
239
+
240
+ it 'should leave numeric titles as strings' do
241
+ @tags[:title] = '45' # This was my first run-in with this problem, the opening track on Elvis Costello's /When I Was Cruel/
242
+
243
+ data = Flac2mp3.flacdata(@filename)
244
+ data[:title].should == '45'
245
+ end
246
+
247
+ it 'should leave numeric titles as strings even if the title key is not a simple downcased symbol' do
248
+ @tags['TITLE'] = '45'
249
+
250
+ data = Flac2mp3.flacdata(@filename)
251
+ data[:title].should == '45'
252
+ end
239
253
  end
240
254
 
241
255
  describe Flac2mp3, 'when setting MP3 tag data' do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flac2mp3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- platform: ""
4
+ version: 0.2.1
5
+ platform: ruby
6
6
  authors:
7
7
  - Yossef Mendelssohn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-12-08 00:00:00 -06:00
12
+ date: 2008-03-30 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project: yomendel
92
- rubygems_version: 0.9.5
92
+ rubygems_version: 1.1.0
93
93
  signing_key:
94
94
  specification_version: 2
95
95
  summary: description of gem