taglib-ruby 1.0.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +33 -0
  3. data/.yardopts +1 -1
  4. data/CHANGELOG.md +15 -0
  5. data/Gemfile +2 -0
  6. data/Guardfile +4 -2
  7. data/README.md +56 -38
  8. data/Rakefile +8 -8
  9. data/docs/taglib/aiff.rb +0 -3
  10. data/docs/taglib/base.rb +0 -4
  11. data/docs/taglib/flac.rb +1 -3
  12. data/docs/taglib/id3v2.rb +1 -1
  13. data/docs/taglib/mp4.rb +2 -4
  14. data/docs/taglib/mpeg.rb +0 -1
  15. data/docs/taglib/ogg.rb +0 -4
  16. data/docs/taglib/vorbis.rb +0 -1
  17. data/docs/taglib/wav.rb +0 -4
  18. data/ext/extconf_common.rb +24 -28
  19. data/ext/taglib_aiff/extconf.rb +2 -0
  20. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +217 -178
  21. data/ext/taglib_base/extconf.rb +2 -0
  22. data/ext/taglib_base/includes.i +25 -0
  23. data/ext/taglib_base/taglib_base.i +21 -0
  24. data/ext/taglib_base/taglib_base_wrap.cxx +233 -191
  25. data/ext/taglib_flac/extconf.rb +2 -0
  26. data/ext/taglib_flac/taglib_flac_wrap.cxx +228 -189
  27. data/ext/taglib_flac_picture/extconf.rb +2 -0
  28. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +210 -168
  29. data/ext/taglib_id3v1/extconf.rb +2 -0
  30. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +223 -182
  31. data/ext/taglib_id3v2/extconf.rb +2 -0
  32. data/ext/taglib_id3v2/taglib_id3v2.i +17 -0
  33. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +2923 -999
  34. data/ext/taglib_mp4/extconf.rb +2 -0
  35. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +311 -281
  36. data/ext/taglib_mpeg/extconf.rb +2 -0
  37. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +243 -206
  38. data/ext/taglib_ogg/extconf.rb +2 -0
  39. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +214 -171
  40. data/ext/taglib_vorbis/extconf.rb +2 -0
  41. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +217 -178
  42. data/ext/taglib_wav/extconf.rb +2 -0
  43. data/ext/taglib_wav/taglib_wav_wrap.cxx +217 -178
  44. data/lib/taglib/aiff.rb +2 -0
  45. data/lib/taglib/base.rb +3 -1
  46. data/lib/taglib/flac.rb +2 -0
  47. data/lib/taglib/id3v1.rb +2 -0
  48. data/lib/taglib/id3v2.rb +2 -0
  49. data/lib/taglib/mp4.rb +10 -13
  50. data/lib/taglib/mpeg.rb +2 -0
  51. data/lib/taglib/ogg.rb +2 -0
  52. data/lib/taglib/version.rb +4 -2
  53. data/lib/taglib/vorbis.rb +2 -0
  54. data/lib/taglib/wav.rb +2 -1
  55. data/lib/taglib.rb +4 -3
  56. data/taglib-ruby.gemspec +165 -162
  57. data/tasks/docs_coverage.rake +10 -8
  58. data/tasks/ext.rake +26 -25
  59. data/tasks/gemspec_check.rake +7 -5
  60. data/tasks/swig.rake +10 -11
  61. data/test/aiff_examples_test.rb +8 -13
  62. data/test/aiff_file_test.rb +29 -29
  63. data/test/aiff_file_write_test.rb +19 -20
  64. data/test/base_test.rb +4 -2
  65. data/test/data/add-relative-volume.cpp +7 -3
  66. data/test/data/flac-create.cpp +15 -5
  67. data/test/data/flac_nopic.flac +0 -0
  68. data/test/data/get_picture_data.cpp +5 -1
  69. data/test/data/id3v1-create.cpp +6 -3
  70. data/test/data/mp4-create.cpp +12 -4
  71. data/test/data/vorbis-create.cpp +12 -5
  72. data/test/data/wav-create.cpp +18 -3
  73. data/test/file_test.rb +7 -5
  74. data/test/fileref_open_test.rb +12 -10
  75. data/test/fileref_properties_test.rb +6 -4
  76. data/test/fileref_write_test.rb +14 -13
  77. data/test/flac_file_test.rb +32 -27
  78. data/test/flac_file_write_test.rb +17 -18
  79. data/test/flac_picture_memory_test.rb +39 -0
  80. data/test/helper.rb +3 -1
  81. data/test/id3v1_genres_test.rb +14 -12
  82. data/test/id3v1_tag_test.rb +7 -5
  83. data/test/id3v2_frames_test.rb +103 -34
  84. data/test/id3v2_header_test.rb +14 -13
  85. data/test/id3v2_memory_test.rb +21 -20
  86. data/test/id3v2_relative_volume_test.rb +11 -9
  87. data/test/id3v2_tag_test.rb +16 -14
  88. data/test/id3v2_unicode_test.rb +12 -10
  89. data/test/id3v2_unknown_frames_test.rb +7 -5
  90. data/test/id3v2_write_test.rb +28 -29
  91. data/test/mp4_file_test.rb +27 -26
  92. data/test/mp4_file_write_test.rb +12 -13
  93. data/test/mp4_items_test.rb +78 -79
  94. data/test/mpeg_file_test.rb +32 -30
  95. data/test/tag_test.rb +5 -3
  96. data/test/unicode_filename_test.rb +7 -7
  97. data/test/vorbis_file_test.rb +14 -12
  98. data/test/vorbis_tag_test.rb +46 -44
  99. data/test/wav_examples_test.rb +8 -16
  100. data/test/wav_file_test.rb +29 -29
  101. data/test/wav_file_write_test.rb +22 -23
  102. metadata +24 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecceaec5949a978d7197944553e81b279f29eac9b3cb896285d31feaf8eb62c1
