taglib-ruby 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
  module TagLib
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 0
5
- PATCH = 1
4
+ MINOR = 1
5
+ PATCH = 0
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -26,8 +26,8 @@ DESC
26
26
  s.add_development_dependency 'bundler', '>= 1.2', '< 3'
27
27
  s.add_development_dependency 'rake-compiler', '~> 0.9'
28
28
  s.add_development_dependency 'shoulda-context', '~> 1.0'
29
- s.add_development_dependency 'yard', '~> 0.9.12'
30
- s.add_development_dependency 'kramdown', '~> 1.0'
29
+ s.add_development_dependency 'yard', '~> 0.9.26'
30
+ s.add_development_dependency 'kramdown', '~> 2.3.0'
31
31
  s.add_development_dependency 'test-unit', '~> 3.1'
32
32
 
33
33
  s.extensions = [
@@ -134,6 +134,7 @@ DESC
134
134
  "test/data/crash.mp3",
135
135
  "test/data/flac-create.cpp",
136
136
  "test/data/flac.flac",
137
+ "test/data/flac_nopic.flac",
137
138
  "test/data/get_picture_data.cpp",
138
139
  "test/data/globe_east_540.jpg",
139
140
  "test/data/globe_east_90.jpg",
@@ -155,6 +156,7 @@ DESC
155
156
  "test/fileref_write_test.rb",
156
157
  "test/flac_file_test.rb",
157
158
  "test/flac_file_write_test.rb",
159
+ "test/flac_picture_memory_test.rb",
158
160
  "test/helper.rb",
159
161
  "test/id3v1_genres_test.rb",
160
162
  "test/id3v1_tag_test.rb",
@@ -1,6 +1,6 @@
1
1
  desc "Checks file list in .gemspec against files tracked in Git"
2
2
  task :gemspec_check do |t|
3
- exclude = ['.gitignore', '.travis.yml']
3
+ exclude = ['.gitignore', '.github/workflows/ci.yml']
4
4
  git_files = `git ls-files`.split("\n") - exclude
5
5
  gemspec_files = $gemspec.files
6
6
 
Binary file
@@ -0,0 +1,43 @@
1
+ require File.join(File.dirname(__FILE__), 'helper')
2
+
3
+ class TestFlacPictureMemory < Test::Unit::TestCase
4
+
5
+ N = 10000
6
+
7
+ context "TagLib::FLAC::Picture" do
8
+
9
+ setup do
10
+
11
+ end
12
+
13
+ should "release memory when closing flac file with picture data" do
14
+ c = 0
15
+ N.times do
16
+ TagLib::FLAC::File.open("test/data/flac.flac", false) do |f|
17
+ f.picture_list.each do |p|
18
+ x = p.data
19
+ c = c + 1
20
+ end
21
+ end
22
+ end
23
+ assert_equal N,c
24
+ end
25
+
26
+ should "process a flac file without picture data" do
27
+ c = 0
28
+ N.times do
29
+ TagLib::FLAC::File.open("test/data/flac_nopic.flac", false) do |f|
30
+ f.picture_list.each do |p|
31
+ x = p.data
32
+ c = c + 1
33
+ end
34
+ end
35
+ end
36
+ assert_equal 0,c
37
+ end
38
+
39
+ teardown do
40
+
41
+ end
42
+ end
43
+ end
@@ -92,6 +92,70 @@ class TestID3v2Frames < Test::Unit::TestCase
92
92
  end
93
93
  end
94
94
 
95
+ context 'CTOC and CHAP frames' do
96
+ setup do
97
+ @chapters = [
98
+ { id: 'CH1', start_time: 100, end_time: 200 },
99
+ { id: 'CH2', start_time: 201, end_time: 300 },
100
+ { id: 'CH3', start_time: 301, end_time: 400 }
101
+ ]
102
+
103
+ @default_ctoc = TagLib::ID3v2::TableOfContentsFrame.new('Test')
104
+ @default_chap = TagLib::ID3v2::ChapterFrame.new('Test', 0, 1, 0xFFFFFFFF, 0xFFFFFFFF)
105
+ end
106
+
107
+ should 'not have a CTOC frame' do
108
+ assert_equal [], @tag.frame_list('CTOC')
109
+ end
110
+
111
+ should 'not have a CHAP frame' do
112
+ assert_equal [], @tag.frame_list('CHAP')
113
+ end
114
+
115
+ should 'have one CTOC frame (only one Table of Contents)' do
116
+ toc = TagLib::ID3v2::TableOfContentsFrame.new('TOC')
117
+ toc.is_top_level = true
118
+ toc.is_ordered = true
119
+
120
+ @chapters.each do |chapter|
121
+ toc.add_child_element(chapter[:id])
122
+ end
123
+
124
+ @tag.add_frame(toc)
125
+
126
+ ctoc_frame_list = @tag.frame_list('CTOC')
127
+ assert_equal @default_ctoc.class, ctoc_frame_list.first.class
128
+ assert_equal 1, ctoc_frame_list.size
129
+ assert_equal 'TOC', ctoc_frame_list.first.element_id
130
+ assert_equal 3, ctoc_frame_list.first.child_elements.size
131
+ assert_equal %w[CH1 CH2 CH3], ctoc_frame_list.first.child_elements
132
+ end
133
+
134
+ should 'have CHAP frames (multiple chapters)' do
135
+ start_offset = 0xFFFFFFFF
136
+ end_offset = 0xFFFFFFFF
137
+
138
+ @chapters.each do |chapter|
139
+ chapter_frame = TagLib::ID3v2::ChapterFrame.new(
140
+ chapter[:id],
141
+ chapter[:start_time].to_i,
142
+ chapter[:end_time].to_i,
143
+ start_offset,
144
+ end_offset
145
+ )
146
+
147
+ @tag.add_frame(chapter_frame)
148
+ end
149
+
150
+ chap_frame_list = @tag.frame_list('CHAP')
151
+ assert_equal @default_chap.class, chap_frame_list.first.class
152
+ assert_equal 3, chap_frame_list.size
153
+ assert_equal 'CH1', chap_frame_list[0].element_id
154
+ assert_equal 'CH2', chap_frame_list[1].element_id
155
+ assert_equal 'CH3', chap_frame_list[2].element_id
156
+ end
157
+ end
158
+
95
159
  context "TXXX frame" do
96
160
  setup do
97
161
  @txxx_frame = @tag.frame_list('TXXX').first
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taglib-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Stocker
8
8
  - Jacob Vosmaer
9
9
  - Thomas Chevereau
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-03-25 00:00:00.000000000 Z
13
+ date: 2021-01-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -66,28 +66,28 @@ dependencies:
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.9.12
69
+ version: 0.9.26
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 0.9.12
76
+ version: 0.9.26
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: kramdown
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '1.0'
83
+ version: 2.3.0
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '1.0'
90
+ version: 2.3.0
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: test-unit
93
93
  requirement: !ruby/object:Gem::Requirement
@@ -213,6 +213,7 @@ files:
213
213
  - test/data/crash.mp3
214
214
  - test/data/flac-create.cpp
215
215
  - test/data/flac.flac
216
+ - test/data/flac_nopic.flac
216
217
  - test/data/get_picture_data.cpp
217
218
  - test/data/globe_east_540.jpg
218
219
  - test/data/globe_east_90.jpg
@@ -234,6 +235,7 @@ files:
234
235
  - test/fileref_write_test.rb
235
236
  - test/flac_file_test.rb
236
237
  - test/flac_file_write_test.rb
238
+ - test/flac_picture_memory_test.rb
237
239
  - test/helper.rb
238
240
  - test/id3v1_genres_test.rb
239
241
  - test/id3v1_tag_test.rb
@@ -260,7 +262,7 @@ homepage: http://robinst.github.io/taglib-ruby/
260
262
  licenses:
261
263
  - MIT
262
264
  metadata: {}
263
- post_install_message:
265
+ post_install_message:
264
266
  rdoc_options: []
265
267
  require_paths:
266
268
  - lib
@@ -276,8 +278,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
278
  version: '0'
277
279
  requirements:
278
280
  - taglib (libtag1-dev in Debian/Ubuntu, taglib-devel in Fedora/RHEL)
279
- rubygems_version: 3.0.3
280
- signing_key:
281
+ rubygems_version: 3.1.4
282
+ signing_key:
281
283
  specification_version: 4
282
284
  summary: Ruby interface for the taglib C++ library
283
285
  test_files: []