taglib-ruby 0.4.0-x86-mingw32 → 0.5.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,81 @@
1
+ require File.join(File.dirname(__FILE__), 'helper')
2
+
3
+ class FlacFileWriteTest < Test::Unit::TestCase
4
+
5
+ SAMPLE_FILE = "test/data/flac.flac"
6
+ OUTPUT_FILE = "test/data/output.flac"
7
+ PICTURE_FILE = "test/data/globe_east_90.jpg"
8
+
9
+ def reloaded
10
+ TagLib::FLAC::File.open(OUTPUT_FILE, false) do |file|
11
+ yield file
12
+ end
13
+ end
14
+
15
+ context "TagLib::FLAC::File" do
16
+ setup do
17
+ FileUtils.cp SAMPLE_FILE, OUTPUT_FILE
18
+ @file = TagLib::FLAC::File.new(OUTPUT_FILE, false)
19
+ end
20
+
21
+ should "be able to save the title" do
22
+ tag = @file.tag
23
+ assert_not_nil tag
24
+ tag.title = "New Title"
25
+ success = @file.save
26
+ assert success
27
+ @file.close
28
+ @file = nil
29
+
30
+ written_title = reloaded do |file|
31
+ file.tag.title
32
+ end
33
+ assert_equal "New Title", written_title
34
+ end
35
+
36
+ should "be able to remove pictures" do
37
+ assert_equal 1, @file.picture_list.size
38
+ @file.remove_pictures
39
+ assert_equal 0, @file.picture_list.size
40
+ success = @file.save
41
+ assert success
42
+ end
43
+
44
+ should "be able to add and save a new picture" do
45
+ picture_data = File.open(PICTURE_FILE, 'rb') { |f| f.read }
46
+
47
+ pic = TagLib::FLAC::Picture.new
48
+ pic.type = TagLib::FLAC::Picture::FrontCover
49
+ pic.mime_type = "image/jpeg"
50
+ pic.description = "desc"
51
+ pic.width = 90
52
+ pic.height = 90
53
+ pic.data = picture_data
54
+
55
+ assert_equal 1, @file.picture_list.size
56
+ @file.add_picture(pic)
57
+ assert_equal 2, @file.picture_list.size
58
+
59
+ success = @file.save
60
+ assert success
61
+
62
+ reloaded do |file|
63
+ written_pic = file.picture_list.last
64
+ assert_equal TagLib::FLAC::Picture::FrontCover, written_pic.type
65
+ assert_equal "image/jpeg", written_pic.mime_type
66
+ assert_equal "desc", written_pic.description
67
+ assert_equal 90, written_pic.width
68
+ assert_equal 90, written_pic.height
69
+ assert_equal picture_data, written_pic.data
70
+ end
71
+ end
72
+
73
+ teardown do
74
+ if @file
75
+ @file.close
76
+ @file = nil
77
+ end
78
+ FileUtils.rm OUTPUT_FILE
79
+ end
80
+ end
81
+ end
@@ -25,7 +25,7 @@ class TestID3v2Frames < Test::Unit::TestCase
25
25
  end
26
26
 
27
27
  should "be enumerable" do
28
- ids = @frames.collect{ |frame| frame.frame_id }
28
+ ids = @frames.collect { |frame| frame.frame_id }
29
29
  assert_equal ["TIT2", "TPE1", "TALB", "TRCK", "TDRC",
30
30
  "COMM", "COMM", "TCON", "TXXX", "COMM", "APIC"], ids
31
31
  end
@@ -57,7 +57,7 @@ class TestID3v2Frames < Test::Unit::TestCase
57
57
  should "be removable by ID" do
58
58
  frames = @tag.frame_list
59
59
  @tag.remove_frames('COMM')
60
- tit2 = frames.find{ |f| f.frame_id == 'TIT2' }
60
+ tit2 = frames.find { |f| f.frame_id == 'TIT2' }
61
61
  # Other frames should still be accessible
62
62
  assert_equal "Dummy Title", tit2.to_s
63
63
  end
@@ -73,7 +73,7 @@ class TestID3v2Memory < Test::Unit::TestCase
73
73
  @tag.add_frame tcom
74
74
  # the following leads to an ObjectPreviouslyDeleted error (see Issue #8)
75
75
  assert_nothing_raised do
76
- @tag.frame_list.find{ |fr| 'TCOM' == fr.frame_id }
76
+ @tag.frame_list.find { |fr| 'TCOM' == fr.frame_id }
77
77
  end
78
78
  end
79
79
 
@@ -6,6 +6,7 @@ class TestID3v2Write < Test::Unit::TestCase
6
6
 
7
7
  SAMPLE_FILE = "test/data/sample.mp3"
8
8
  OUTPUT_FILE = "test/data/output.mp3"
9
+ PICTURE_FILE = "test/data/globe_east_540.jpg"
9
10
 
10
11
  context "TagLib::MPEG::File" do
11
12
  setup do
