ruby-mp3info 0.7 → 0.7.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,7 @@
1
+ === 0.7.1 / 2012-04-01
2
+
3
+ * convert to utf-16 little endian (instead of big) for more compatibility
4
+
1
5
  === 0.7 / 2012-02-29
2
6
 
3
7
  * removed iconv for ruby >= 1.9
data/Rakefile CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'hoe'
4
4
 
5
5
  Hoe.plugin :yard
6
+ Hoe.plugin :gemspec
6
7
 
7
8
  Hoe.spec('ruby-mp3info') do
8
9
  developer "Guillaume Pierronnet", "guillaume.pierronnet@gmail.com"
@@ -1,6 +1,6 @@
1
1
  # coding:utf-8
2
2
  # License:: Ruby
3
- # Author:: Guillaume Pierronnet (mailto:moumar_AT__rubyforge_DOT_org)
3
+ # Author:: Guillaume Pierronnet (mailto:guillaume.pierronnet@gmail.com)
4
4
  # Website:: http://ruby-mp3info.rubyforge.org/
5
5
 
6
6
  class Mp3Info
@@ -40,7 +40,7 @@ class Mp3Info
40
40
  end
41
41
  end
42
42
 
43
- class EncodingHelper
43
+ class EncodingHelper #:nodoc:
44
44
  def self.convert_to(value, from, to)
45
45
  if RUBY_1_8
46
46
  if to == "iso-8859-1"
@@ -49,7 +49,7 @@ class Mp3Info
49
49
  ruby_18_encode(from, to, value)
50
50
  else
51
51
  if to == "utf-16"
52
- ("\uFEFF" + value).encode("UTF-16BE")
52
+ ("\uFEFF" + value).encode("UTF-16LE") # Chab 01.apr.2012 : moved from big to little endian for more compatibility (Windows Media Player, older Quicktime..)
53
53
  else
54
54
  value.encode(to)
55
55
  end
data/lib/mp3info/id3v2.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # License:: Ruby
3
- # Author:: Guillaume Pierronnet (mailto:moumar_AT__rubyforge_DOT_org)
3
+ # Author:: Guillaume Pierronnet (mailto:guillaume.pierronnet@gmail.com)
4
4
  # Website:: http://ruby-mp3info.rubyforge.org/
5
5
 
6
6
  require "delegate"
data/lib/mp3info.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding:utf-8
2
2
  # License:: Ruby
3
- # Author:: Guillaume Pierronnet (mailto:moumar_AT__rubyforge_DOT_org)
3
+ # Author:: Guillaume Pierronnet (mailto:guillaume.pierronnet@gmail.com)
4
4
  # Website:: http://ruby-mp3info.rubyforge.org/
5
5
 
6
6
  require "fileutils"
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  class Mp3Info
20
20
 
21
- VERSION = "0.7"
21
+ VERSION = "0.7.1"
22
22
 
23
23
  LAYER = [ nil, 3, 2, 1]
24
24
  BITRATE = {
@@ -441,6 +441,12 @@ class Mp3InfoTest < Test::Unit::TestCase
441
441
  assert(Mp3Info.hastag2?(io))
442
442
  end
443
443
 
444
+ def test_convert_to_utf16_little_endian
445
+ s = Mp3Info::EncodingHelper.convert_to("track's title €éàïôù", "utf-8", "utf-16")
446
+ expected = "ff fe 74 00 72 00 61 00 63 00 6b 00 27 00 73 00 20 00 74 00 69 00 74 00 6c 00 65 00 20 00 ac 20 e9 00 e0 00 ef 00 f4 00 f9 00"
447
+ assert_equal(expected, s.bytes.map{|b| b.to_s(16).rjust(2,"0")}.to_a.join(" "))
448
+ end
449
+
444
450
  def compute_audio_content_mp3_digest(mp3)
445
451
  pos, size = mp3.audio_content
446
452
  data = File.open(mp3.filename) do |f|
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.7'
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-02 00:00:00.000000000 +01:00
13
- default_executable:
12
+ date: 2012-04-01 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rdoc
17
- requirement: &79955210 !ruby/object:Gem::Requirement
16
+ requirement: &73102580 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ~>
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: '3.10'
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *79955210
24
+ version_requirements: *73102580
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: hoe
28
- requirement: &79954780 !ruby/object:Gem::Requirement
27
+ requirement: &73101600 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ~>
@@ -33,7 +32,7 @@ dependencies:
33
32
  version: '2.12'
34
33
  type: :development
35
34
  prerelease: false
36
- version_requirements: *79954780
35
+ version_requirements: *73101600
37
36
  description: ! 'ruby-mp3info read low-level informations and manipulate tags on
38
37
 
39
38
  mp3 files.'
@@ -55,7 +54,6 @@ files:
55
54
  - lib/mp3info/id3v2.rb
56
55
  - test/test_ruby-mp3info.rb
57
56
  - .gemtest
58
- has_rdoc: true
59
57
  homepage: http://github.com/moumar/ruby-mp3info
60
58
  licenses: []
61
59
  post_install_message:
@@ -78,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  version: '0'
79
77
  requirements: []
80
78
  rubyforge_project: ruby-mp3info
81
- rubygems_version: 1.6.2
79
+ rubygems_version: 1.8.17
82
80
  signing_key:
83
81
  specification_version: 3
84
82
  summary: ruby-mp3info read low-level informations and manipulate tags on mp3 files.