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 +5 -0
- data/lib/flac2mp3.rb +7 -1
- data/lib/flac2mp3/version.rb +1 -1
- data/spec/flac2mp3_spec.rb +14 -0
- metadata +2 -2
data/History.txt
CHANGED
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
|
|
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
|
data/lib/flac2mp3/version.rb
CHANGED
data/spec/flac2mp3_spec.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
12
|
+
date: 2008-04-28 00:00:00 -05:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|