@@ -37,7 +38,7 @@ class TestID3v2Write < Test::Unit::TestCase
37
38
  end
38
39
 
39
40
  should "be able to add a new frame to it and read it back" do
40
- picture_data = File.open("test/data/globe_east_540.jpg", 'rb'){ |f| f.read }
41
+ picture_data = File.open(PICTURE_FILE, 'rb') { |f| f.read }
41
42
 
42
43
  apic = TagLib::ID3v2::AttachedPictureFrame.new
43
44
  apic.mime_type = "image/jpeg"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taglib-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: x86-mingw32
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-18 00:00:00.000000000 Z
12
+ date: 2012-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &10846620 !ruby/object:Gem::Requirement
16
+ requirement: &13930840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *10846620
24
+ version_requirements: *13930840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake-compiler
27
- requirement: &10845940 !ruby/object:Gem::Requirement
27
+ requirement: &13930200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.8'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *10845940
35
+ version_requirements: *13930200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda-context
38
- requirement: &10844840 !ruby/object:Gem::Requirement
38
+ requirement: &13929340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *10844840
46
+ version_requirements: *13929340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &10844340 !ruby/object:Gem::Requirement
49
+ requirement: &13928020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,8 +54,10 @@ dependencies:
54
54
  version: '0.7'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *10844340
58
- description: ! 'Ruby interface for the taglib C++ library.
57
+ version_requirements: *13928020
58
+ description: ! 'Ruby interface for the taglib C++ library, for reading and writing
59
+
60
+ meta-data (tags) of many audio formats.
59
61
 
60
62
 
61
63
  In contrast to other libraries, this one wraps the C++ API using SWIG,
@@ -81,6 +83,7 @@ files:
81
83
  - Rakefile
82
84
  - docs/default/fulldoc/html/css/common.css
83
85
  - docs/taglib/base.rb
86
+ - docs/taglib/flac.rb
84
87
  - docs/taglib/id3v1.rb
85
88
  - docs/taglib/id3v2.rb
86
89
  - docs/taglib/mpeg.rb
@@ -91,6 +94,8 @@ files:
91
94
  - ext/taglib_base/includes.i
92
95
  - ext/taglib_base/taglib_base.i
93
96
  - ext/taglib_base/taglib_base_wrap.cxx
97
+ - ext/taglib_flac/taglib_flac.i
98
+ - ext/taglib_flac/taglib_flac_wrap.cxx
94
99
  - ext/taglib_id3v1/extconf.rb
95
100
  - ext/taglib_id3v1/taglib_id3v1.i
96
101
  - ext/taglib_id3v1/taglib_id3v1_wrap.cxx
@@ -111,6 +116,7 @@ files:
111
116
  - ext/win.cmake
112
117
  - lib/taglib.rb
113
118
  - lib/taglib/base.rb
119
+ - lib/taglib/flac.rb
114
120
  - lib/taglib/id3v1.rb
115
121
  - lib/taglib/id3v2.rb
116
122
  - lib/taglib/mpeg.rb
@@ -125,7 +131,10 @@ files:
125
131
  - test/data/Makefile
126
132
  - test/data/add-relative-volume.cpp
127
133
  - test/data/crash.mp3
134
+ - test/data/flac-create.cpp
135
+ - test/data/flac.flac
128
136
  - test/data/globe_east_540.jpg
137
+ - test/data/globe_east_90.jpg
129
138
  - test/data/id3v1-create.cpp
130
139
  - test/data/id3v1.mp3
131
140
  - test/data/relative-volume.mp3
@@ -137,6 +146,8 @@ files:
137
146
  - test/fileref_open_test.rb
138
147
  - test/fileref_properties_test.rb
139
148
  - test/fileref_write_test.rb
149
+ - test/flac_file_test.rb
150
+ - test/flac_file_write_test.rb
140
151
  - test/id3v1_tag_test.rb
141
152
  - test/id3v2_frames_test.rb
142
153
  - test/id3v2_memory_test.rb
@@ -155,6 +166,7 @@ files:
155
166
  - lib/taglib_id3v2.so
156
167
  - lib/taglib_ogg.so
157
168
  - lib/taglib_vorbis.so
169
+ - lib/taglib_flac.so
158
170
  - lib/libtag.dll
159
171
  homepage: http://robinst.github.com/taglib-ruby/
160
172
  licenses:
@@ -171,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
183
  version: '0'
172
184
  segments:
173
185
  - 0
174
- hash: 3464591332541404866
186
+ hash: -3527393592601875683
175
187
  required_rubygems_version: !ruby/object:Gem::Requirement
176
188
  none: false
177
189
  requirements:
@@ -180,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
192
  version: '0'
181
193
  segments:
182
194
  - 0
183
- hash: 3464591332541404866
195
+ hash: -3527393592601875683
184
196
  requirements:
185
197
  - taglib (libtag1-dev in Debian/Ubuntu, taglib-devel in Fedora/RHEL)
186
198
  rubyforge_project: