vorbis_comment 1.0.0 → 1.0.1
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/Rakefile +35 -0
- data/test/empty_key.ogg +0 -0
- data/test/test_vorbis_comment.rb +10 -5
- data/vorbis_comment.gemspec +2 -3
- data/vorbis_comment.rb +165 -164
- data/vorbis_comment_ext.c +4 -4
- metadata +81 -46
- data/vorbis_comment-1.0.0.gem +0 -0
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
CLEAN.include %w"rdoc vorbis_comment_ext.*o vcedit.o Makefile mkmf.log vorbis_comment-*.gem"
|
6
|
+
|
7
|
+
Rake::RDocTask.new do |rdoc|
|
8
|
+
rdoc.rdoc_dir = "rdoc"
|
9
|
+
rdoc.options += ["--quiet", "--line-numbers", "--inline-source"]
|
10
|
+
rdoc.main = "vorbis_comment.rb"
|
11
|
+
rdoc.title = "ruby-vorbis_comment: Vorbis Comment Reader/Writer Library"
|
12
|
+
rdoc.rdoc_files.add ["LICENSE", "vorbis_comment.rb"]
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Update docs and upload to rubyforge.org"
|
16
|
+
task :doc_rforge => [:rdoc]
|
17
|
+
task :doc_rforge do
|
18
|
+
sh %{chmod -R g+w rdoc/*}
|
19
|
+
sh %{scp -rp rdoc/* rubyforge.org:/var/www/gforge-projects/vorbiscomment}
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Package ruby-vorbis_comment"
|
23
|
+
task :package do
|
24
|
+
sh %{gem build vorbis_comment.gemspec}
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Build extension"
|
28
|
+
task :build => :clean do
|
29
|
+
sh %{ruby extconf.rb && make}
|
30
|
+
end
|
31
|
+
|
32
|
+
desc "Run tests"
|
33
|
+
task :default do
|
34
|
+
sh %{ruby test/test_vorbis_comment.rb}
|
35
|
+
end
|
data/test/empty_key.ogg
ADDED
Binary file
|
data/test/test_vorbis_comment.rb
CHANGED
@@ -41,6 +41,7 @@ class VorbisCommentTest < Test::Unit::TestCase
|
|
41
41
|
assert_equal true, vc('blank.ogg').exists?
|
42
42
|
# Corrupt tags are considered not to exist
|
43
43
|
assert_equal false, vc('corrupt.ogg').exists?
|
44
|
+
assert_equal false, vc('empty_key.ogg').exists?
|
44
45
|
# Files that aren't ogg files will be treated similarly
|
45
46
|
assert_equal false, vc('test_vorbis_comment.rb').exists?
|
46
47
|
# But nonexistant files raise an OpenError
|
@@ -51,6 +52,7 @@ class VorbisCommentTest < Test::Unit::TestCase
|
|
51
52
|
assert_equal Hash[], vc('blank.ogg').fields
|
52
53
|
assert_equal Hash['title'=>['Silence']], vc('title.ogg').fields
|
53
54
|
assert_equal Hash[{"ARTIST"=>["Test Artist 1", "Test Artist 2"], "TrackNumber"=>["1"], "Album"=>["Test Album"], "Title"=>["Test Title"], "Date"=>["1999-12-31"], "comment"=>[""]}], vc('manyfields.ogg').fields
|
55
|
+
assert_raises(VorbisComment::InvalidDataError){vc('empty_key.ogg').fields}
|
54
56
|
assert_raises(VorbisComment::InvalidDataError){vc('corrupt.ogg').fields}
|
55
57
|
assert_raises(VorbisComment::OpenError){vc('nonexistant.ogg').fields}
|
56
58
|
end
|
@@ -59,6 +61,7 @@ class VorbisCommentTest < Test::Unit::TestCase
|
|
59
61
|
assert_equal Hash[], work_with_copy('blank.ogg'){|filename| VorbisComment.new(filename).remove!}
|
60
62
|
assert_equal Hash[], work_with_copy('title.ogg'){|filename| VorbisComment.new(filename).remove!}
|
61
63
|
assert_equal Hash[], work_with_copy('manyfields.ogg'){|filename| VorbisComment.new(filename).remove!}
|
64
|
+
assert_raises(VorbisComment::InvalidDataError){work_with_copy('empty_key.ogg'){|filename| VorbisComment.new(filename).remove!}}
|
62
65
|
assert_raises(VorbisComment::InvalidDataError){work_with_copy('corrupt.ogg'){|filename| VorbisComment.new(filename).remove!}}
|
63
66
|
assert_raises(VorbisComment::OpenError){VorbisComment.new('nonexistant.ogg').remove!}
|
64
67
|
end
|
@@ -67,17 +70,19 @@ class VorbisCommentTest < Test::Unit::TestCase
|
|
67
70
|
assert_equal "", vc('blank.ogg').pretty_print
|
68
71
|
assert_equal "title: Silence", vc('title.ogg').pretty_print
|
69
72
|
assert_equal "ARTIST: Test Artist 1, Test Artist 2\nAlbum: Test Album\nDate: 1999-12-31\nTitle: Test Title\nTrackNumber: 1\ncomment: ", vc('manyfields.ogg').pretty_print
|
73
|
+
assert_equal "CORRUPT TAG!", vc('empty_key.ogg').pretty_print
|
70
74
|
assert_equal "CORRUPT TAG!", vc('corrupt.ogg').pretty_print
|
71
75
|
assert_equal "CORRUPT TAG!", vc('test_vorbis_comment.rb').pretty_print
|
72
76
|
end
|
73
77
|
|
74
78
|
def test_update
|
75
79
|
f = {'Blah'=>['Blah']}
|
80
|
+
assert_raises(VorbisComment::InvalidDataError){work_with_copy('empty_key.ogg'){|filename| VorbisComment.new(filename).update{|fields| fields.merge!(f)}}}
|
76
81
|
assert_raises(VorbisComment::InvalidDataError){work_with_copy('corrupt.ogg'){|filename| VorbisComment.new(filename).update{|fields| fields.merge!(f)}}}
|
77
82
|
assert_raises(VorbisComment::OpenError){VorbisComment.new('nonexistant.ogg').update{|fields| fields.merge!(f)}}
|
78
83
|
|
79
|
-
g = {'x'=>'y', 'y'=>:z, :z=>[:A], :zz=>[
|
80
|
-
h = {'x'=>['y'], 'y'=>['z'], 'z'=>['A'], 'zz'=>['A', '
|
84
|
+
g = {'x'=>'y', 'y'=>:z, :z=>[:A], :zz=>['A', :b, 'c']}
|
85
|
+
h = {'x'=>['y'], 'y'=>['z'], 'z'=>['A'], 'zz'=>['A', 'b', 'c']}
|
81
86
|
|
82
87
|
%w'blank.ogg title.ogg manyfields.ogg'.each do |fname|
|
83
88
|
work_with_copy(fname) do |filename|
|
@@ -116,11 +121,11 @@ class VorbisCommentTest < Test::Unit::TestCase
|
|
116
121
|
v.send(:add_to_fields, 'A', 'b')
|
117
122
|
assert_equal CICPHash['A'=>['b']], v.fields
|
118
123
|
assert_equal [['A', 'b']], v.send(:normalize_fields)
|
119
|
-
v.send(:add_to_fields, :a,
|
120
|
-
assert_equal CICPHash['A'=>['b',
|
124
|
+
v.send(:add_to_fields, :a, 'C')
|
125
|
+
assert_equal CICPHash['A'=>['b','C']], v.fields
|
121
126
|
assert_equal [['A', 'C'], ['A', 'b']], v.send(:normalize_fields)
|
122
127
|
v.send(:add_to_fields, 12, 42)
|
123
|
-
assert_equal CICPHash['A'=>['b',
|
128
|
+
assert_equal CICPHash['A'=>['b','C'], 12=>[42]], v.fields
|
124
129
|
assert_equal [['12', '42'], ['A', 'C'], ['A', 'b']], v.send(:normalize_fields)
|
125
130
|
v.update{}
|
126
131
|
assert_equal CICPHash['A'=>['C','b'], '12'=>['42']], VorbisComment.new(filename).fields
|
data/vorbis_comment.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "vorbis_comment"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.1"
|
4
4
|
s.author = "Jeremy Evans"
|
5
5
|
s.email = "code@jeremyevans.net"
|
6
6
|
s.homepage = "http://rubyforge.org/projects/vorbiscomment/"
|
@@ -9,11 +9,10 @@ spec = Gem::Specification.new do |s|
|
|
9
9
|
s.files = Dir["*"]
|
10
10
|
s.require_paths = ["."]
|
11
11
|
s.extensions << 'extconf.rb'
|
12
|
-
s.autorequire = "vorbis_comment"
|
13
12
|
s.test_files = Dir["test/*"]
|
14
13
|
s.has_rdoc = true
|
15
14
|
s.rdoc_options = %w'--inline-source --line-numbers'
|
16
15
|
s.add_dependency('cicphash', [">= 1.0.0"])
|
17
16
|
s.rubyforge_project = 'vorbiscomment'
|
17
|
+
s.homepage = 'http://vorbiscomment.rubyforge.org'
|
18
18
|
end
|
19
|
-
|
data/vorbis_comment.rb
CHANGED
@@ -1,164 +1,165 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This library implements a Vorbis Comment reader/writer.
|
3
|
-
# If called from the command line, it prints out the contents of the APEv2 tag
|
4
|
-
# for the given filename arguments.
|
5
|
-
#
|
6
|
-
# ruby-vorbis_comment is a pure Ruby library for manipulating Vorbis comments.
|
7
|
-
# It wraps libvorbis and libogg, so it should be completely standards
|
8
|
-
# compatible. Vorbis comment is the standard tagging format for Ogg Vorbis,
|
9
|
-
# FLAC, and Speex files.
|
10
|
-
#
|
11
|
-
# The library includes a C extension, which may or may not build cleanly on all
|
12
|
-
# architectures. It is developed and tested on OpenBSD i386 and amd64. If it
|
13
|
-
# doesn't work on your machine, please try to get it to work and send in a
|
14
|
-
# patch.
|
15
|
-
#
|
16
|
-
# This library tries to be API compatible with ruby-apetag, a library for
|
17
|
-
# reading and writing APE tags, the standard tagging format for Musepack and
|
18
|
-
# Monkey's Audio, which can also be used with MP3s as an alternative to ID3v2.
|
19
|
-
#
|
20
|
-
# General Use:
|
21
|
-
#
|
22
|
-
# require 'vorbiscomment'
|
23
|
-
# a = VorbisComment.new('file.ogg')
|
24
|
-
# a.exists? # if it already has an vorbis comment
|
25
|
-
# a.fields # a CICPHash of fields, keys are strings, values are lists of strings
|
26
|
-
# a.pretty_print # string suitable for pretty printing
|
27
|
-
# a.update{|fields| fields['Artist']='Test Artist'; fields.delete('Year')}
|
28
|
-
# # Update the tag with the added/changed/deleted fields
|
29
|
-
# # Note that you should do: a.update{|fields| fields.replace('Test'=>'Test')}
|
30
|
-
# # and NOT: a.update{|fields| fields = {'Test'=>'Test'}}
|
31
|
-
# # You need to update/modify the fields given, not reassign it
|
32
|
-
# a.remove! # clear the list of vorbis comments from the file
|
33
|
-
#
|
34
|
-
# To run the tests for the library, run test_vorbis_comment.rb.
|
35
|
-
#
|
36
|
-
# If you find any bugs, would like additional documentation, or want to submit a
|
37
|
-
# patch, please use Rubyforge (http://rubyforge.org/projects/vorbis_comment/).
|
38
|
-
# One known bug is
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# is
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# SOFTWARE
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
@fields
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
#
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
#
|
132
|
-
#
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
values = values
|
140
|
-
values
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
# the
|
150
|
-
# the
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
end
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
#
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
end
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This library implements a Vorbis Comment reader/writer.
|
3
|
+
# If called from the command line, it prints out the contents of the APEv2 tag
|
4
|
+
# for the given filename arguments.
|
5
|
+
#
|
6
|
+
# ruby-vorbis_comment is a pure Ruby library for manipulating Vorbis comments.
|
7
|
+
# It wraps libvorbis and libogg, so it should be completely standards
|
8
|
+
# compatible. Vorbis comment is the standard tagging format for Ogg Vorbis,
|
9
|
+
# FLAC, and Speex files.
|
10
|
+
#
|
11
|
+
# The library includes a C extension, which may or may not build cleanly on all
|
12
|
+
# architectures. It is developed and tested on OpenBSD i386 and amd64. If it
|
13
|
+
# doesn't work on your machine, please try to get it to work and send in a
|
14
|
+
# patch.
|
15
|
+
#
|
16
|
+
# This library tries to be API compatible with ruby-apetag, a library for
|
17
|
+
# reading and writing APE tags, the standard tagging format for Musepack and
|
18
|
+
# Monkey's Audio, which can also be used with MP3s as an alternative to ID3v2.
|
19
|
+
#
|
20
|
+
# General Use:
|
21
|
+
#
|
22
|
+
# require 'vorbiscomment'
|
23
|
+
# a = VorbisComment.new('file.ogg')
|
24
|
+
# a.exists? # if it already has an vorbis comment
|
25
|
+
# a.fields # a CICPHash of fields, keys are strings, values are lists of strings
|
26
|
+
# a.pretty_print # string suitable for pretty printing
|
27
|
+
# a.update{|fields| fields['Artist']='Test Artist'; fields.delete('Year')}
|
28
|
+
# # Update the tag with the added/changed/deleted fields
|
29
|
+
# # Note that you should do: a.update{|fields| fields.replace('Test'=>'Test')}
|
30
|
+
# # and NOT: a.update{|fields| fields = {'Test'=>'Test'}}
|
31
|
+
# # You need to update/modify the fields given, not reassign it
|
32
|
+
# a.remove! # clear the list of vorbis comments from the file
|
33
|
+
#
|
34
|
+
# To run the tests for the library, run test_vorbis_comment.rb.
|
35
|
+
#
|
36
|
+
# If you find any bugs, would like additional documentation, or want to submit a
|
37
|
+
# patch, please use Rubyforge (http://rubyforge.org/projects/vorbis_comment/).
|
38
|
+
# One known bug is that it doesn't like files less than 8K in size.
|
39
|
+
#
|
40
|
+
# The RDoc for the project is available on http://vorbiscomment.rubyforge.org.
|
41
|
+
#
|
42
|
+
# The most current source code can be accessed via github
|
43
|
+
# (http://github.com/jeremyevans/ruby-vorbis_comment/). Note that
|
44
|
+
# the library isn't modified on a regular basis, so it is unlikely to be
|
45
|
+
# different from the latest release.
|
46
|
+
#
|
47
|
+
# The pure ruby part of this library is copyright Jeremy Evans and is released
|
48
|
+
# under the MIT License.
|
49
|
+
#
|
50
|
+
# The C part of this library is copyright Jeremy Evans and Tilman Sauerbeck and
|
51
|
+
# is licensed under the GNU LGPL.
|
52
|
+
#
|
53
|
+
# Copyright (c) 2007,2010 Jeremy Evans
|
54
|
+
#
|
55
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
56
|
+
# of this software and associated documentation files (the "Software"), to deal
|
57
|
+
# in the Software without restriction, including without limitation the rights
|
58
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
59
|
+
# copies of the Software, and to permit persons to whom the Software is
|
60
|
+
# furnished to do so, subject to the following conditions:
|
61
|
+
#
|
62
|
+
# The above copyright notice and this permission notice shall be included in
|
63
|
+
# all copies or substantial portions of the Software.
|
64
|
+
#
|
65
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
66
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
67
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
68
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
69
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
70
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
71
|
+
# SOFTWARE.
|
72
|
+
|
73
|
+
require 'cicphash'
|
74
|
+
|
75
|
+
# Contains all of the Vorbis comment fields found in the filename/file given.
|
76
|
+
class VorbisComment
|
77
|
+
attr_reader :filename
|
78
|
+
BAD_KEY_RE = /[\x00-\x1f=\x7e-\xff]/
|
79
|
+
|
80
|
+
# Set the filename to be used
|
81
|
+
def initialize(filename)
|
82
|
+
@filename = filename.to_s
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check for the existance of the a vorbis comment in the file.
|
86
|
+
# Because all Vorbis bitstreams should have a comment, any file missing
|
87
|
+
# a comment probably isn't a vorbis file, or it's possible the file is
|
88
|
+
# corrupt.
|
89
|
+
def exists?
|
90
|
+
begin
|
91
|
+
fields
|
92
|
+
true
|
93
|
+
rescue InvalidDataError
|
94
|
+
false
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Clear all fields from the vorbis comment
|
99
|
+
def remove!
|
100
|
+
update{|fields| fields.clear}
|
101
|
+
end
|
102
|
+
|
103
|
+
# Get all the fields in the vorbis comment
|
104
|
+
def fields
|
105
|
+
return @fields if @fields
|
106
|
+
@fields = CICPHash.new
|
107
|
+
read_fields
|
108
|
+
@fields
|
109
|
+
end
|
110
|
+
|
111
|
+
# Return a string suitable for pretty printing, used by the command line
|
112
|
+
def pretty_print
|
113
|
+
begin
|
114
|
+
fields.sort.collect{|key, value| "#{key}: #{value.join(', ')}"}.join("\n")
|
115
|
+
rescue OpenError
|
116
|
+
"FILE NOT FOUND!"
|
117
|
+
rescue InvalidDataError, InvalidCommentError
|
118
|
+
"CORRUPT TAG!"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# Update the vorbis comment with the changes that occur to fields inside the
|
123
|
+
# block. Make sure to modify the fields given and not reassign them.
|
124
|
+
def update(&block)
|
125
|
+
yield fields
|
126
|
+
write_fields(normalize_fields)
|
127
|
+
fields
|
128
|
+
end
|
129
|
+
|
130
|
+
private
|
131
|
+
# Return a array with key/value pairs so that keys with multiple values
|
132
|
+
# have multiple entries. This is used mainly to make the C extension
|
133
|
+
# easier to code.
|
134
|
+
def normalize_fields
|
135
|
+
comments = []
|
136
|
+
fields.each do |key, values|
|
137
|
+
key = key.to_s
|
138
|
+
raise InvalidCommentError if key =~ BAD_KEY_RE
|
139
|
+
values = [values] unless values.is_a?(Array)
|
140
|
+
values = values.collect{|value| value.to_s}
|
141
|
+
values.each do |value|
|
142
|
+
value.unpack('U*') rescue (raise InvalidCommentError)
|
143
|
+
comments << [key, value]
|
144
|
+
end
|
145
|
+
end
|
146
|
+
comments.sort
|
147
|
+
end
|
148
|
+
|
149
|
+
# Add a value for the given key to the list of values for that key, creating
|
150
|
+
# the list if this is the first value for that key. This is used to make
|
151
|
+
# the C extension easier to code.
|
152
|
+
def add_to_fields(key, value)
|
153
|
+
(fields[key] ||= []) << value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
require 'vorbis_comment_ext' # define read_fields and write_fields
|
158
|
+
|
159
|
+
# If called directly from the command line, treat all arguments as filenames
|
160
|
+
# and pretty print the vorbis comment fields for each filename.
|
161
|
+
if __FILE__ == $0
|
162
|
+
ARGV.each do |filename|
|
163
|
+
puts filename, '-'*filename.length, VorbisComment.new(filename).pretty_print, ''
|
164
|
+
end
|
165
|
+
end
|
data/vorbis_comment_ext.c
CHANGED
@@ -76,7 +76,7 @@ VALUE read_fields (VALUE self) {
|
|
76
76
|
char *ptr, *content = vc->user_comments[i];
|
77
77
|
|
78
78
|
ptr = strchr (content, '=');
|
79
|
-
if (!ptr
|
79
|
+
if (!ptr) {
|
80
80
|
rb_funcall(fields, rb_intern("clear"), 0);
|
81
81
|
vcedit_state_unref(state);
|
82
82
|
rb_raise (eInvalidComment, "invalid comment - %s", content);
|
@@ -125,9 +125,9 @@ VALUE write_fields (VALUE self, VALUE comments) {
|
|
125
125
|
vorbis_comment_init(vc);
|
126
126
|
|
127
127
|
items = RARRAY(comments);
|
128
|
-
for (i = 0; i < items
|
129
|
-
comment =
|
130
|
-
vorbis_comment_add_tag(vc, StringValuePtr(comment
|
128
|
+
for (i = 0; i < RARRAY_LEN(items); i++) {
|
129
|
+
comment = RARRAY_PTR(items)[i];
|
130
|
+
vorbis_comment_add_tag(vc, StringValuePtr(RARRAY_PTR(comment)[0]), StringValuePtr(RARRAY_PTR(comment)[1]));
|
131
131
|
}
|
132
132
|
|
133
133
|
switch (vcedit_write (state)) {
|
metadata
CHANGED
@@ -1,68 +1,103 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.0
|
3
|
-
specification_version: 1
|
4
2
|
name: vorbis_comment
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
-
|
11
|
-
|
12
|
-
|
13
|
-
rubyforge_project: vorbiscomment
|
14
|
-
description:
|
15
|
-
autorequire: vorbis_comment
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
25
11
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
12
|
authors:
|
30
13
|
- Jeremy Evans
|
31
|
-
|
32
|
-
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-09-20 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: cicphash
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 1.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
description:
|
38
|
+
email: code@jeremyevans.net
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions:
|
33
42
|
- extconf.rb
|
34
|
-
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
35
46
|
- vcedit.c
|
36
47
|
- vcedit.h
|
37
48
|
- vorbis_comment.gemspec
|
38
49
|
- vorbis_comment.rb
|
39
50
|
- vorbis_comment_ext.c
|
40
|
-
-
|
41
|
-
|
42
|
-
-
|
51
|
+
- Rakefile
|
52
|
+
- LICENSE
|
53
|
+
- extconf.rb
|
43
54
|
- test/manyfields.ogg
|
44
55
|
- test/corrupt.ogg
|
45
56
|
- test/lt8k.ogg
|
46
57
|
- test/blank.ogg
|
58
|
+
- test/test_vorbis_comment.rb
|
47
59
|
- test/title.ogg
|
60
|
+
- test/empty_key.ogg
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://vorbiscomment.rubyforge.org
|
63
|
+
licenses: []
|
64
|
+
|
65
|
+
post_install_message:
|
48
66
|
rdoc_options:
|
49
67
|
- --inline-source
|
50
68
|
- --line-numbers
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
-
|
69
|
+
require_paths:
|
70
|
+
- .
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
version: "0"
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
57
89
|
requirements: []
|
58
90
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
91
|
+
rubyforge_project: vorbiscomment
|
92
|
+
rubygems_version: 1.3.7
|
93
|
+
signing_key:
|
94
|
+
specification_version: 3
|
95
|
+
summary: Vorbis Comment Reader/Writer Library
|
96
|
+
test_files:
|
97
|
+
- test/manyfields.ogg
|
98
|
+
- test/corrupt.ogg
|
99
|
+
- test/lt8k.ogg
|
100
|
+
- test/blank.ogg
|
101
|
+
- test/test_vorbis_comment.rb
|
102
|
+
- test/title.ogg
|
103
|
+
- test/empty_key.ogg
|
data/vorbis_comment-1.0.0.gem
DELETED
File without changes
|