taglib-ruby 0.4.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.yardopts +9 -0
  2. data/CHANGES.md +53 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +8 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +87 -0
  7. data/Rakefile +29 -0
  8. data/docs/default/fulldoc/html/css/common.css +1 -0
  9. data/docs/taglib/base.rb +202 -0
  10. data/docs/taglib/id3v1.rb +5 -0
  11. data/docs/taglib/id3v2.rb +444 -0
  12. data/docs/taglib/mpeg.rb +120 -0
  13. data/docs/taglib/ogg.rb +77 -0
  14. data/docs/taglib/vorbis.rb +62 -0
  15. data/ext/extconf_common.rb +29 -0
  16. data/ext/taglib_base/extconf.rb +4 -0
  17. data/ext/taglib_base/includes.i +115 -0
  18. data/ext/taglib_base/taglib_base.i +139 -0
  19. data/ext/taglib_base/taglib_base_wrap.cxx +5153 -0
  20. data/ext/taglib_id3v1/extconf.rb +4 -0
  21. data/ext/taglib_id3v1/taglib_id3v1.i +11 -0
  22. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +3110 -0
  23. data/ext/taglib_id3v2/extconf.rb +4 -0
  24. data/ext/taglib_id3v2/relativevolumeframe.i +35 -0
  25. data/ext/taglib_id3v2/taglib_id3v2.i +112 -0
  26. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +9033 -0
  27. data/ext/taglib_mpeg/extconf.rb +4 -0
  28. data/ext/taglib_mpeg/taglib_mpeg.i +75 -0
  29. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +4726 -0
  30. data/ext/taglib_ogg/extconf.rb +4 -0
  31. data/ext/taglib_ogg/taglib_ogg.i +36 -0
  32. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +3631 -0
  33. data/ext/taglib_vorbis/extconf.rb +4 -0
  34. data/ext/taglib_vorbis/taglib_vorbis.i +48 -0
  35. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +3083 -0
  36. data/ext/valgrind-suppressions.txt +170 -0
  37. data/ext/win.cmake +5 -0
  38. data/lib/libtag.dll +0 -0
  39. data/lib/taglib.rb +14 -0
  40. data/lib/taglib/base.rb +19 -0
  41. data/lib/taglib/id3v1.rb +1 -0
  42. data/lib/taglib/id3v2.rb +20 -0
  43. data/lib/taglib/mpeg.rb +7 -0
  44. data/lib/taglib/ogg.rb +1 -0
  45. data/lib/taglib/version.rb +10 -0
  46. data/lib/taglib/vorbis.rb +7 -0
  47. data/lib/taglib_base.so +0 -0
  48. data/lib/taglib_id3v1.so +0 -0
  49. data/lib/taglib_id3v2.so +0 -0
  50. data/lib/taglib_mpeg.so +0 -0
  51. data/lib/taglib_ogg.so +0 -0
  52. data/lib/taglib_vorbis.so +0 -0
  53. data/taglib-ruby.gemspec +122 -0
  54. data/tasks/docs_coverage.rake +26 -0
  55. data/tasks/ext.rake +81 -0
  56. data/tasks/gemspec_check.rake +19 -0
  57. data/tasks/swig.rake +43 -0
  58. data/test/data/Makefile +15 -0
  59. data/test/data/add-relative-volume.cpp +40 -0
  60. data/test/data/crash.mp3 +0 -0
  61. data/test/data/globe_east_540.jpg +0 -0
  62. data/test/data/id3v1-create.cpp +31 -0
  63. data/test/data/id3v1.mp3 +0 -0
  64. data/test/data/relative-volume.mp3 +0 -0
  65. data/test/data/sample.mp3 +0 -0
  66. data/test/data/unicode.mp3 +0 -0
  67. data/test/data/vorbis-create.cpp +42 -0
  68. data/test/data/vorbis.oga +0 -0
  69. data/test/fileref_open_test.rb +32 -0
  70. data/test/fileref_properties_test.rb +21 -0
  71. data/test/fileref_write_test.rb +62 -0
  72. data/test/helper.rb +10 -0
  73. data/test/id3v1_tag_test.rb +36 -0
  74. data/test/id3v2_frames_test.rb +115 -0
  75. data/test/id3v2_memory_test.rb +87 -0
  76. data/test/id3v2_relative_volume_test.rb +62 -0
  77. data/test/id3v2_tag_test.rb +59 -0
  78. data/test/id3v2_unicode_test.rb +47 -0
  79. data/test/id3v2_write_test.rb +100 -0
  80. data/test/mpeg_file_test.rb +76 -0
  81. data/test/tag_test.rb +21 -0
  82. data/test/unicode_filename_test.rb +29 -0
  83. data/test/vorbis_file_test.rb +54 -0
  84. data/test/vorbis_tag_test.rb +79 -0
  85. metadata +191 -0
