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 +5 -0
- data/bin/flac2mp3 +0 -0
- data/lib/flac2mp3.rb +3 -1
- data/lib/flac2mp3/version.rb +1 -1
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/spec/flac2mp3_spec.rb +14 -0
- metadata +4 -4
data/History.txt
CHANGED
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
|
-
|
42
|
+
value = value.to_s if key == :title
|
43
|
+
hash[key] = value
|
42
44
|
hash
|
43
45
|
end
|
44
46
|
end
|
data/lib/flac2mp3/version.rb
CHANGED
data/script/destroy
CHANGED
File without changes
|
data/script/generate
CHANGED
File without changes
|
data/spec/flac2mp3_spec.rb
CHANGED
@@ -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.
|
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:
|
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:
|
92
|
+
rubygems_version: 1.1.0
|
93
93
|
signing_key:
|
94
94
|
specification_version: 2
|
95
95
|
summary: description of gem
|