taglib-ruby 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +33 -0
- data/.yardopts +1 -1
- data/{CHANGES.md → CHANGELOG.md} +35 -14
- data/Gemfile +2 -0
- data/Guardfile +4 -2
- data/README.md +56 -38
- data/Rakefile +8 -8
- data/docs/taglib/aiff.rb +0 -3
- data/docs/taglib/base.rb +0 -4
- data/docs/taglib/flac.rb +1 -3
- data/docs/taglib/id3v2.rb +1 -1
- data/docs/taglib/mp4.rb +2 -4
- data/docs/taglib/mpeg.rb +0 -1
- data/docs/taglib/ogg.rb +0 -4
- data/docs/taglib/vorbis.rb +0 -1
- data/docs/taglib/wav.rb +0 -4
- data/ext/extconf_common.rb +24 -28
- data/ext/taglib_aiff/extconf.rb +2 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +217 -178
- data/ext/taglib_base/extconf.rb +2 -0
- data/ext/taglib_base/includes.i +25 -0
- data/ext/taglib_base/taglib_base.i +18 -0
- data/ext/taglib_base/taglib_base_wrap.cxx +233 -191
- data/ext/taglib_flac/extconf.rb +2 -0
- data/ext/taglib_flac/taglib_flac.i +7 -0
- data/ext/taglib_flac/taglib_flac_wrap.cxx +235 -189
- data/ext/taglib_flac_picture/extconf.rb +2 -0
- data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +210 -168
- data/ext/taglib_id3v1/extconf.rb +2 -0
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +223 -182
- data/ext/taglib_id3v2/extconf.rb +2 -0
- data/ext/taglib_id3v2/taglib_id3v2.i +17 -0
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +2922 -993
- data/ext/taglib_mp4/extconf.rb +2 -0
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +295 -260
- data/ext/taglib_mpeg/extconf.rb +2 -0
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +243 -206
- data/ext/taglib_ogg/extconf.rb +2 -0
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +214 -171
- data/ext/taglib_vorbis/extconf.rb +2 -0
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +217 -178
- data/ext/taglib_wav/extconf.rb +2 -0
- data/ext/taglib_wav/taglib_wav_wrap.cxx +217 -178
- data/lib/taglib/aiff.rb +2 -0
- data/lib/taglib/base.rb +3 -1
- data/lib/taglib/flac.rb +2 -0
- data/lib/taglib/id3v1.rb +2 -0
- data/lib/taglib/id3v2.rb +2 -0
- data/lib/taglib/mp4.rb +10 -13
- data/lib/taglib/mpeg.rb +2 -0
- data/lib/taglib/ogg.rb +2 -0
- data/lib/taglib/version.rb +4 -2
- data/lib/taglib/vorbis.rb +2 -0
- data/lib/taglib/wav.rb +2 -1
- data/lib/taglib.rb +4 -3
- data/taglib-ruby.gemspec +165 -162
- data/tasks/docs_coverage.rake +10 -8
- data/tasks/ext.rake +26 -25
- data/tasks/gemspec_check.rake +7 -5
- data/tasks/swig.rake +10 -11
- data/test/aiff_examples_test.rb +8 -13
- data/test/aiff_file_test.rb +29 -29
- data/test/aiff_file_write_test.rb +19 -20
- data/test/base_test.rb +4 -2
- data/test/data/add-relative-volume.cpp +7 -3
- data/test/data/flac-create.cpp +15 -5
- data/test/data/flac_nopic.flac +0 -0
- data/test/data/get_picture_data.cpp +5 -1
- data/test/data/id3v1-create.cpp +6 -3
- data/test/data/mp4-create.cpp +12 -4
- data/test/data/vorbis-create.cpp +12 -5
- data/test/data/wav-create.cpp +18 -3
- data/test/file_test.rb +7 -5
- data/test/fileref_open_test.rb +12 -10
- data/test/fileref_properties_test.rb +6 -4
- data/test/fileref_write_test.rb +14 -13
- data/test/flac_file_test.rb +32 -27
- data/test/flac_file_write_test.rb +17 -18
- data/test/flac_picture_memory_test.rb +39 -0
- data/test/helper.rb +3 -1
- data/test/id3v1_genres_test.rb +14 -12
- data/test/id3v1_tag_test.rb +7 -5
- data/test/id3v2_frames_test.rb +98 -34
- data/test/id3v2_header_test.rb +14 -13
- data/test/id3v2_memory_test.rb +21 -20
- data/test/id3v2_relative_volume_test.rb +11 -9
- data/test/id3v2_tag_test.rb +16 -14
- data/test/id3v2_unicode_test.rb +12 -10
- data/test/id3v2_unknown_frames_test.rb +7 -5
- data/test/id3v2_write_test.rb +28 -29
- data/test/mp4_file_test.rb +27 -26
- data/test/mp4_file_write_test.rb +12 -13
- data/test/mp4_items_test.rb +78 -79
- data/test/mpeg_file_test.rb +32 -30
- data/test/tag_test.rb +5 -3
- data/test/unicode_filename_test.rb +7 -7
- data/test/vorbis_file_test.rb +14 -12
- data/test/vorbis_tag_test.rb +46 -44
- data/test/wav_examples_test.rb +8 -16
- data/test/wav_file_test.rb +29 -29
- data/test/wav_file_write_test.rb +22 -23
- metadata +26 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27ceb3e9e4f39e64380f0bd89502163c06ce84211dfbb785b4d0dcdbd7ddb01c
|
4
|
+
data.tar.gz: 12d89c910e7afca9f951b7bacf9c594b0df3af24dca18ff634572ee6df96da52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a565602c352304bf9d3c87440f20f560404bf08229ae0e072de3c6b3903374b974460be0fa378500ba6e5180ee59869c689aa6139227919aa9802c9fd741290
|
7
|
+
data.tar.gz: c1ac7d13cf9e9f033c618c7bae20d0c0d4042cd74f0e2cec3442e67310290a4bb5c3dbcbf41baf5550c839f256e2a9b9974d0ec400074249bf18946767bbbbb4
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: disable
|
3
|
+
Include:
|
4
|
+
- '**/*.rb'
|
5
|
+
- '**/*.arb'
|
6
|
+
- '**/*.gemfile'
|
7
|
+
- '**/*.gemspec'
|
8
|
+
- '**/*.rake'
|
9
|
+
- '**/.simplecov'
|
10
|
+
- '**/Gemfile'
|
11
|
+
- '**/Guardfile'
|
12
|
+
- '**/Rakefile'
|
13
|
+
Exclude:
|
14
|
+
- 'docs/**/*'
|
15
|
+
- 'tmp/**/*'
|
16
|
+
|
17
|
+
Metrics/ClassLength:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Metrics/BlockLength:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Layout/LineLength:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Style/EmptyMethod:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/NumericLiterals:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Style/ClassAndModuleChildren:
|
33
|
+
Enabled: false
|
data/.yardopts
CHANGED
data/{CHANGES.md → CHANGELOG.md}
RENAMED
@@ -1,18 +1,39 @@
|
|
1
1
|
Changes in Releases of taglib-ruby
|
2
2
|
==================================
|
3
3
|
|
4
|
-
|
4
|
+
All notable changes to this project will be documented in this file.
|
5
|
+
|
6
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
7
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
8
|
+
|
9
|
+
## 1.1.1 - 2022-04-12
|
10
|
+
### Changed
|
11
|
+
- Fixed build time warnings with Ruby >= 2.7.0 (#85)
|
12
|
+
- Upgraded to SWIG 4.0.2
|
13
|
+
- Fixed running tests against TagLib 1.12
|
14
|
+
|
15
|
+
## 1.1.0 - 2021-01-20
|
16
|
+
### Added
|
17
|
+
- Added support for CTOC and CHAP frames for ID3v2
|
18
|
+
|
19
|
+
## 1.0.1 - 2020-03-25
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
- Fix segmentation fault with TagLib::FLAC picture lists (#91), thanks
|
23
|
+
@jameswyper!
|
24
|
+
|
25
|
+
## 1.0.0 - 2020-01-07
|
5
26
|
|
6
27
|
* Support for TagLib >= 1.11.1 (drop support for earlier versions) (#83)
|
7
28
|
* This includes a lot of new APIs and some changed APIs, see
|
8
29
|
`@since 1.0.0` in the docs
|
9
30
|
* Stop using tainted strings to fix warnings with Ruby 2.7 (#86)
|
10
31
|
|
11
|
-
## 0.7.1
|
32
|
+
## 0.7.1 - 2015-12-28
|
12
33
|
|
13
34
|
* Fix compile error during gem installation on Ruby 2.3 (MRI) (#67)
|
14
35
|
|
15
|
-
## 0.7.0
|
36
|
+
## 0.7.0 - 2014-08-21
|
16
37
|
|
17
38
|
* Add support for TagLib::RIFF::AIFF (#52, by @tchev)
|
18
39
|
* Add support for TagLib::RIFF::WAV (#57, by @tchev)
|
@@ -21,7 +42,7 @@ Changes in Releases of taglib-ruby
|
|
21
42
|
* Try to detect location of vendor/taglib on Heroku (#28)
|
22
43
|
* Documentation updates
|
23
44
|
|
24
|
-
## 0.6.0
|
45
|
+
## 0.6.0 - 2013-04-26
|
25
46
|
|
26
47
|
* Add support for TagLib::MP4 (#3, by @jacobvosmaer)
|
27
48
|
* Add support for TagLib::ID3v2::Header (#19, by @kaethorn)
|
@@ -32,24 +53,24 @@ Changes in Releases of taglib-ruby
|
|
32
53
|
* Fix segfault when passing a non-String to a String argument
|
33
54
|
* Documentation updates
|
34
55
|
|
35
|
-
## 0.5.2
|
56
|
+
## 0.5.2 - 2012-10-06
|
36
57
|
|
37
58
|
* Fix memory bug with TagLib::MPEG::File#tag and TagLib::FLAC::File#tag
|
38
59
|
which could cause crashes (#14)
|
39
60
|
* Update TagLib of binary gem for Windows to 1.8
|
40
61
|
|
41
|
-
## 0.5.1
|
62
|
+
## 0.5.1 - 2012-06-16
|
42
63
|
|
43
64
|
* Fix crashes (segfault) with nil arguments, e.g. with `tag.title = nil`
|
44
65
|
* Document TagLib::MPEG::File#save and TagLib::MPEG::File#strip (#11)
|
45
66
|
* Update TagLib of binary gem for Windows to 1.7.2
|
46
67
|
|
47
|
-
## 0.5.0
|
68
|
+
## 0.5.0 - 2012-04-15
|
48
69
|
|
49
70
|
* Add support for FLAC
|
50
71
|
* Fix problem in SWIG causing compilation error on MacRuby (#10)
|
51
72
|
|
52
|
-
## 0.4.0
|
73
|
+
## 0.4.0 - 2012-03-18
|
53
74
|
|
54
75
|
* Pre-compiled binary gem for Windows (Ruby 1.9) with TagLib 1.7.1
|
55
76
|
* Unicode filename support on Windows
|
@@ -63,35 +84,35 @@ title = TagLib::FileRef.open("file.mp3") do |file|
|
|
63
84
|
end
|
64
85
|
```
|
65
86
|
|
66
|
-
## 0.3.1
|
87
|
+
## 0.3.1 - 2012-01-22
|
67
88
|
|
68
89
|
* Fix ObjectPreviouslyDeleted exception after calling
|
69
90
|
TagLib::ID3v2::Tag#add_frame (#8)
|
70
91
|
* Make installation under MacPorts work out of the box (#7)
|
71
92
|
|
72
|
-
## 0.3.0
|
93
|
+
## 0.3.0 - 2012-01-02
|
73
94
|
|
74
95
|
* Add support for Ogg Vorbis
|
75
96
|
* Add support for ID3v1 (#2)
|
76
97
|
* Add #close to File classes for explicitly releasing resources
|
77
98
|
* Fix compilation on Windows
|
78
99
|
|
79
|
-
## 0.2.1
|
100
|
+
## 0.2.1 - 2011-11-05
|
80
101
|
|
81
102
|
* Fix compilation error due to missing typedef on some systems (#5)
|
82
103
|
|
83
|
-
## 0.2.0
|
104
|
+
## 0.2.0 - 2011-10-22
|
84
105
|
|
85
106
|
* API documentation
|
86
107
|
* Add support for:
|
87
108
|
* TagLib::AudioProperties and TagLib::MPEG::Properties (#4)
|
88
109
|
* TagLib::ID3v2::RelativeVolumeFrame
|
89
110
|
|
90
|
-
## 0.1.1
|
111
|
+
## 0.1.1 - 2011-09-17
|
91
112
|
|
92
113
|
* Add installation instructions and clean up description
|
93
114
|
|
94
|
-
## 0.1.0
|
115
|
+
## 0.1.0 - 2011-09-17
|
95
116
|
|
96
117
|
* Initial release
|
97
118
|
* Coverage of the following API:
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen-string-literal: true
|
2
|
+
|
1
3
|
# Guardfile for tests
|
2
4
|
# More info at https://github.com/guard/guard#readme
|
3
5
|
|
4
6
|
guard :test do
|
5
|
-
watch(%r{^lib/(.+)\.so$}) {
|
6
|
-
watch('test/test_helper.rb') {
|
7
|
+
watch(%r{^lib/(.+)\.so$}) { 'test' }
|
8
|
+
watch('test/test_helper.rb') { 'test' }
|
7
9
|
watch(%r{^test/.+_test\.rb$})
|
8
10
|
end
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
taglib-ruby
|
2
|
-
===========
|
1
|
+
# taglib-ruby
|
3
2
|
|
4
3
|
Ruby interface for the [TagLib C++ library][taglib], for reading and
|
5
4
|
writing meta-data (tags) of many audio formats.
|
@@ -8,7 +7,7 @@ In contrast to other libraries, this one wraps the full C++ API, not
|
|
8
7
|
only the minimal C API. This means that all tag data can be accessed,
|
9
8
|
e.g. cover art of ID3v2 or custom fields of Ogg Vorbis comments.
|
10
9
|
|
11
|
-
taglib-ruby currently supports the following:
|
10
|
+
`taglib-ruby` currently supports the following:
|
12
11
|
|
13
12
|
* Reading/writing common tag data of all formats that TagLib supports
|
14
13
|
* Reading/writing ID3v1 and ID3v2 including ID3v2.4 and Unicode
|
@@ -19,13 +18,12 @@ taglib-ruby currently supports the following:
|
|
19
18
|
Contributions for more coverage of the library are very welcome.
|
20
19
|
|
21
20
|
[![Gem version][gem-img]][gem-link]
|
22
|
-
[](https://github.com/robinst/taglib-ruby/actions?query=workflow%3Aci)
|
23
22
|
|
24
|
-
Installation
|
25
|
-
------------
|
23
|
+
## Installation
|
26
24
|
|
27
|
-
Before you install the gem, make sure to have [taglib 1.11.1 or higher][taglib]
|
28
|
-
with header files (and a C++ compiler of course):
|
25
|
+
Before you install the gem, make sure to have [taglib 1.11.1 or higher][taglib]
|
26
|
+
installed with header files (and a C++ compiler of course):
|
29
27
|
|
30
28
|
* Debian/Ubuntu: `sudo apt-get install libtag1-dev`
|
31
29
|
* Fedora/RHEL: `sudo dnf install taglib-devel`
|
@@ -36,29 +34,41 @@ Then do:
|
|
36
34
|
|
37
35
|
gem install taglib-ruby
|
38
36
|
|
39
|
-
###
|
37
|
+
### MacOS
|
40
38
|
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
Depending on your brew setup, TagLib might be installed in different locations,
|
40
|
+
which makes it hard for taglib-ruby to find it. To get the library location, run:
|
41
|
+
|
42
|
+
$ brew info taglib
|
43
|
+
taglib: stable 1.12 (bottled), HEAD
|
44
|
+
Audio metadata library
|
45
|
+
https://taglib.org/
|
46
|
+
/usr/local/Cellar/taglib/1.12 (122 files, 1.5MB) *
|
47
|
+
...
|
48
|
+
|
49
|
+
Note the line with the path at the end. Provide that using the `TAGLIB_DIR`
|
50
|
+
environment variable when installing, like this:
|
51
|
+
|
52
|
+
TAGLIB_DIR=/usr/local/Cellar/taglib/1.12 gem install taglib-ruby
|
53
|
+
|
54
|
+
Another problem might be that `clang++` doesn't work with a specific version
|
55
|
+
of TagLib. In that case, try compiling taglib-ruby's C++ extensions with a
|
56
|
+
different compiler:
|
44
57
|
|
45
58
|
TAGLIB_RUBY_CXX=g++-4.2 gem install taglib-ruby
|
46
59
|
|
47
|
-
Usage
|
48
|
-
-----
|
60
|
+
## Usage
|
49
61
|
|
50
62
|
Complete API documentation can be found on
|
51
63
|
[rubydoc.info](http://rubydoc.info/gems/taglib-ruby/frames).
|
52
64
|
|
53
|
-
Begin with the
|
65
|
+
Begin with the `TagLib` namespace.
|
54
66
|
|
55
|
-
Release Notes
|
56
|
-
-------------
|
67
|
+
## Release Notes
|
57
68
|
|
58
|
-
See
|
69
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
59
70
|
|
60
|
-
Contributing
|
61
|
-
------------
|
71
|
+
## Contributing
|
62
72
|
|
63
73
|
### Dependencies
|
64
74
|
|
@@ -73,7 +83,8 @@ if you don't have it):
|
|
73
83
|
|
74
84
|
bundle install
|
75
85
|
|
76
|
-
Regenerate SWIG wrappers if you made changes in `.i` files (use version 3.0.7 of
|
86
|
+
Regenerate SWIG wrappers if you made changes in `.i` files (use version 3.0.7 of
|
87
|
+
SWIG - 3.0.8 through 3.0.12 will not work):
|
77
88
|
|
78
89
|
rake swig
|
79
90
|
|
@@ -102,11 +113,17 @@ Build a specific version of Taglib:
|
|
102
113
|
|
103
114
|
PLATFORM=x86_64-linux TAGLIB_VERSION=1.11.1 rake vendor
|
104
115
|
|
105
|
-
The above command will automatically download Taglib 1.11.1, build it and
|
116
|
+
The above command will automatically download Taglib 1.11.1, build it and
|
117
|
+
install it in `tmp/x86_64-linux/taglib-1.11.1`.
|
106
118
|
|
107
|
-
The `swig` and `compile` tasks can then be executed against that specific
|
119
|
+
The `swig` and `compile` tasks can then be executed against that specific
|
120
|
+
version of Taglib by setting the `TAGLIB_DIR` environment variable to
|
121
|
+
`$PWD/tmp/x86_64-linux/taglib-1.11.1` (it is assumed that taglib headers are
|
122
|
+
located at `$TAGLIB_DIR/include` and taglib libraries at `$TAGLIB_DIR/lib`).
|
108
123
|
|
109
|
-
The `test` task can then be run for that version of Taglib by adding
|
124
|
+
The `test` task can then be run for that version of Taglib by adding
|
125
|
+
`$PWD/tmp/x86_64-linux/taglib-1.11.1/lib` to the `LD_LIBRARY_PATH` environment
|
126
|
+
variable.
|
110
127
|
|
111
128
|
To do everything in one command:
|
112
129
|
|
@@ -114,27 +131,30 @@ To do everything in one command:
|
|
114
131
|
|
115
132
|
### Workflow
|
116
133
|
|
117
|
-
* Check out the latest
|
118
|
-
implemented or the bug hasn't been fixed yet
|
119
|
-
* Check out the issue tracker to make sure someone
|
120
|
-
requested it and/or contributed it
|
121
|
-
* Fork the project
|
122
|
-
* Start a feature/bugfix branch
|
123
|
-
* Commit and push until you are happy with your contribution
|
124
|
-
* Make sure to add tests for it. This is important so I don't break it
|
134
|
+
* Check out the latest `main` branch to make sure the feature hasn't been
|
135
|
+
implemented or the bug hasn't been fixed yet.
|
136
|
+
* Check out the issue tracker to make sure someone hasn't already
|
137
|
+
requested it and/or contributed it.
|
138
|
+
* Fork the project.
|
139
|
+
* Start a feature/bugfix branch from `main`.
|
140
|
+
* Commit and push until you are happy with your contribution.
|
141
|
+
* Make sure to add tests for it. This is important so that I don't break it
|
125
142
|
in a future version unintentionally.
|
143
|
+
* Run `rubocop` locally to lint your changes and fix the issues. Please refer to
|
144
|
+
[.rubocop.yml](.rubocop.yml) for the list of relaxed rules. Try to keep the
|
145
|
+
liniting offenses to minimum. Preferably, first run `rubocop` on your fork to
|
146
|
+
have a general idea of the existing linting offenses before writing new code.
|
126
147
|
* Please try not to mess with the Rakefile, version, or history. If you
|
127
148
|
want to have your own version, or is otherwise necessary, that is
|
128
149
|
fine, but please isolate to its own commit so I can cherry-pick around
|
129
150
|
it.
|
130
151
|
|
131
|
-
License
|
132
|
-
-------
|
152
|
+
## License
|
133
153
|
|
134
154
|
Copyright (c) 2010-2020 Robin Stocker and others, see Git history.
|
135
155
|
|
136
|
-
taglib-ruby is distributed under the MIT License,
|
137
|
-
|
156
|
+
`taglib-ruby` is distributed under the MIT License, see
|
157
|
+
[LICENSE.txt](LICENSE.txt) for details.
|
138
158
|
|
139
159
|
In the binary gem for Windows, a compiled [TagLib][taglib] is bundled as
|
140
160
|
a DLL. TagLib is distributed under the GNU Lesser General Public License
|
@@ -143,5 +163,3 @@ version 2.1 (LGPL) and Mozilla Public License (MPL).
|
|
143
163
|
[taglib]: http://taglib.github.io/
|
144
164
|
[gem-img]: https://badge.fury.io/rb/taglib-ruby.svg
|
145
165
|
[gem-link]: https://rubygems.org/gems/taglib-ruby
|
146
|
-
[travis-img]: https://api.travis-ci.org/robinst/taglib-ruby.png
|
147
|
-
[travis-link]: https://travis-ci.org/robinst/taglib-ruby
|
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# frozen-string-literal: true
|
2
2
|
|
3
3
|
require 'bundler/gem_tasks'
|
4
4
|
begin
|
5
5
|
Bundler.setup(:default, :development)
|
6
6
|
rescue Bundler::BundlerError => e
|
7
|
-
|
8
|
-
|
7
|
+
warn e.message
|
8
|
+
warn 'Run `bundle install` to install missing gems'
|
9
9
|
exit e.status_code
|
10
10
|
end
|
11
11
|
|
@@ -15,7 +15,7 @@ Rake::TestTask.new(:test) do |test|
|
|
15
15
|
test.pattern = 'test/**/*_test.rb'
|
16
16
|
end
|
17
17
|
|
18
|
-
task :
|
18
|
+
task default: %i[compile test]
|
19
19
|
|
20
20
|
require 'yard'
|
21
21
|
YARD::Rake::YardocTask.new do |t|
|
@@ -30,9 +30,9 @@ import 'tasks/ext.rake'
|
|
30
30
|
import 'tasks/gemspec_check.rake'
|
31
31
|
|
32
32
|
# When importing swig.rake, the *_wrap.cxx files depend on being generated
|
33
|
-
#
|
33
|
+
# by Swig. Since the ExtensionTasks depend on the *_wrap.cxx files,
|
34
34
|
# compiling the extensions will trigger Swig, which is not desired as
|
35
35
|
# those files have already been generated and there's no reason to make
|
36
|
-
# Swig a variable of the CI.
|
37
|
-
#
|
38
|
-
import 'tasks/swig.rake' unless ENV['
|
36
|
+
# Swig a variable of the CI. The environment variable can be set to
|
37
|
+
# prevent running swig.
|
38
|
+
import 'tasks/swig.rake' unless ENV['SKIP_SWIG'] == 'true'
|
data/docs/taglib/aiff.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# @since 0.7.0
|
2
2
|
module TagLib::RIFF::AIFF
|
3
|
-
|
4
3
|
# The file class for `.aiff` files.
|
5
4
|
#
|
6
5
|
# @example Reading the title
|
@@ -58,7 +57,6 @@ module TagLib::RIFF::AIFF
|
|
58
57
|
# @since 1.0.0
|
59
58
|
def id3v2_tag?
|
60
59
|
end
|
61
|
-
|
62
60
|
end
|
63
61
|
|
64
62
|
class Properties < TagLib::AudioProperties
|
@@ -91,5 +89,4 @@ module TagLib::RIFF::AIFF
|
|
91
89
|
def aiff_c?
|
92
90
|
end
|
93
91
|
end
|
94
|
-
|
95
92
|
end
|
data/docs/taglib/base.rb
CHANGED
@@ -45,7 +45,6 @@
|
|
45
45
|
# tag.title
|
46
46
|
# # => "Title of the song"
|
47
47
|
module TagLib
|
48
|
-
|
49
48
|
# Major version of TagLib the extensions were compiled against
|
50
49
|
# (major.minor.patch). Note that the value is not actually 0, but
|
51
50
|
# depends on the version of the installed library.
|
@@ -88,7 +87,6 @@ module TagLib
|
|
88
87
|
# end
|
89
88
|
#
|
90
89
|
class FileRef
|
91
|
-
|
92
90
|
# Creates a new file and passes it to the provided block,
|
93
91
|
# closing the file automatically at the end of the block.
|
94
92
|
#
|
@@ -165,7 +163,6 @@ module TagLib
|
|
165
163
|
|
166
164
|
# @abstract Base class for files, see subclasses.
|
167
165
|
class File
|
168
|
-
|
169
166
|
# Save the file and the associated tags.
|
170
167
|
#
|
171
168
|
# See subclasses, as some provide more control over what is saved.
|
@@ -241,7 +238,6 @@ module TagLib
|
|
241
238
|
|
242
239
|
# @abstract Base class for audio properties.
|
243
240
|
class AudioProperties
|
244
|
-
|
245
241
|
Fast = 0
|
246
242
|
Average = 1
|
247
243
|
Accurate = 2
|
data/docs/taglib/flac.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# @since 0.5.0
|
2
2
|
module TagLib::FLAC
|
3
|
-
|
4
3
|
# The file class for `.flac` files.
|
5
4
|
#
|
6
5
|
# Note that Xiph comments is the primary tagging format for FLAC files. When
|
@@ -30,7 +29,6 @@ module TagLib::FLAC
|
|
30
29
|
# file.save
|
31
30
|
# end
|
32
31
|
class File < TagLib::File
|
33
|
-
|
34
32
|
NoTags = 0x0000
|
35
33
|
XiphComment = 0x0001
|
36
34
|
ID3v1 = 0x0002
|
@@ -183,7 +181,7 @@ module TagLib::FLAC
|
|
183
181
|
BandLogo = 0x13
|
184
182
|
PublisherLogo = 0x14
|
185
183
|
|
186
|
-
def initialize
|
184
|
+
def initialize
|
187
185
|
end
|
188
186
|
|
189
187
|
# Type of the picture, see constants.
|
data/docs/taglib/id3v2.rb
CHANGED
data/docs/taglib/mp4.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module TagLib::MP4
|
2
|
-
|
3
2
|
# The file class for '.m4a' files.
|
4
3
|
#
|
5
4
|
# @example Finding an MP4 item by field name
|
@@ -53,7 +52,6 @@ module TagLib::MP4
|
|
53
52
|
# # ["©too",
|
54
53
|
# # #<TagLib::MP4::Item:0x007f9bab61d818 @__swigtype__="_p_TagLib__MP4__Item">]]
|
55
54
|
class File < TagLib::File
|
56
|
-
|
57
55
|
# {include:::TagLib::FileRef.open}
|
58
56
|
#
|
59
57
|
# @param (see #initialize)
|
@@ -331,7 +329,7 @@ module TagLib::MP4
|
|
331
329
|
def to_h
|
332
330
|
end
|
333
331
|
end
|
334
|
-
|
332
|
+
|
335
333
|
class Properties < TagLib::AudioProperties
|
336
334
|
Unknown = 0
|
337
335
|
AAC = 1
|
@@ -367,7 +365,7 @@ module TagLib::MP4
|
|
367
365
|
|
368
366
|
# Returns the raw image data
|
369
367
|
# @return [String]
|
370
|
-
|
368
|
+
attr_reader :data
|
371
369
|
|
372
370
|
# @param [Fixnum] format
|
373
371
|
# @param [String] data
|
data/docs/taglib/mpeg.rb
CHANGED
data/docs/taglib/ogg.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module TagLib::Ogg
|
2
|
-
|
3
2
|
# @abstract Base class for Ogg files, see subclasses.
|
4
3
|
class File < TagLib::File
|
5
4
|
end
|
@@ -11,7 +10,6 @@ module TagLib::Ogg
|
|
11
10
|
# name and a value. Multiple fields with the same name are allowed, so
|
12
11
|
# you can also view it as a map from names to a list of values.
|
13
12
|
class XiphComment < TagLib::Tag
|
14
|
-
|
15
13
|
# Add a name-value pair to the comment.
|
16
14
|
#
|
17
15
|
# @param [String] name field name
|
@@ -113,7 +111,5 @@ module TagLib::Ogg
|
|
113
111
|
|
114
112
|
# @return [String] vendor ID of the encoder used
|
115
113
|
attr_reader :vendor_id
|
116
|
-
|
117
114
|
end
|
118
|
-
|
119
115
|
end
|
data/docs/taglib/vorbis.rb
CHANGED
data/docs/taglib/wav.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# @since 0.7.0
|
2
2
|
module TagLib::RIFF::WAV
|
3
|
-
|
4
3
|
FORMAT_UNKNOWN = 0x0000 # @since 1.0.0
|
5
4
|
FORMAT_PCM = 0x0001 # @since 1.0.0
|
6
5
|
|
@@ -27,7 +26,6 @@ module TagLib::RIFF::WAV
|
|
27
26
|
# @see ID3v2::Tag ID3v2 examples.
|
28
27
|
#
|
29
28
|
class File < TagLib::File
|
30
|
-
|
31
29
|
NoTags = 0x0000
|
32
30
|
ID3v1 = 0x0001
|
33
31
|
ID3v2 = 0x0002
|
@@ -79,7 +77,6 @@ module TagLib::RIFF::WAV
|
|
79
77
|
# @since 1.0.0
|
80
78
|
def strip(tags=TagLib::RIFF::WAV::File::AllTags)
|
81
79
|
end
|
82
|
-
|
83
80
|
end
|
84
81
|
|
85
82
|
class Properties < TagLib::AudioProperties
|
@@ -112,5 +109,4 @@ module TagLib::RIFF::WAV
|
|
112
109
|
# @since 1.0.0
|
113
110
|
attr_reader :format
|
114
111
|
end
|
115
|
-
|
116
112
|
end
|
data/ext/extconf_common.rb
CHANGED
@@ -1,54 +1,50 @@
|
|
1
|
-
#
|
1
|
+
# frozen-string-literal: true
|
2
2
|
|
3
|
-
|
3
|
+
# Default opt dirs to help mkmf find taglib
|
4
|
+
opt_dirs = ['/usr/local', '/opt/local', '/sw']
|
4
5
|
|
5
6
|
# Heroku vendor dir
|
6
|
-
vendor = ENV.fetch('GEM_HOME',
|
7
|
-
if vendor
|
8
|
-
|
9
|
-
end
|
10
|
-
opt_dirs_joined = opt_dirs.join(":")
|
7
|
+
vendor = ENV.fetch('GEM_HOME', '')[/^[^ ]*\/vendor\//]
|
8
|
+
opt_dirs << "#{vendor}taglib" if vendor
|
9
|
+
opt_dirs_joined = opt_dirs.join(':')
|
11
10
|
|
12
11
|
configure_args = "--with-opt-dir=#{opt_dirs_joined} "
|
13
|
-
ENV['CONFIGURE_ARGS'] = configure_args + ENV.fetch('CONFIGURE_ARGS',
|
14
|
-
|
12
|
+
ENV['CONFIGURE_ARGS'] = configure_args + ENV.fetch('CONFIGURE_ARGS', '')
|
15
13
|
|
16
14
|
require 'mkmf'
|
17
15
|
|
18
|
-
def error
|
19
|
-
message msg
|
16
|
+
def error(msg)
|
17
|
+
message "#{msg}\n"
|
20
18
|
abort
|
21
19
|
end
|
22
20
|
|
23
|
-
if ENV.
|
24
|
-
error
|
21
|
+
if ENV.key?('TAGLIB_DIR') && !File.directory?(ENV['TAGLIB_DIR'])
|
22
|
+
error 'When defined, the TAGLIB_DIR environment variable must point to a valid directory.'
|
25
23
|
end
|
26
24
|
|
27
25
|
# If specified, use the TAGLIB_DIR environment variable as the prefix
|
28
|
-
#
|
26
|
+
# for finding taglib headers and libs. See MakeMakefile#dir_config
|
29
27
|
# for more details.
|
30
|
-
dir_config('tag', (ENV['TAGLIB_DIR'] if ENV.
|
28
|
+
dir_config('tag', (ENV['TAGLIB_DIR'] if ENV.key?('TAGLIB_DIR')))
|
31
29
|
|
32
30
|
# When compiling statically, -lstdc++ would make the resulting .so to
|
33
31
|
# have a dependency on an external libstdc++ instead of the static one.
|
34
|
-
unless $LDFLAGS.split(
|
35
|
-
|
36
|
-
error "You must have libstdc++ installed."
|
37
|
-
end
|
32
|
+
unless $LDFLAGS.split(' ').include?('-static-libstdc++')
|
33
|
+
error 'You must have libstdc++ installed.' unless have_library('stdc++')
|
38
34
|
end
|
39
35
|
|
40
|
-
|
41
|
-
error
|
42
|
-
You must have taglib installed in order to use taglib-ruby.
|
36
|
+
unless have_library('tag')
|
37
|
+
error <<~DESC
|
38
|
+
You must have taglib installed in order to use taglib-ruby.
|
43
39
|
|
44
|
-
Debian/Ubuntu: sudo apt-get install libtag1-dev
|
45
|
-
Fedora/RHEL: sudo dnf install taglib-devel
|
46
|
-
Brew: brew install taglib
|
47
|
-
MacPorts: sudo port install taglib
|
48
|
-
DESC
|
40
|
+
Debian/Ubuntu: sudo apt-get install libtag1-dev
|
41
|
+
Fedora/RHEL: sudo dnf install taglib-devel
|
42
|
+
Brew: brew install taglib
|
43
|
+
MacPorts: sudo port install taglib
|
44
|
+
DESC
|
49
45
|
end
|
50
46
|
|
51
|
-
$CFLAGS <<
|
47
|
+
$CFLAGS << ' -DSWIG_TYPE_TABLE=taglib'
|
52
48
|
|
53
49
|
# Allow users to override the Ruby runtime's preferred CXX
|
54
50
|
RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['TAGLIB_RUBY_CXX'] if ENV['TAGLIB_RUBY_CXX']
|