rtaglib 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +14 -4
- data/README.txt +20 -20
- data/Rakefile +58 -5
- data/ext/{extconf.rb → tagfile/extconf.rb} +1 -1
- data/ext/{rtaglib.c → tagfile/tagfile.c} +90 -41
- data/ext/taglib/extconf.rb +6 -0
- data/ext/taglib/taglib.cxx +17115 -0
- data/swig/Rakefile +33 -0
- data/swig/extconf.rb +6 -0
- data/swig/taglib.i +817 -0
- data/swig/test.rb +266 -0
- data/test/data/440Hz-5sec.flac +0 -0
- data/test/data/440Hz-5sec.mp3 +0 -0
- data/test/data/440Hz-5sec.mpc +0 -0
- data/test/data/440Hz-5sec.ogg +0 -0
- data/test/data/440Hz-5sec.wv +0 -0
- data/test/test_read.rb +12 -11
- data/test/test_taglib.rb +266 -0
- data/test/test_write.rb +41 -7
- metadata +70 -50
- data/ext/Makefile +0 -149
- data/test/data/saw.mp3 +0 -0
data/test/test_write.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'ftools'
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
4
|
+
require File.dirname(__FILE__)+'/../ext/tagfile/tagfile'
|
5
5
|
require 'test/unit'
|
6
|
-
class
|
7
|
-
def initialize(*args)
|
8
|
-
super
|
9
|
-
end
|
6
|
+
class RTagFileWriteTestCase < Test::Unit::TestCase
|
10
7
|
def setup
|
11
|
-
@original=File.dirname(__FILE__)+"/data/
|
8
|
+
@original=File.dirname(__FILE__)+"/data/440Hz-5sec.mp3"
|
12
9
|
@copy="/tmp/test_"+sprintf("%06d",rand(10000))+".mp3"
|
13
|
-
|
10
|
+
|
11
|
+
File.copy(@original, @copy)
|
14
12
|
@file=::TagFile::File.new(@copy)
|
15
13
|
end
|
16
14
|
def teardown
|
@@ -51,6 +49,42 @@ class RtaglibTestCase < Test::Unit::TestCase
|
|
51
49
|
@file.save
|
52
50
|
assert_equal("New Comment",@file.comment)
|
53
51
|
end
|
52
|
+
|
53
|
+
def test_duck_typing_integer_values
|
54
|
+
assert_raise(TypeError) do
|
55
|
+
@file.year = "2008" # note: we set a String here!
|
56
|
+
end
|
57
|
+
# now, give the String the integer casting function
|
58
|
+
::String.module_eval do
|
59
|
+
# let's the string behave like an int: just call to_i to get an integer value
|
60
|
+
alias :to_int :to_i
|
61
|
+
end
|
62
|
+
assert_nothing_raised do
|
63
|
+
@file.year = "2008" # note: we set a String here!
|
64
|
+
end
|
65
|
+
# clean up: remove the added method
|
66
|
+
String.send :remove_method, :to_int
|
67
|
+
assert_equal(2008,@file.year) # note: the result is a Fixnum
|
68
|
+
end # def test_duck_typing_integer_values
|
69
|
+
|
70
|
+
def test_duck_typing_string_values
|
71
|
+
assert_raise(TypeError) do
|
72
|
+
@file.title = Math::PI # note: we set a Float here!
|
73
|
+
end
|
74
|
+
# now, give the String the integer casting function
|
75
|
+
::Float.module_eval do
|
76
|
+
# let's the float behave like a string: round to five digits
|
77
|
+
def to_str
|
78
|
+
sprintf("%0.5f", self)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
assert_nothing_raised do
|
82
|
+
@file.title = Math::PI # note: we set a Float here!
|
83
|
+
end
|
84
|
+
# clean up: remove the added method
|
85
|
+
Float.send :remove_method, :to_str
|
86
|
+
assert_equal("3.14159",@file.title) # note: the result is a String
|
87
|
+
end # def test_duck_typing_string_values
|
54
88
|
end
|
55
89
|
|
56
90
|
# arch-tag: test
|
metadata
CHANGED
@@ -1,68 +1,88 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: rtaglib
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2008-06-23 00:00:00 -04:00
|
8
|
-
summary: Bindings for taglib
|
9
|
-
require_paths:
|
10
|
-
- ext
|
11
|
-
email:
|
12
|
-
- clbustos@surnet.cl
|
13
|
-
homepage: http://rtaglib.rubyforge.org/
|
14
|
-
rubyforge_project: rtaglib
|
15
|
-
description: Rtaglib is a C based binding for Taglib's library (http://developer.kde.org/~wheeler/taglib.html). Uses the same interface of ruby-taglib, but creates a true ruby extension.
|
16
|
-
autorequire: rtaglib
|
17
|
-
default_executable:
|
18
|
-
bindir: bin
|
19
|
-
has_rdoc: true
|
20
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
-
requirements:
|
22
|
-
- - ">"
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 0.0.0
|
25
|
-
version:
|
4
|
+
version: 0.2.0
|
26
5
|
platform: ruby
|
27
|
-
signing_key:
|
28
|
-
cert_chain:
|
29
|
-
post_install_message:
|
30
6
|
authors:
|
31
7
|
- Claudio Bustos
|
8
|
+
autorequire: ""
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-04-07 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.7.0
|
24
|
+
version:
|
25
|
+
description: Rtaglib is a binding for Taglib's library (http://developer.kde.org/~wheeler/taglib.html). TagFile uses the same interface of ruby-taglib, but creates a true ruby extension. Taglib is a complete implementation of the Api, based on swig. See test/test_taglib.rb for examples of use
|
26
|
+
email:
|
27
|
+
- clbustos@surnet.cl
|
28
|
+
executables: []
|
29
|
+
|
30
|
+
extensions:
|
31
|
+
- ext/tagfile/extconf.rb
|
32
|
+
- ext/taglib/extconf.rb
|
33
|
+
extra_rdoc_files:
|
34
|
+
- History.txt
|
35
|
+
- Manifest.txt
|
36
|
+
- README.txt
|
32
37
|
files:
|
33
38
|
- History.txt
|
34
39
|
- Manifest.txt
|
35
40
|
- README.txt
|
36
41
|
- Rakefile
|
37
|
-
- ext/
|
38
|
-
- ext/
|
39
|
-
- ext/
|
40
|
-
-
|
42
|
+
- ext/tagfile/extconf.rb
|
43
|
+
- ext/tagfile/tagfile.c
|
44
|
+
- ext/taglib/extconf.rb
|
45
|
+
- ext/taglib/taglib.cxx
|
46
|
+
- swig/Rakefile
|
47
|
+
- swig/extconf.rb
|
48
|
+
- swig/taglib.i
|
49
|
+
- swig/test.rb
|
50
|
+
- test/data/440Hz-5sec.flac
|
51
|
+
- test/data/440Hz-5sec.mp3
|
52
|
+
- test/data/440Hz-5sec.mpc
|
53
|
+
- test/data/440Hz-5sec.ogg
|
54
|
+
- test/data/440Hz-5sec.wv
|
41
55
|
- test/test_read.rb
|
56
|
+
- test/test_taglib.rb
|
42
57
|
- test/test_write.rb
|
43
|
-
|
44
|
-
|
45
|
-
|
58
|
+
has_rdoc: true
|
59
|
+
homepage: http://rtaglib.rubyforge.org/
|
60
|
+
post_install_message:
|
46
61
|
rdoc_options:
|
47
62
|
- --main
|
48
63
|
- README.txt
|
49
|
-
|
50
|
-
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
64
|
+
require_paths:
|
65
|
+
- ext
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: "0"
|
71
|
+
version:
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: "0"
|
77
|
+
version:
|
57
78
|
requirements:
|
58
79
|
- libtag >=1.4
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
version:
|
80
|
+
rubyforge_project: rtaglib
|
81
|
+
rubygems_version: 1.3.0
|
82
|
+
signing_key:
|
83
|
+
specification_version: 2
|
84
|
+
summary: Bindings for taglib
|
85
|
+
test_files:
|
86
|
+
- test/test_taglib.rb
|
87
|
+
- test/test_write.rb
|
88
|
+
- test/test_read.rb
|
data/ext/Makefile
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
|
2
|
-
SHELL = /bin/sh
|
3
|
-
|
4
|
-
#### Start of system configuration section. ####
|
5
|
-
|
6
|
-
srcdir = .
|
7
|
-
topdir = /usr/lib/ruby/1.8/x86_64-linux
|
8
|
-
hdrdir = $(topdir)
|
9
|
-
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
10
|
-
prefix = $(DESTDIR)/usr
|
11
|
-
exec_prefix = $(prefix)
|
12
|
-
sitedir = $(DESTDIR)/usr/local/lib/site_ruby
|
13
|
-
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
14
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
15
|
-
dvidir = $(docdir)
|
16
|
-
datarootdir = $(prefix)/share
|
17
|
-
archdir = $(rubylibdir)/$(arch)
|
18
|
-
sbindir = $(exec_prefix)/sbin
|
19
|
-
psdir = $(docdir)
|
20
|
-
localedir = $(datarootdir)/locale
|
21
|
-
htmldir = $(docdir)
|
22
|
-
datadir = $(datarootdir)
|
23
|
-
includedir = $(prefix)/include
|
24
|
-
infodir = $(prefix)/share/info
|
25
|
-
sysconfdir = $(DESTDIR)/etc
|
26
|
-
mandir = $(prefix)/share/man
|
27
|
-
libdir = $(exec_prefix)/lib
|
28
|
-
sharedstatedir = $(prefix)/com
|
29
|
-
oldincludedir = $(DESTDIR)/usr/include
|
30
|
-
pdfdir = $(docdir)
|
31
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
32
|
-
bindir = $(exec_prefix)/bin
|
33
|
-
localstatedir = $(DESTDIR)/var
|
34
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
35
|
-
libexecdir = $(prefix)/lib/ruby1.8
|
36
|
-
|
37
|
-
CC = cc
|
38
|
-
LIBRUBY = $(LIBRUBY_SO)
|
39
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
40
|
-
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
41
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
42
|
-
|
43
|
-
RUBY_EXTCONF_H =
|
44
|
-
CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall
|
45
|
-
INCFLAGS = -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
|
46
|
-
CPPFLAGS = -DHAVE_TAGLIB_TAG_C_H
|
47
|
-
CXXFLAGS = $(CFLAGS)
|
48
|
-
DLDFLAGS = -L. -rdynamic -Wl,-export-dynamic
|
49
|
-
LDSHARED = $(CC) -shared
|
50
|
-
AR = ar
|
51
|
-
EXEEXT =
|
52
|
-
|
53
|
-
RUBY_INSTALL_NAME = ruby1.8
|
54
|
-
RUBY_SO_NAME = ruby1.8
|
55
|
-
arch = x86_64-linux
|
56
|
-
sitearch = x86_64-linux
|
57
|
-
ruby_version = 1.8
|
58
|
-
ruby = /usr/bin/ruby1.8
|
59
|
-
RUBY = $(ruby)
|
60
|
-
RM = rm -f
|
61
|
-
MAKEDIRS = mkdir -p
|
62
|
-
INSTALL = /usr/bin/install -c
|
63
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
64
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
65
|
-
COPY = cp
|
66
|
-
|
67
|
-
#### End of system configuration section. ####
|
68
|
-
|
69
|
-
preload =
|
70
|
-
|
71
|
-
libpath = . $(libdir)
|
72
|
-
LIBPATH = -L"." -L"$(libdir)"
|
73
|
-
DEFFILE =
|
74
|
-
|
75
|
-
CLEANFILES = mkmf.log
|
76
|
-
DISTCLEANFILES =
|
77
|
-
|
78
|
-
extout =
|
79
|
-
extout_prefix =
|
80
|
-
target_prefix =
|
81
|
-
LOCAL_LIBS =
|
82
|
-
LIBS = $(LIBRUBYARG_SHARED) -ltag_c -lpthread -ldl -lcrypt -lm -lc
|
83
|
-
SRCS = rtaglib.c
|
84
|
-
OBJS = rtaglib.o
|
85
|
-
TARGET = rtaglib
|
86
|
-
DLLIB = $(TARGET).so
|
87
|
-
EXTSTATIC =
|
88
|
-
STATIC_LIB =
|
89
|
-
|
90
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
91
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
92
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
93
|
-
|
94
|
-
TARGET_SO = $(DLLIB)
|
95
|
-
CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
|
96
|
-
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
97
|
-
|
98
|
-
all: $(DLLIB)
|
99
|
-
static: $(STATIC_LIB)
|
100
|
-
|
101
|
-
clean:
|
102
|
-
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
103
|
-
|
104
|
-
distclean: clean
|
105
|
-
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
106
|
-
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
107
|
-
|
108
|
-
realclean: distclean
|
109
|
-
install: install-so install-rb
|
110
|
-
|
111
|
-
install-so: $(RUBYARCHDIR)
|
112
|
-
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
113
|
-
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
114
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
115
|
-
install-rb: pre-install-rb install-rb-default
|
116
|
-
install-rb-default: pre-install-rb-default
|
117
|
-
pre-install-rb: Makefile
|
118
|
-
pre-install-rb-default: Makefile
|
119
|
-
$(RUBYARCHDIR):
|
120
|
-
$(MAKEDIRS) $@
|
121
|
-
|
122
|
-
site-install: site-install-so site-install-rb
|
123
|
-
site-install-so: install-so
|
124
|
-
site-install-rb: install-rb
|
125
|
-
|
126
|
-
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
127
|
-
|
128
|
-
.cc.o:
|
129
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
130
|
-
|
131
|
-
.cxx.o:
|
132
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
133
|
-
|
134
|
-
.cpp.o:
|
135
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
136
|
-
|
137
|
-
.C.o:
|
138
|
-
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
139
|
-
|
140
|
-
.c.o:
|
141
|
-
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
142
|
-
|
143
|
-
$(DLLIB): $(OBJS)
|
144
|
-
@-$(RM) $@
|
145
|
-
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
$(OBJS): ruby.h defines.h
|
data/test/data/saw.mp3
DELETED
Binary file
|