rtaglib 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/extconf.rb +2 -2
- data/ext/mkmf.log +2 -2
- data/ext/rtaglib.c +2 -2
- data/ext/test.rb +12 -0
- data/svn-commit.tmp +4 -0
- data/tests/saw.mp3 +0 -0
- data/tests/test_read.rb +34 -0
- data/tests/test_write.rb +56 -0
- metadata +11 -8
- data/tests/test_audioinfo.rb +0 -14
data/ext/extconf.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require "mkmf"
|
2
|
-
$CFLAGS+=" -WAll"
|
2
|
+
$CFLAGS+=" -WAll "
|
3
3
|
dir_config("tag_c")
|
4
4
|
if have_library("tag_c") and have_header("taglib/tag_c.h")
|
5
|
-
|
5
|
+
$CFLAGS+=`pkg-config --cflags taglib`
|
6
6
|
create_makefile("rtaglib")
|
7
7
|
else
|
8
8
|
print "*** ERROR: Need taglib library\n"
|
data/ext/mkmf.log
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
have_library: checking for main() in -ltag_c... -------------------- yes
|
2
2
|
|
3
|
-
"i686-pc-linux-gnu-gcc -o conftest -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll
|
3
|
+
"i686-pc-linux-gnu-gcc -o conftest -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll conftest.c -L'/usr/lib' -Wl,-R'/usr/lib' -lruby18-static -ltag_c -ldl -lcrypt -lm -lc"
|
4
4
|
checked program was:
|
5
5
|
/* begin */
|
6
6
|
|
@@ -13,7 +13,7 @@ int t() { main(); return 0; }
|
|
13
13
|
|
14
14
|
have_header: checking for taglib/tag_c.h... -------------------- yes
|
15
15
|
|
16
|
-
"i686-pc-linux-gnu-gcc -E -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll
|
16
|
+
"i686-pc-linux-gnu-gcc -E -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll conftest.c -o conftest.i"
|
17
17
|
checked program was:
|
18
18
|
/* begin */
|
19
19
|
#include <taglib/tag_c.h>
|
data/ext/rtaglib.c
CHANGED
@@ -97,11 +97,11 @@ Init_rtaglib()
|
|
97
97
|
"comment", cTagFileFile_comment, 0}, {
|
98
98
|
"comment=", cTagFileFile_comment_set, 1}, {
|
99
99
|
"genre", cTagFileFile_genre, 0}, {
|
100
|
-
"genre=", cTagFileFile_genre_set,
|
100
|
+
"genre=", cTagFileFile_genre_set, 1}, {
|
101
101
|
"track", cTagFileFile_track, 0}, {
|
102
102
|
"track=", cTagFileFile_track_set, 1}, {
|
103
103
|
"year", cTagFileFile_year, 0}, {
|
104
|
-
"year=",
|
104
|
+
"year=", cTagFileFile_year_set, 1}, {
|
105
105
|
"length", cTagFileFile_length, 0}, {
|
106
106
|
"bitrate", cTagFileFile_bitrate, 0}, {
|
107
107
|
"samplerate", cTagFileFile_samplerate, 0}, {
|
data/ext/test.rb
CHANGED
data/svn-commit.tmp
ADDED
data/tests/saw.mp3
CHANGED
Binary file
|
data/tests/test_read.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require_gem 'rtaglib'
|
4
|
+
require 'test/unit'
|
5
|
+
class RtaglibTestCase < Test::Unit::TestCase
|
6
|
+
def initialize(*args)
|
7
|
+
super
|
8
|
+
@file=::TagFile::File.new(File.dirname(__FILE__)+"/saw.mp3")
|
9
|
+
|
10
|
+
end
|
11
|
+
def test_title()
|
12
|
+
assert_equal("Saw",@file.title)
|
13
|
+
end
|
14
|
+
def test_artist()
|
15
|
+
assert_equal("Claudio Bustos",@file.artist)
|
16
|
+
end
|
17
|
+
def test_album()
|
18
|
+
assert_equal("Catori",@file.album)
|
19
|
+
end
|
20
|
+
def test_genre()
|
21
|
+
assert_equal("Lo-Fi",@file.genre)
|
22
|
+
end
|
23
|
+
def test_track()
|
24
|
+
assert_equal(1,@file.track)
|
25
|
+
end
|
26
|
+
def test_year()
|
27
|
+
assert_equal(2005,@file.year)
|
28
|
+
end
|
29
|
+
def test_comment()
|
30
|
+
assert_equal("Test for catori",@file.comment)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# arch-tag: test
|
data/tests/test_write.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'ftools'
|
3
|
+
require 'rubygems'
|
4
|
+
require_gem 'rtaglib'
|
5
|
+
require 'test/unit'
|
6
|
+
class RtaglibTestCase < Test::Unit::TestCase
|
7
|
+
def initialize(*args)
|
8
|
+
super
|
9
|
+
@original=File.dirname(__FILE__)+"/saw.mp3"
|
10
|
+
end
|
11
|
+
def setup
|
12
|
+
@copy="/tmp/test_"+sprintf("%06d",rand(10000))+".mp3"
|
13
|
+
File.copy(@original,@copy)
|
14
|
+
@file=::TagFile::File.new(@copy)
|
15
|
+
end
|
16
|
+
def teardown
|
17
|
+
File.delete(@copy)
|
18
|
+
end
|
19
|
+
def test_title()
|
20
|
+
@file.title="Saw2"
|
21
|
+
@file.save
|
22
|
+
assert_equal("Saw2",@file.title)
|
23
|
+
end
|
24
|
+
def test_artist()
|
25
|
+
@file.artist="Nobody"
|
26
|
+
@file.save
|
27
|
+
assert_equal("Nobody",@file.artist)
|
28
|
+
end
|
29
|
+
def test_album()
|
30
|
+
@file.album="Dupa"
|
31
|
+
@file.save
|
32
|
+
assert_equal("Dupa",@file.album)
|
33
|
+
end
|
34
|
+
def test_genre()
|
35
|
+
@file.genre="Progressive Rock"
|
36
|
+
@file.save
|
37
|
+
assert_equal("Progressive Rock",@file.genre)
|
38
|
+
end
|
39
|
+
def test_track()
|
40
|
+
@file.track=2
|
41
|
+
@file.save
|
42
|
+
assert_equal(2,@file.track)
|
43
|
+
end
|
44
|
+
def test_year()
|
45
|
+
@file.year=2010
|
46
|
+
@file.save
|
47
|
+
assert_equal(2010,@file.year)
|
48
|
+
end
|
49
|
+
def test_comment()
|
50
|
+
@file.comment="New Comment"
|
51
|
+
@file.save
|
52
|
+
assert_equal("New Comment",@file.comment)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# arch-tag: test
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rtaglib
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2006-01-11 00:00:00 -03:00
|
8
8
|
summary: Bindings for taglib
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -33,18 +33,21 @@ authors:
|
|
33
33
|
files:
|
34
34
|
- "./ext"
|
35
35
|
- "./tests"
|
36
|
-
- "./
|
36
|
+
- "./svn-commit.tmp"
|
37
|
+
- "./ext/test.rb"
|
37
38
|
- "./ext/rtaglib.c"
|
39
|
+
- "./ext/extconf.rb"
|
38
40
|
- "./ext/mkmf.log"
|
39
|
-
- "./
|
41
|
+
- "./tests/test_read.rb"
|
40
42
|
- "./tests/saw.mp3"
|
41
|
-
- "./tests/
|
43
|
+
- "./tests/test_write.rb"
|
44
|
+
- tests/test_read.rb
|
42
45
|
- tests/saw.mp3
|
43
|
-
- tests/
|
44
|
-
- ext/
|
46
|
+
- tests/test_write.rb
|
47
|
+
- ext/test.rb
|
45
48
|
- ext/rtaglib.c
|
49
|
+
- ext/extconf.rb
|
46
50
|
- ext/mkmf.log
|
47
|
-
- ext/test.rb
|
48
51
|
test_files: []
|
49
52
|
rdoc_options: []
|
50
53
|
extra_rdoc_files: []
|
data/tests/test_audioinfo.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'rubygems'
|
3
|
-
require_gem 'rtaglib'
|
4
|
-
require 'test/unit'
|
5
|
-
class RtaglibTestCase < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def initialize(*args)
|
8
|
-
super
|
9
|
-
@file=::TagFile::File.new(File.dirname(__FILE__)+"/saw.mp3")
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
# arch-tag: test
|