@@ -0,0 +1,170 @@
1
+ {
2
+ taglib_base SWIG_InitializeModule
3
+ exp-ptrcheck:SorG
4
+ fun:Init_taglib_base
5
+ fun:dln_load
6
+ }
7
+ {
8
+ taglib_id3v2 SWIG_InitializeModule
9
+ exp-ptrcheck:SorG
10
+ fun:Init_taglib_id3v2
11
+ fun:dln_load
12
+ }
13
+ {
14
+ taglib_mpeg SWIG_InitializeModule
15
+ exp-ptrcheck:SorG
16
+ fun:Init_taglib_mpeg
17
+ fun:dln_load
18
+ }
19
+ # Ruby 1.9 VM supressions
20
+ {
21
+ r1
22
+ Memcheck:Cond
23
+ fun:gc_mark
24
+ }
25
+ {
26
+ r2
27
+ Memcheck:Cond
28
+ fun:gc_mark_children
29
+ }
30
+ {
31
+ r3
32
+ Memcheck:Cond
33
+ fun:mark_current_machine_context
34
+ }
35
+ {
36
+ r4
37
+ Memcheck:Value8
38
+ fun:gc_mark
39
+ }
40
+ {
41
+ r5
42
+ Memcheck:Value8
43
+ fun:gc_mark_children
44
+ }
45
+ {
46
+ r6
47
+ Memcheck:Value8
48
+ fun:mark_current_machine_context
49
+ }
50
+ {
51
+ r7
52
+ Memcheck:Value8
53
+ fun:vm_exec_core
54
+ }
55
+ {
56
+ r8
57
+ Memcheck:Value4
58
+ fun:find_derivation
59
+ }
60
+ {
61
+ r9
62
+ Memcheck:Value8
63
+ fun:__gconv_read_conf
64
+ }
65
+ {
66
+ r10
67
+ Memcheck:Leak
68
+ fun:malloc
69
+ fun:vm_xmalloc
70
+ fun:ruby_strdup
71
+ }
72
+ {
73
+ r11
74
+ Memcheck:Leak
75
+ fun:malloc
76
+ fun:vm_xmalloc
77
+ fun:rb_include_module
78
+ }
79
+ {
80
+ r12
81
+ Memcheck:Leak
82
+ ...
83
+ fun:ruby_init
84
+ fun:main
85
+ }
86
+ {
87
+ r20
88
+ exp-ptrcheck:SorG
89
+ fun:insert_module
90
+ }
91
+ {
92
+ r21
93
+ exp-ptrcheck:SorG
94
+ fun:find_derivation
95
+ }
96
+ {
97
+ r22
98
+ exp-ptrcheck:SorG
99
+ fun:vm_exec_core
100
+ }
101
+ {
102
+ r23
103
+ exp-ptrcheck:SorG
104
+ fun:__gconv_read_conf
105
+ }
106
+ {
107
+ r24
108
+ exp-ptrcheck:SorG
109
+ fun:mark_current_machine_context
110
+ }
111
+ # Ruby 1.8 suppressions
112
+ {
113
+ r18_1
114
+ Memcheck:Cond
115
+ fun:mark_locations_array
116
+ ...
117
+ fun:yycompile
118
+ }
119
+ {
120
+ r18_2
121
+ Memcheck:Cond
122
+ fun:mark_locations_array
123
+ ...
124
+ fun:rb_eval
125
+ }
126
+ {
127
+ r18_3
128
+ Memcheck:Leak
129
+ fun:malloc
130
+ fun:ruby_xmalloc
131
+ fun:scope_dup
132
+ }
133
+ {
134
+ r18_4
135
+ Memcheck:Leak
136
+ fun:malloc
137
+ ...
138
+ fun:yycompile
139
+ }
140
+ {
141
+ r18_5
142
+ exp-ptrcheck:SorG
143
+ fun:mark_locations_array
144
+ fun:garbage_collect
145
+ ...
146
+ fun:yycompile
147
+ }
148
+ {
149
+ r18_6
150
+ exp-ptrcheck:Heap
151
+ ...
152
+ fun:rb_intern
153
+ fun:rb_str_intern
154
+ fun:rb_to_id
155
+ fun:rb_mod_alias_method
156
+ }
157
+ {
158
+ r18_7
159
+ exp-ptrcheck:SorG
160
+ fun:ruby_yyparse
161
+ fun:yycompile
162
+ }
163
+ {
164
+ r18_8
165
+ exp-ptrcheck:SorG
166
+ fun:ruby_re_compile_pattern
167
+ fun:rb_reg_initialize
168
+ ...
169
+ fun:rb_class_new_instance
170
+ }
data/ext/win.cmake ADDED
@@ -0,0 +1,5 @@
1
+ SET(CMAKE_SYSTEM_NAME Windows)
2
+
3
+ SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
4
+ SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
5
+ SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
data/lib/libtag.dll ADDED
Binary file
data/lib/taglib.rb ADDED
@@ -0,0 +1,14 @@
1
+ platform = RUBY_PLATFORM.split("-")[1]
2
+ if platform == 'mingw32'
3
+ # Enable loading of pre-compiled libtag.dll
4
+ lib = File.expand_path(File.dirname(__FILE__))
5
+ ENV['PATH'] += (File::PATH_SEPARATOR + lib)
6
+ end
7
+
8
+ require 'taglib/version'
9
+ require 'taglib/base'
10
+ require 'taglib/mpeg'
11
+ require 'taglib/id3v1'
12
+ require 'taglib/id3v2'
13
+ require 'taglib/ogg'
14
+ require 'taglib/vorbis'
@@ -0,0 +1,19 @@
1
+ require 'taglib_base'
2
+
3
+ module TagLib
4
+ module FileOpenable
5
+ def open(*args)
6
+ file = self.new(*args)
7
+ begin
8
+ result = yield file
9
+ ensure
10
+ file.close
11
+ end
12
+ result
13
+ end
14
+ end
15
+
16
+ class FileRef
17
+ extend FileOpenable
18
+ end
19
+ end
@@ -0,0 +1 @@
1
+ require 'taglib_id3v1'
@@ -0,0 +1,20 @@
1
+ require 'taglib_id3v2'
2
+
3
+ module TagLib
4
+ module ID3v2
5
+ class Frame
6
+ def to_s
7
+ to_string
8
+ end
9
+
10
+ def inspect
11
+ # Overwrite inspect because Object#inspect calls to_s. In case
12
+ # of an unlinked frame, calling to_s would lead to calling into
13
+ # SWIG through to_string, which in turn would raise an exception
14
+ # with a message including an inspect of this object, which
15
+ # would call to_s -> stack overflow.
16
+ "#<%s:0x%x>" % [self.class.to_s, object_id << 1]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ require 'taglib_mpeg'
2
+
3
+ module TagLib::MPEG
4
+ class File
5
+ extend ::TagLib::FileOpenable
6
+ end
7
+ end
data/lib/taglib/ogg.rb ADDED
@@ -0,0 +1 @@
1
+ require 'taglib_ogg'
@@ -0,0 +1,10 @@
1
+ module TagLib
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 4
5
+ PATCH = 0
6
+ BUILD = nil
7
+
8
+ STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'taglib_vorbis'
2
+
3
+ module TagLib::Ogg::Vorbis
4
+ class File
5
+ extend ::TagLib::FileOpenable
6
+ end
7
+ end
Binary file
Binary file
Binary file
Binary file
data/lib/taglib_ogg.so ADDED
Binary file
Binary file
@@ -0,0 +1,122 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
4
+
5
+ require 'taglib/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "taglib-ruby"
9
+ s.version = TagLib::Version::STRING
10
+ s.authors = ["Robin Stocker"]
11
+ s.email = ["robin@nibor.org"]
12
+ s.homepage = "http://robinst.github.com/taglib-ruby/"
13
+ s.licenses = ["MIT"]
14
+ s.summary = "Ruby interface for the taglib C++ library"
15
+ s.description = <<DESC
16
+ Ruby interface for the taglib C++ library.
17
+
18
+ In contrast to other libraries, this one wraps the C++ API using SWIG,
19
+ not only the minimal C API. This means that all tags can be accessed.
20
+ DESC
21
+
22
+ s.require_paths = ["lib"]
23
+ s.requirements = ["taglib (libtag1-dev in Debian/Ubuntu, taglib-devel in Fedora/RHEL)"]
24
+
25
+ s.add_development_dependency 'bundler', '~> 1.1.0'
26
+ s.add_development_dependency 'rake-compiler', '~> 0.8'
27
+ s.add_development_dependency 'shoulda-context', '~> 1.0'
28
+ s.add_development_dependency 'yard', '~> 0.7'
29
+
30
+ s.extensions = [
31
+ "ext/taglib_base/extconf.rb",
32
+ "ext/taglib_mpeg/extconf.rb",
33
+ "ext/taglib_id3v1/extconf.rb",
34
+ "ext/taglib_id3v2/extconf.rb",
35
+ "ext/taglib_ogg/extconf.rb",
36
+ "ext/taglib_vorbis/extconf.rb",
37
+ ]
38
+ s.extra_rdoc_files = [
39
+ "CHANGES.md",
40
+ "LICENSE.txt",
41
+ "README.md",
42
+ ]
43
+ s.files = [
44
+ ".yardopts",
45
+ "CHANGES.md",
46
+ "Gemfile",
47
+ "Guardfile",
48
+ "LICENSE.txt",
49
+ "README.md",
50
+ "Rakefile",
51
+ "docs/default/fulldoc/html/css/common.css",
52
+ "docs/taglib/base.rb",
53
+ "docs/taglib/id3v1.rb",
54
+ "docs/taglib/id3v2.rb",
55
+ "docs/taglib/mpeg.rb",
56
+ "docs/taglib/ogg.rb",
57
+ "docs/taglib/vorbis.rb",
58
+ "ext/extconf_common.rb",
59
+ "ext/taglib_base/extconf.rb",
60
+ "ext/taglib_base/includes.i",
61
+ "ext/taglib_base/taglib_base.i",
62
+ "ext/taglib_base/taglib_base_wrap.cxx",
63
+ "ext/taglib_id3v1/extconf.rb",
64
+ "ext/taglib_id3v1/taglib_id3v1.i",
65
+ "ext/taglib_id3v1/taglib_id3v1_wrap.cxx",
66
+ "ext/taglib_id3v2/extconf.rb",
67
+ "ext/taglib_id3v2/relativevolumeframe.i",
68
+ "ext/taglib_id3v2/taglib_id3v2.i",
69
+ "ext/taglib_id3v2/taglib_id3v2_wrap.cxx",
70
+ "ext/taglib_mpeg/extconf.rb",
71
+ "ext/taglib_mpeg/taglib_mpeg.i",
72
+ "ext/taglib_mpeg/taglib_mpeg_wrap.cxx",
73
+ "ext/taglib_ogg/extconf.rb",
74
+ "ext/taglib_ogg/taglib_ogg.i",
75
+ "ext/taglib_ogg/taglib_ogg_wrap.cxx",
76
+ "ext/taglib_vorbis/extconf.rb",
77
+ "ext/taglib_vorbis/taglib_vorbis.i",
78
+ "ext/taglib_vorbis/taglib_vorbis_wrap.cxx",
79
+ "ext/valgrind-suppressions.txt",
80
+ "ext/win.cmake",
81
+ "lib/taglib.rb",
82
+ "lib/taglib/base.rb",
83
+ "lib/taglib/id3v1.rb",
84
+ "lib/taglib/id3v2.rb",
85
+ "lib/taglib/mpeg.rb",
86
+ "lib/taglib/ogg.rb",
87
+ "lib/taglib/version.rb",
88
+ "lib/taglib/vorbis.rb",
89
+ "taglib-ruby.gemspec",
90
+ "tasks/docs_coverage.rake",
91
+ "tasks/ext.rake",
92
+ "tasks/gemspec_check.rake",
93
+ "tasks/swig.rake",
94
+ "test/data/Makefile",
95
+ "test/data/add-relative-volume.cpp",
96
+ "test/data/crash.mp3",
97
+ "test/data/globe_east_540.jpg",
98
+ "test/data/id3v1-create.cpp",
99
+ "test/data/id3v1.mp3",
100
+ "test/data/relative-volume.mp3",
101
+ "test/data/sample.mp3",
102
+ "test/data/unicode.mp3",
103
+ "test/data/vorbis-create.cpp",
104
+ "test/data/vorbis.oga",
105
+ "test/helper.rb",
106
+ "test/fileref_open_test.rb",
107
+ "test/fileref_properties_test.rb",
108
+ "test/fileref_write_test.rb",
109
+ "test/id3v1_tag_test.rb",
110
+ "test/id3v2_frames_test.rb",
111
+ "test/id3v2_memory_test.rb",
112
+ "test/id3v2_relative_volume_test.rb",
113
+ "test/id3v2_tag_test.rb",
114
+ "test/id3v2_unicode_test.rb",
115
+ "test/id3v2_write_test.rb",
116
+ "test/mpeg_file_test.rb",
117
+ "test/tag_test.rb",
118
+ "test/unicode_filename_test.rb",
119
+ "test/vorbis_file_test.rb",
120
+ "test/vorbis_tag_test.rb",
121
+ ]
122
+ end
@@ -0,0 +1,26 @@
1
+ desc "Show the coverage of the actual API in ext/ by the API docs in docs/"
2
+ task :docs_coverage do |t|
3
+ def sort(objects)
4
+ objects.sort_by { |obj| obj.path }
5
+ end
6
+
7
+ YARD.parse("ext/**/*_wrap.cxx")
8
+ ext_codeobjects = sort(YARD::Registry.all)
9
+ YARD::Registry.clear
10
+ YARD.parse("docs/**/*.rb")
11
+ docs_codeobjects = sort(YARD::Registry.all(:module, :class, :method))
12
+
13
+ only_in_ext = (ext_codeobjects - docs_codeobjects)
14
+ only_in_docs = (docs_codeobjects - ext_codeobjects)
15
+
16
+ unless only_in_ext.empty?
17
+ puts
18
+ puts "=== Only in ext (to document): "
19
+ puts only_in_ext
20
+ end
21
+ unless only_in_docs.empty?
22
+ puts
23
+ puts "=== Only in docs (typo?): "
24
+ puts only_in_docs
25
+ end
26
+ end
data/tasks/ext.rake ADDED
@@ -0,0 +1,81 @@
1
+ # Extension tasks and cross-compiling
2
+
3
+ host = 'i686-w64-mingw32'
4
+ plat = 'x86-mingw32'
5
+
6
+ tmp = "#{Dir.pwd}/tmp/#{plat}"
7
+ toolchain_file = "#{Dir.pwd}/ext/win.cmake"
8
+ install_dir = "#{tmp}/install"
9
+ install_dll = "#{install_dir}/bin/libtag.dll"
10
+ $cross_config_options = ["--with-opt-dir=#{install_dir}"]
11
+
12
+ taglib_version = '1.7.1'
13
+ taglib = "taglib-#{taglib_version}"
14
+ taglib_url = "http://cloud.github.com/downloads/taglib/taglib/#{taglib}.tar.gz"
15
+ # WITH_MP4, WITH_ASF only needed with taglib 1.7, will be default in 1.8
16
+ taglib_options = "-DCMAKE_BUILD_TYPE=Release -DWITH_MP4=ON -DWITH_ASF=ON"
17
+
18
+ def configure_cross_compile(ext)
19
+ ext.cross_compile = true
20
+ ext.cross_config_options.concat($cross_config_options)
21
+ ext.cross_compiling do |gem|
22
+ gem.files << "lib/libtag.dll"
23
+ end
24
+ end
25
+
26
+ require 'rake/extensiontask'
27
+ Rake::ExtensionTask.new("taglib_base", $gemspec) do |ext|
28
+ configure_cross_compile(ext)
29
+ end
30
+ Rake::ExtensionTask.new("taglib_mpeg", $gemspec) do |ext|
31
+ configure_cross_compile(ext)
32
+ end
33
+ Rake::ExtensionTask.new("taglib_id3v1", $gemspec) do |ext|
34
+ configure_cross_compile(ext)
35
+ end
36
+ Rake::ExtensionTask.new("taglib_id3v2", $gemspec) do |ext|
37
+ configure_cross_compile(ext)
38
+ end
39
+ Rake::ExtensionTask.new("taglib_ogg", $gemspec) do |ext|
40
+ configure_cross_compile(ext)
41
+ end
42
+ Rake::ExtensionTask.new("taglib_vorbis", $gemspec) do |ext|
43
+ configure_cross_compile(ext)
44
+ end
45
+
46
+ task :cross => [:taglib] do
47
+ # Mkmf just uses "g++" as C++ compiler, despite what's in rbconfig.rb.
48
+ # So, we need to hack around it by setting CXX to the cross compiler.
49
+ ENV["CXX"] = "#{host}-g++"
50
+ install install_dll, "lib/"
51
+ end
52
+
53
+ task :taglib => [install_dll]
54
+
55
+ file install_dll => ["#{tmp}/#{taglib}"] do
56
+ chdir "#{tmp}/#{taglib}" do
57
+ sh "cmake -DCMAKE_INSTALL_PREFIX=#{install_dir} -DCMAKE_TOOLCHAIN_FILE=#{toolchain_file} #{taglib_options}"
58
+ sh "make"
59
+ sh "make install"
60
+ end
61
+ end
62
+
63
+ file "#{tmp}/#{taglib}" => ["#{tmp}/#{taglib}.tar.gz"] do
64
+ chdir tmp do
65
+ sh "tar xzf #{taglib}.tar.gz"
66
+ end
67
+ end
68
+
69
+ file "#{tmp}/#{taglib}.tar.gz" => [tmp] do |t|
70
+ require 'open-uri'
71
+ puts "Downloading #{taglib_url}"
72
+ data = open(taglib_url).read()
73
+ break if data == nil
74
+ chdir tmp do
75
+ open(File.basename(t.name), 'wb') do |f|
76
+ f.write(data)
77
+ end
78
+ end
79
+ end
80
+
81
+ directory tmp