ruby-mp3info 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.txt +1 -1
- data/lib/mp3info.rb +3 -3
- data/lib/mp3info/extension_modules.rb +1 -5
- data/lib/mp3info/id3v2.rb +1 -1
- data/test/test_ruby-mp3info.rb +7 -0
- metadata +24 -13
data/History.txt
CHANGED
data/README.txt
CHANGED
data/lib/mp3info.rb
CHANGED
@@ -18,7 +18,7 @@ end
|
|
18
18
|
|
19
19
|
class Mp3Info
|
20
20
|
|
21
|
-
VERSION = "0.7.
|
21
|
+
VERSION = "0.7.2"
|
22
22
|
|
23
23
|
LAYER = [ nil, 3, 2, 1]
|
24
24
|
BITRATE = {
|
@@ -234,7 +234,7 @@ class Mp3Info
|
|
234
234
|
def reload
|
235
235
|
@header = {}
|
236
236
|
|
237
|
-
if @filename_or_io.is_a?(StringIO)
|
237
|
+
if @filename_or_io.is_a?(StringIO) || @filename_or_io.is_a?(IO)
|
238
238
|
@io_is_a_file = false
|
239
239
|
@io = @filename_or_io
|
240
240
|
@io_size = @io.size
|
@@ -683,7 +683,7 @@ private
|
|
683
683
|
@length = ((stream_size << 3)/1000.0)/@bitrate
|
684
684
|
# read the first 100 frames and decide if the mp3 is vbr and needs full scan
|
685
685
|
begin
|
686
|
-
bitrate
|
686
|
+
bitrate = frame_scan(100).first
|
687
687
|
if @bitrate != bitrate
|
688
688
|
@vbr = true
|
689
689
|
@bitrate, @length = frame_scan
|
data/lib/mp3info/id3v2.rb
CHANGED
@@ -223,7 +223,7 @@ class ID3v2 < DelegateClass(Hash)
|
|
223
223
|
original_pos = @io.pos
|
224
224
|
@io.extend(Mp3Info::Mp3FileMethods)
|
225
225
|
version_maj, version_min, flags = @io.read(3).unpack("CCB4")
|
226
|
-
@unsync, ext_header,
|
226
|
+
@unsync, ext_header, _, _ = (0..3).collect { |i| flags[i].chr == '1' } # _, _ = experimental, footer
|
227
227
|
raise(ID3v2Error, "can't find version_maj ('#{version_maj}')") unless [2, 3, 4].include?(version_maj)
|
228
228
|
@version_maj, @version_min = version_maj, version_min
|
229
229
|
@tag_length = @io.get_syncsafe
|
data/test/test_ruby-mp3info.rb
CHANGED
@@ -447,6 +447,13 @@ class Mp3InfoTest < Test::Unit::TestCase
|
|
447
447
|
assert_equal(expected, s.bytes.map{|b| b.to_s(16).rjust(2,"0")}.to_a.join(" "))
|
448
448
|
end
|
449
449
|
|
450
|
+
def test_modifying_an_io
|
451
|
+
io = open(TEMP_FILE, "r")
|
452
|
+
Mp3Info.open(io) do |mp3|
|
453
|
+
mp3.tag.artist = "test_artist"
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
450
457
|
def compute_audio_content_mp3_digest(mp3)
|
451
458
|
pos, size = mp3.audio_content
|
452
459
|
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.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,30 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement:
|
15
|
+
name: hoe-yard
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.1.2
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.2
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: hoe
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
31
36
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
37
|
+
version: '3.4'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.4'
|
36
46
|
description: ! 'ruby-mp3info read low-level informations and manipulate tags on
|
37
47
|
|
38
48
|
mp3 files.'
|
@@ -58,8 +68,9 @@ homepage: http://github.com/moumar/ruby-mp3info
|
|
58
68
|
licenses: []
|
59
69
|
post_install_message:
|
60
70
|
rdoc_options:
|
61
|
-
- --
|
62
|
-
-
|
71
|
+
- --title
|
72
|
+
- TestRuby::TestMp3info Documentation
|
73
|
+
- --quiet
|
63
74
|
require_paths:
|
64
75
|
- lib
|
65
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -76,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
87
|
version: '0'
|
77
88
|
requirements: []
|
78
89
|
rubyforge_project: ruby-mp3info
|
79
|
-
rubygems_version: 1.8.
|
90
|
+
rubygems_version: 1.8.24
|
80
91
|
signing_key:
|
81
92
|
specification_version: 3
|
82
93
|
summary: ruby-mp3info read low-level informations and manipulate tags on mp3 files.
|