taglib-ruby 0.4.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +9 -0
- data/CHANGES.md +53 -0
- data/Gemfile +4 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +87 -0
- data/Rakefile +29 -0
- data/docs/default/fulldoc/html/css/common.css +1 -0
- data/docs/taglib/base.rb +202 -0
- data/docs/taglib/id3v1.rb +5 -0
- data/docs/taglib/id3v2.rb +444 -0
- data/docs/taglib/mpeg.rb +120 -0
- data/docs/taglib/ogg.rb +77 -0
- data/docs/taglib/vorbis.rb +62 -0
- data/ext/extconf_common.rb +29 -0
- data/ext/taglib_base/extconf.rb +4 -0
- data/ext/taglib_base/includes.i +115 -0
- data/ext/taglib_base/taglib_base.i +139 -0
- data/ext/taglib_base/taglib_base_wrap.cxx +5153 -0
- data/ext/taglib_id3v1/extconf.rb +4 -0
- data/ext/taglib_id3v1/taglib_id3v1.i +11 -0
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +3110 -0
- data/ext/taglib_id3v2/extconf.rb +4 -0
- data/ext/taglib_id3v2/relativevolumeframe.i +35 -0
- data/ext/taglib_id3v2/taglib_id3v2.i +112 -0
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +9033 -0
- data/ext/taglib_mpeg/extconf.rb +4 -0
- data/ext/taglib_mpeg/taglib_mpeg.i +75 -0
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +4726 -0
- data/ext/taglib_ogg/extconf.rb +4 -0
- data/ext/taglib_ogg/taglib_ogg.i +36 -0
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +3631 -0
- data/ext/taglib_vorbis/extconf.rb +4 -0
- data/ext/taglib_vorbis/taglib_vorbis.i +48 -0
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +3083 -0
- data/ext/valgrind-suppressions.txt +170 -0
- data/ext/win.cmake +5 -0
- data/lib/libtag.dll +0 -0
- data/lib/taglib.rb +14 -0
- data/lib/taglib/base.rb +19 -0
- data/lib/taglib/id3v1.rb +1 -0
- data/lib/taglib/id3v2.rb +20 -0
- data/lib/taglib/mpeg.rb +7 -0
- data/lib/taglib/ogg.rb +1 -0
- data/lib/taglib/version.rb +10 -0
- data/lib/taglib/vorbis.rb +7 -0
- data/lib/taglib_base.so +0 -0
- data/lib/taglib_id3v1.so +0 -0
- data/lib/taglib_id3v2.so +0 -0
- data/lib/taglib_mpeg.so +0 -0
- data/lib/taglib_ogg.so +0 -0
- data/lib/taglib_vorbis.so +0 -0
- data/taglib-ruby.gemspec +122 -0
- data/tasks/docs_coverage.rake +26 -0
- data/tasks/ext.rake +81 -0
- data/tasks/gemspec_check.rake +19 -0
- data/tasks/swig.rake +43 -0
- data/test/data/Makefile +15 -0
- data/test/data/add-relative-volume.cpp +40 -0
- data/test/data/crash.mp3 +0 -0
- data/test/data/globe_east_540.jpg +0 -0
- data/test/data/id3v1-create.cpp +31 -0
- data/test/data/id3v1.mp3 +0 -0
- data/test/data/relative-volume.mp3 +0 -0
- data/test/data/sample.mp3 +0 -0
- data/test/data/unicode.mp3 +0 -0
- data/test/data/vorbis-create.cpp +42 -0
- data/test/data/vorbis.oga +0 -0
- data/test/fileref_open_test.rb +32 -0
- data/test/fileref_properties_test.rb +21 -0
- data/test/fileref_write_test.rb +62 -0
- data/test/helper.rb +10 -0
- data/test/id3v1_tag_test.rb +36 -0
- data/test/id3v2_frames_test.rb +115 -0
- data/test/id3v2_memory_test.rb +87 -0
- data/test/id3v2_relative_volume_test.rb +62 -0
- data/test/id3v2_tag_test.rb +59 -0
- data/test/id3v2_unicode_test.rb +47 -0
- data/test/id3v2_write_test.rb +100 -0
- data/test/mpeg_file_test.rb +76 -0
- data/test/tag_test.rb +21 -0
- data/test/unicode_filename_test.rb +29 -0
- data/test/vorbis_file_test.rb +54 -0
- data/test/vorbis_tag_test.rb +79 -0
- metadata +191 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
class TestUnicodeFilename < Test::Unit::TestCase
|
5
|
+
SRC_FILE = "test/data/vorbis.oga"
|
6
|
+
# That's "hello-" followed by "ni hao" in UTF-8
|
7
|
+
DST_FILE = "test/data/hello-\xE4\xBD\xA0\xE5\xA5\xBD.oga"
|
8
|
+
|
9
|
+
context "TagLib::FileRef" do
|
10
|
+
setup do
|
11
|
+
if HAVE_ENCODING
|
12
|
+
DST_FILE.force_encoding('UTF-8')
|
13
|
+
end
|
14
|
+
FileUtils.cp SRC_FILE, DST_FILE
|
15
|
+
@fileref = TagLib::FileRef.new(DST_FILE, false)
|
16
|
+
@tag = @fileref.tag
|
17
|
+
end
|
18
|
+
|
19
|
+
should "be possible to read" do
|
20
|
+
assert_not_nil @tag
|
21
|
+
assert_equal 'Title', @tag.title
|
22
|
+
end
|
23
|
+
|
24
|
+
teardown do
|
25
|
+
@fileref.close
|
26
|
+
FileUtils.rm DST_FILE
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
+
|
3
|
+
class TestVorbisFile < Test::Unit::TestCase
|
4
|
+
context "The vorbis.oga file" do
|
5
|
+
setup do
|
6
|
+
@file = TagLib::Ogg::Vorbis::File.new("test/data/vorbis.oga")
|
7
|
+
end
|
8
|
+
|
9
|
+
should "have a tag" do
|
10
|
+
tag = @file.tag
|
11
|
+
assert_not_nil tag
|
12
|
+
assert_equal TagLib::Ogg::XiphComment, tag.class
|
13
|
+
end
|
14
|
+
|
15
|
+
context "audio properties" do
|
16
|
+
setup do
|
17
|
+
@properties = @file.audio_properties
|
18
|
+
end
|
19
|
+
|
20
|
+
should "exist" do
|
21
|
+
assert_not_nil @properties
|
22
|
+
end
|
23
|
+
|
24
|
+
should "contain basic information" do
|
25
|
+
assert_equal 0, @properties.length # file is short
|
26
|
+
assert_equal 64, @properties.bitrate
|
27
|
+
assert_equal 44100, @properties.sample_rate
|
28
|
+
assert_equal 2, @properties.channels
|
29
|
+
end
|
30
|
+
|
31
|
+
should "contain vorbis-specific information" do
|
32
|
+
assert_equal 0, @properties.vorbis_version
|
33
|
+
assert_equal 0, @properties.bitrate_maximum
|
34
|
+
assert_equal 64000, @properties.bitrate_nominal
|
35
|
+
assert_equal 0, @properties.bitrate_minimum
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
teardown do
|
40
|
+
@file.close
|
41
|
+
@file = nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "TagLib::Ogg::Vorbis::File" do
|
46
|
+
should "have open method" do
|
47
|
+
title = nil
|
48
|
+
TagLib::Ogg::Vorbis::File.open("test/data/vorbis.oga", false) do |file|
|
49
|
+
title = file.tag.title
|
50
|
+
end
|
51
|
+
assert_equal "Title", title
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
+
|
3
|
+
class TestVorbisTag < Test::Unit::TestCase
|
4
|
+
context "The vorbis.oga file tag" do
|
5
|
+
setup do
|
6
|
+
@file = TagLib::Ogg::Vorbis::File.new("test/data/vorbis.oga")
|
7
|
+
@tag = @file.tag
|
8
|
+
end
|
9
|
+
|
10
|
+
should "contain basic tag information" do
|
11
|
+
assert_equal "Title", @tag.title
|
12
|
+
assert_equal "Artist", @tag.artist
|
13
|
+
assert_equal "Album", @tag.album
|
14
|
+
assert_equal "Test file", @tag.comment
|
15
|
+
assert_equal "Pop", @tag.genre
|
16
|
+
assert_equal 2011, @tag.year
|
17
|
+
assert_equal 7, @tag.track
|
18
|
+
assert_equal false, @tag.empty?
|
19
|
+
end
|
20
|
+
|
21
|
+
should "have contains? method" do
|
22
|
+
assert @tag.contains?('TITLE')
|
23
|
+
assert !@tag.contains?('DOESNTEXIST')
|
24
|
+
end
|
25
|
+
|
26
|
+
should "have field_count" do
|
27
|
+
assert_equal 16, @tag.field_count
|
28
|
+
end
|
29
|
+
|
30
|
+
should "have vendor_id" do
|
31
|
+
assert_equal "Xiph.Org libVorbis I 20101101 (Schaufenugget)", @tag.vendor_id
|
32
|
+
end
|
33
|
+
|
34
|
+
context "fields" do
|
35
|
+
setup do
|
36
|
+
@fields = @tag.field_list_map
|
37
|
+
end
|
38
|
+
|
39
|
+
should "exist" do
|
40
|
+
assert_not_nil @fields
|
41
|
+
end
|
42
|
+
|
43
|
+
should "be usable as a Hash" do
|
44
|
+
assert_equal ["Title"], @fields['TITLE']
|
45
|
+
assert_nil @fields['DOESNTEXIST']
|
46
|
+
end
|
47
|
+
|
48
|
+
should "be able to return more than one value for a key" do
|
49
|
+
assert_equal ["A", "B"], @fields['MULTIPLE']
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
should "support add_field with replace" do
|
54
|
+
@tag.add_field('TITLE', "New Title")
|
55
|
+
assert_equal ["New Title"], @tag.field_list_map['TITLE']
|
56
|
+
end
|
57
|
+
|
58
|
+
should "support add_field without replace" do
|
59
|
+
replace = false
|
60
|
+
@tag.add_field('TITLE', "Additional Title", replace)
|
61
|
+
assert_equal ["Title", "Additional Title"], @tag.field_list_map['TITLE']
|
62
|
+
end
|
63
|
+
|
64
|
+
should "support remove_field with value" do
|
65
|
+
@tag.remove_field('MULTIPLE', "A")
|
66
|
+
assert_equal ["B"], @tag.field_list_map['MULTIPLE']
|
67
|
+
end
|
68
|
+
|
69
|
+
should "support remove_field without value" do
|
70
|
+
@tag.remove_field('MULTIPLE')
|
71
|
+
assert !@tag.contains?('MULTIPLE')
|
72
|
+
end
|
73
|
+
|
74
|
+
teardown do
|
75
|
+
@file.close
|
76
|
+
@file = nil
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
metadata
ADDED
@@ -0,0 +1,191 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taglib-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
prerelease:
|
6
|
+
platform: x86-mingw32
|
7
|
+
authors:
|
8
|
+
- Robin Stocker
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: &10846620 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.1.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10846620
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake-compiler
|
27
|
+
requirement: &10845940 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.8'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *10845940
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: shoulda-context
|
38
|
+
requirement: &10844840 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *10844840
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: yard
|
49
|
+
requirement: &10844340 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.7'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *10844340
|
58
|
+
description: ! 'Ruby interface for the taglib C++ library.
|
59
|
+
|
60
|
+
|
61
|
+
In contrast to other libraries, this one wraps the C++ API using SWIG,
|
62
|
+
|
63
|
+
not only the minimal C API. This means that all tags can be accessed.
|
64
|
+
|
65
|
+
'
|
66
|
+
email:
|
67
|
+
- robin@nibor.org
|
68
|
+
executables: []
|
69
|
+
extensions: []
|
70
|
+
extra_rdoc_files:
|
71
|
+
- CHANGES.md
|
72
|
+
- LICENSE.txt
|
73
|
+
- README.md
|
74
|
+
files:
|
75
|
+
- .yardopts
|
76
|
+
- CHANGES.md
|
77
|
+
- Gemfile
|
78
|
+
- Guardfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- docs/default/fulldoc/html/css/common.css
|
83
|
+
- docs/taglib/base.rb
|
84
|
+
- docs/taglib/id3v1.rb
|
85
|
+
- docs/taglib/id3v2.rb
|
86
|
+
- docs/taglib/mpeg.rb
|
87
|
+
- docs/taglib/ogg.rb
|
88
|
+
- docs/taglib/vorbis.rb
|
89
|
+
- ext/extconf_common.rb
|
90
|
+
- ext/taglib_base/extconf.rb
|
91
|
+
- ext/taglib_base/includes.i
|
92
|
+
- ext/taglib_base/taglib_base.i
|
93
|
+
- ext/taglib_base/taglib_base_wrap.cxx
|
94
|
+
- ext/taglib_id3v1/extconf.rb
|
95
|
+
- ext/taglib_id3v1/taglib_id3v1.i
|
96
|
+
- ext/taglib_id3v1/taglib_id3v1_wrap.cxx
|
97
|
+
- ext/taglib_id3v2/extconf.rb
|
98
|
+
- ext/taglib_id3v2/relativevolumeframe.i
|
99
|
+
- ext/taglib_id3v2/taglib_id3v2.i
|
100
|
+
- ext/taglib_id3v2/taglib_id3v2_wrap.cxx
|
101
|
+
- ext/taglib_mpeg/extconf.rb
|
102
|
+
- ext/taglib_mpeg/taglib_mpeg.i
|
103
|
+
- ext/taglib_mpeg/taglib_mpeg_wrap.cxx
|
104
|
+
- ext/taglib_ogg/extconf.rb
|
105
|
+
- ext/taglib_ogg/taglib_ogg.i
|
106
|
+
- ext/taglib_ogg/taglib_ogg_wrap.cxx
|
107
|
+
- ext/taglib_vorbis/extconf.rb
|
108
|
+
- ext/taglib_vorbis/taglib_vorbis.i
|
109
|
+
- ext/taglib_vorbis/taglib_vorbis_wrap.cxx
|
110
|
+
- ext/valgrind-suppressions.txt
|
111
|
+
- ext/win.cmake
|
112
|
+
- lib/taglib.rb
|
113
|
+
- lib/taglib/base.rb
|
114
|
+
- lib/taglib/id3v1.rb
|
115
|
+
- lib/taglib/id3v2.rb
|
116
|
+
- lib/taglib/mpeg.rb
|
117
|
+
- lib/taglib/ogg.rb
|
118
|
+
- lib/taglib/version.rb
|
119
|
+
- lib/taglib/vorbis.rb
|
120
|
+
- taglib-ruby.gemspec
|
121
|
+
- tasks/docs_coverage.rake
|
122
|
+
- tasks/ext.rake
|
123
|
+
- tasks/gemspec_check.rake
|
124
|
+
- tasks/swig.rake
|
125
|
+
- test/data/Makefile
|
126
|
+
- test/data/add-relative-volume.cpp
|
127
|
+
- test/data/crash.mp3
|
128
|
+
- test/data/globe_east_540.jpg
|
129
|
+
- test/data/id3v1-create.cpp
|
130
|
+
- test/data/id3v1.mp3
|
131
|
+
- test/data/relative-volume.mp3
|
132
|
+
- test/data/sample.mp3
|
133
|
+
- test/data/unicode.mp3
|
134
|
+
- test/data/vorbis-create.cpp
|
135
|
+
- test/data/vorbis.oga
|
136
|
+
- test/helper.rb
|
137
|
+
- test/fileref_open_test.rb
|
138
|
+
- test/fileref_properties_test.rb
|
139
|
+
- test/fileref_write_test.rb
|
140
|
+
- test/id3v1_tag_test.rb
|
141
|
+
- test/id3v2_frames_test.rb
|
142
|
+
- test/id3v2_memory_test.rb
|
143
|
+
- test/id3v2_relative_volume_test.rb
|
144
|
+
- test/id3v2_tag_test.rb
|
145
|
+
- test/id3v2_unicode_test.rb
|
146
|
+
- test/id3v2_write_test.rb
|
147
|
+
- test/mpeg_file_test.rb
|
148
|
+
- test/tag_test.rb
|
149
|
+
- test/unicode_filename_test.rb
|
150
|
+
- test/vorbis_file_test.rb
|
151
|
+
- test/vorbis_tag_test.rb
|
152
|
+
- lib/taglib_base.so
|
153
|
+
- lib/taglib_mpeg.so
|
154
|
+
- lib/taglib_id3v1.so
|
155
|
+
- lib/taglib_id3v2.so
|
156
|
+
- lib/taglib_ogg.so
|
157
|
+
- lib/taglib_vorbis.so
|
158
|
+
- lib/libtag.dll
|
159
|
+
homepage: http://robinst.github.com/taglib-ruby/
|
160
|
+
licenses:
|
161
|
+
- MIT
|
162
|
+
post_install_message:
|
163
|
+
rdoc_options: []
|
164
|
+
require_paths:
|
165
|
+
- lib
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
168
|
+
requirements:
|
169
|
+
- - ! '>='
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
segments:
|
173
|
+
- 0
|
174
|
+
hash: 3464591332541404866
|
175
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
none: false
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
segments:
|
182
|
+
- 0
|
183
|
+
hash: 3464591332541404866
|
184
|
+
requirements:
|
185
|
+
- taglib (libtag1-dev in Debian/Ubuntu, taglib-devel in Fedora/RHEL)
|
186
|
+
rubyforge_project:
|
187
|
+
rubygems_version: 1.8.10
|
188
|
+
signing_key:
|
189
|
+
specification_version: 3
|
190
|
+
summary: Ruby interface for the taglib C++ library
|
191
|
+
test_files: []
|