4
- data.tar.gz: cd7c8acdfb435435b20af23c82490987b94f44ef45366902d0c2fd55f45c4f3d
3
+ metadata.gz: 1289419ad11f81f79052e260fbb9e1debbf2cd956389797bb6b664356e287ec0
4
+ data.tar.gz: '0582a88e09b6e96108a2e4a51a34e5c486f0552918780f38b1c4f05a448745d3'
5
5
  SHA512:
6
- metadata.gz: 288cbdd0cba616f093e9a6332f85f61d6ae17b1026694d32813105a8c22c1b70c26fa224f669fb2bdab965212608e68e210474b2e8b9fab19aab82420f6e9a94
7
- data.tar.gz: 927524f682dcda566219cb60895043d2c07c308122f162fbb6d140549e179ebaed08a3aa011f606f0a17bfa62ba4b4dcb47491de0efe3d3a4ab6122982c9d413
6
+ metadata.gz: 966e6e0fed73bb68ed20a6f4e9cab07b98f476220e5a294d77f679ea748ddb245e5221241845c7ad515337d1d3f673ebce6cb293cc97ca5e773a385e7e7110e3
7
+ data.tar.gz: 35ac3a6342f59be0c6641b861a0c9c9f2b00a2914d12fa8bc4bc05b5ba3af5c2f0199d8b3eb67155146b142274597ab8456ed1df48a72b30bbf90a1ebe86caf5
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
@@ -5,5 +5,5 @@
5
5
  docs/**/*.rb
6
6
  -
7
7
  README.md
8
- CHANGES.md
8
+ CHANGELOG.md
9
9
  LICENSE.txt
data/CHANGELOG.md CHANGED
@@ -6,6 +6,21 @@ All notable changes to this project will be documented in this file.
6
6
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
7
7
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## 1.1.2 - 2022-04-13
10
+ ### Fixed
11
+ - Fix UserTextIdentificationFrame's constructor so that overloaded
12
+ variants with StringList arguments can be called (#107)
13
+
14
+ ## 1.1.1 - 2022-04-12
15
+ ### Changed
16
+ - Fixed build time warnings with Ruby >= 2.7.0 (#85)
17
+ - Upgraded to SWIG 4.0.2
18
+ - Fixed running tests against TagLib 1.12
19
+
20
+ ## 1.1.0 - 2021-01-20
21
+ ### Added
22
+ - Added support for CTOC and CHAP frames for ID3v2
23
+
9
24
  ## 1.0.1 - 2020-03-25
10
25
 
11
26
  ### Fixed
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  # Use dependencies from .gemspec
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$}) { "test" }
6
- watch('test/test_helper.rb') { "test" }
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
- [![Build status][travis-img]][travis-link]
21
+ [![ci](https://github.com/robinst/taglib-ruby/workflows/ci/badge.svg)](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] installed
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
- ### OS X C++ compiler override
37
+ ### MacOS
40
38
 
41
- Not all versions of TagLib get along with `clang++`, the default C++ compiler
42
- on OS X. To compile taglib-ruby's C++ extensions with a different compiler
43
- during installation, set the `TAGLIB_RUBY_CXX` environment variable.
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 {TagLib} namespace.
65
+ Begin with the `TagLib` namespace.
54
66
 
55
- Release Notes
56
- -------------
67
+ ## Release Notes
57
68
 
58
- See {file:CHANGELOG.md}.
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 SWIG - 3.0.8 through 3.0.12 will not work):
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 install it in `tmp/x86_64-linux/taglib-1.11.1`.
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 version of Taglib by setting the `TAGLIB_DIR` environment variable to `$PWD/tmp/x86_64-linux/taglib-1.11.1` (it is assumed that taglib headers are located at `$TAGLIB_DIR/include` and taglib libraries at `$TAGLIB_DIR/lib`).
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 `$PWD/tmp/x86_64-linux/taglib-1.11.1/lib` to the `LD_LIBRARY_PATH` environment variable.
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 master to make sure the feature hasn't been
118
- implemented or the bug hasn't been fixed yet
119
- * Check out the issue tracker to make sure someone already hasn't
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
- see LICENSE.txt for details.
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
- # encoding: utf-8
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
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
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 :default => [:compile, :test]
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
- # by Swig. Since the ExtensionTasks depend on the *_wrap.cxx files,
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. To prevent those dependencies, do not import
37
- # swig.rake when running in Travis.
38
- import 'tasks/swig.rake' unless ENV['TRAVIS'] == 'true'
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
@@ -223,7 +223,7 @@ module TagLib::ID3v2
223
223
  BandLogo = 0x13
224
224
  PublisherLogo = 0x14
225
225
 
226
- def initialize()
226
+ def initialize
227
227
  end
228
228
 
229
229
  # @return [String]
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
- attr_reader :data
368
+ attr_reader :data
371
369
 
372
370
  # @param [Fixnum] format
373
371
  # @param [String] data
data/docs/taglib/mpeg.rb CHANGED
@@ -171,7 +171,6 @@ module TagLib::MPEG
171
171
 
172
172
  # Xing VBR header.
173
173
  class XingHeader
174
-
175
174
  Invalid = 0
176
175
  Xing = 1
177
176
  VBRI = 2
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
@@ -1,5 +1,4 @@
1
1
  module TagLib::Ogg::Vorbis
2
-
3
2
  # The file class for `.ogg` and other `.oga` files.
4
3
  #
5
4
  # @example Reading Vorbis comments
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
@@ -1,54 +1,50 @@
1
- # Default opt dirs to help mkmf find taglib
1
+ # frozen-string-literal: true
2
2
 
3
- opt_dirs = ["/usr/local", "/opt/local", "/sw"]
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', "")[/^[^ ]*\/vendor\//]
7
- if vendor
8
- opt_dirs << (vendor + "taglib")
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 msg
19
- message msg + "\n"
16
+ def error(msg)
17
+ message "#{msg}\n"
20
18
  abort
21
19
  end
22
20
 
23
- if ENV.has_key?('TAGLIB_DIR') and !File.directory?(ENV['TAGLIB_DIR'])
24
- error "When defined, the TAGLIB_DIR environment variable must point to a valid directory."
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
- # for finding taglib headers and libs. See MakeMakefile#dir_config
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.has_key?('TAGLIB_DIR')))
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(" ").include?("-static-libstdc++")
35
- if not have_library('stdc++')
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
- if not have_library('tag')
41
- error <<-DESC
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 << " -DSWIG_TYPE_TABLE=taglib"
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']
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
2
4
  require 'extconf_common'
3
5