rmagick 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/ImageMagick6/devcontainer.json +2 -2
  3. data/.devcontainer/devcontainer.json +2 -2
  4. data/.editorconfig +2 -2
  5. data/.github/workflows/ci.yml +46 -13
  6. data/.rubocop.yml +7 -0
  7. data/.rubocop_todo.yml +53 -91
  8. data/CHANGELOG.md +22 -0
  9. data/Gemfile +4 -0
  10. data/README.md +14 -9
  11. data/Rakefile +36 -13
  12. data/before_install_linux.sh +3 -1
  13. data/before_install_osx.sh +8 -4
  14. data/ext/RMagick/extconf.rb +15 -98
  15. data/ext/RMagick/rmagick.h +3 -3
  16. data/ext/RMagick/rmilist.cpp +1 -1
  17. data/ext/RMagick/rmimage.cpp +2 -0
  18. data/lib/rmagick/version.rb +1 -1
  19. data/lib/rmagick_internal.rb +6 -9
  20. data/lib/rvg/clippath.rb +2 -0
  21. data/lib/rvg/container.rb +2 -0
  22. data/lib/rvg/deep_equal.rb +2 -0
  23. data/lib/rvg/describable.rb +2 -0
  24. data/lib/rvg/embellishable.rb +2 -0
  25. data/lib/rvg/misc.rb +2 -0
  26. data/lib/rvg/paint.rb +2 -0
  27. data/lib/rvg/pathdata.rb +2 -0
  28. data/lib/rvg/rvg.rb +2 -0
  29. data/lib/rvg/stretchable.rb +2 -0
  30. data/lib/rvg/stylable.rb +2 -0
  31. data/lib/rvg/text.rb +2 -0
  32. data/lib/rvg/transformable.rb +2 -0
  33. data/lib/rvg/units.rb +2 -0
  34. data/rmagick.gemspec +9 -3
  35. data/sig/rmagick/_draw_common_methods.rbs +2 -0
  36. data/sig/rmagick/_image_common_methods.rbs +4 -2
  37. data/sig/rmagick/draw.rbs +2 -0
  38. data/sig/rmagick/draw_attribute.rbs +2 -0
  39. data/sig/rmagick/enum.rbs +6 -4
  40. data/sig/rmagick/error.rbs +2 -0
  41. data/sig/rmagick/fill.rbs +2 -0
  42. data/sig/rmagick/geometry.rbs +3 -1
  43. data/sig/rmagick/image.rbs +5 -3
  44. data/sig/rmagick/image_list.rbs +23 -21
  45. data/sig/rmagick/iptc.rbs +2 -0
  46. data/sig/rmagick/kernel_info.rbs +2 -0
  47. data/sig/rmagick/optional_method_arguments.rbs +2 -0
  48. data/sig/rmagick/pixel.rbs +2 -0
  49. data/sig/rmagick/struct.rbs +2 -0
  50. data/sig/rvg/embellishable.rbs +1 -1
  51. data/sig/rvg/pathdata.rbs +1 -1
  52. data/sig/rvg/rvg.rbs +1 -1
  53. data/sig/rvg/stylable.rbs +1 -1
  54. data/sig/rvg/text.rbs +1 -1
  55. data/sig/rvg/transformable.rbs +1 -1
  56. metadata +8 -7
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'simplecov'
2
4
  require './lib/rmagick/version'
3
5
  require 'fileutils'
4
6
  require 'English'
5
-
6
- desc "Open an irb session preloaded with this library"
7
- task :console do
8
- sh "irb -r ./ext/RMagick/extconf.rb -r ./lib/rmagick.rb"
9
- end
7
+ require 'bundler/gem_tasks'
8
+ require 'rake/extensiontask'
9
+ require 'rspec/core/rake_task'
10
10
 
11
11
  task :config do
12
12
  def version
@@ -52,7 +52,7 @@ task push_and_tag: [:build] do
52
52
  sh "gem push #{File.join(base, 'pkg', gem_name)}"
53
53
  if $CHILD_STATUS.success?
54
54
  sh "git tag -a -m \"Version #{version}\" #{version_tag}"
55
- STDOUT.puts "Tagged #{version_tag}."
55
+ puts "Tagged #{version_tag}."
56
56
  sh 'git push'
57
57
  sh 'git push --tags'
58
58
  else
@@ -60,6 +60,7 @@ task push_and_tag: [:build] do
60
60
  end
61
61
  end
62
62
 
63
+ Rake::Task["release"].clear # Remove `release` task in bundler/gem_tasks
63
64
  desc 'Release'
64
65
  task release: %i[assert_clean_repo push_and_tag]
65
66
 
@@ -94,18 +95,24 @@ namespace :website do
94
95
  File.open(File.join(output_dir, output_file_name), 'w') do |dest|
95
96
  dest.puts <<~END_EXHTMLHEAD
96
97
  <!DOCTYPE public PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
97
- <html xmlns="http://www.w3.org/1999/xhtml">
98
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
98
99
  <head>
99
100
  <meta name="generator" content="ex2html.rb" />
100
101
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
101
102
  <link rel="stylesheet" type="text/css" href="css/popup.css" />
103
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css" />
104
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
105
+ <script>
106
+ hljs.configure({ cssSelector: "pre" });
107
+ hljs.highlightAll();
108
+ </script>
102
109
  <title>RMagick example: #{input_file_name}</title>
103
110
  </head>
104
111
  <body>
105
112
  <h1>#{input_file_name}</h1>
106
113
  <div class="bodybox">
107
114
  <div class="bodyfloat">
108
- <pre>
115
+ <pre class="language-ruby">
109
116
  END_EXHTMLHEAD
110
117
 
111
118
  src.each do |line|
@@ -125,8 +132,8 @@ namespace :website do
125
132
  end
126
133
  end
127
134
 
128
- desc 'Update RMagick website'
129
- task :update do
135
+ desc 'Update RMagick website HTML files'
136
+ task :"update:html" do
130
137
  unless File.exist?(PATH_TO_LOCAL_WEBSITE_REPOSITORY)
131
138
  puts "Please clone the rmagick.github.io repository to #{PATH_TO_LOCAL_WEBSITE_REPOSITORY}"
132
139
  exit 1
@@ -141,6 +148,25 @@ namespace :website do
141
148
  file_to_html('doc/ex', file_name, PATH_TO_LOCAL_WEBSITE_REPOSITORY, "#{file_name}.html")
142
149
  end
143
150
  end
151
+
152
+ desc 'Update RMagick website image files'
153
+ task :"update:image" do
154
+ unless File.exist?(PATH_TO_LOCAL_WEBSITE_REPOSITORY)
155
+ puts "Please clone the rmagick.github.io repository to #{PATH_TO_LOCAL_WEBSITE_REPOSITORY}"
156
+ exit 1
157
+ end
158
+
159
+ Rake::Task['install'].invoke
160
+
161
+ FileUtils.rm_rf("#{PATH_TO_LOCAL_WEBSITE_REPOSITORY}/ex")
162
+ FileUtils.cp_r('doc/ex', PATH_TO_LOCAL_WEBSITE_REPOSITORY)
163
+
164
+ FileUtils.cd("#{PATH_TO_LOCAL_WEBSITE_REPOSITORY}/ex") do
165
+ Dir.glob('*.rb').each do |file|
166
+ sh "ruby #{file}"
167
+ end
168
+ end
169
+ end
144
170
  end
145
171
 
146
172
  namespace :rbs do
@@ -153,9 +179,6 @@ namespace :rbs do
153
179
  end
154
180
  end
155
181
 
156
- require 'bundler/gem_tasks'
157
- require 'rake/extensiontask'
158
- require 'rspec/core/rake_task'
159
182
  RSpec::Core::RakeTask.new(:spec)
160
183
 
161
184
  Rake::ExtensionTask.new('RMagick2') do |ext|
@@ -13,13 +13,15 @@ if [ ! -v IMAGEMAGICK_VERSION ]; then
13
13
  exit 1
14
14
  fi
15
15
 
16
+ sudo apt-get update
17
+
16
18
  # remove all existing imagemagick related packages
17
19
  sudo apt-get autoremove -y imagemagick* libmagick* --purge
18
20
 
19
21
  # install build tools, ImageMagick delegates
20
22
  sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
21
23
  liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev \
22
- libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript
24
+ libtiff5-dev libwebp-dev liblqr-1-0-dev libglib2.0-dev gsfonts ghostscript
23
25
 
24
26
  project_dir=$(pwd)
25
27
  build_dir="${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}"
@@ -15,10 +15,10 @@ fi
15
15
 
16
16
  export HOMEBREW_NO_AUTO_UPDATE=true
17
17
  brew uninstall --force imagemagick imagemagick@6
18
- brew install wget ghostscript freetype libtool jpeg little-cms2 openexr libomp libpng libtiff liblqr zlib webp zstd
18
+ brew install wget ghostscript freetype libtool jpeg jpeg-xl little-cms2 openexr libomp libpng libtiff liblqr zlib webp zstd glib
19
19
 
20
- export LDFLAGS="-L$(brew --prefix jpeg)/lib -L$(brew --prefix little-cms2)/lib -L$(brew --prefix openexr)/lib -L$(brew --prefix libomp)/lib -L$(brew --prefix libpng)/lib -L$(brew --prefix libtiff)/lib -L$(brew --prefix liblqr)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix webp)/lib -L$(brew --prefix zstd)/lib"
21
- export CPPFLAGS="-I$(brew --prefix jpeg)/include -I$(brew --prefix openexr)/include/OpenEXR -I$(brew --prefix libtiff)/include -I$(brew --prefix zlib)/include -I$(brew --prefix zstd)/include -I$(brew --prefix glib)/include/glib-2.0 -I$(brew --prefix glib)/lib/glib-2.0/include"
20
+ export LDFLAGS="-L$(brew --prefix jpeg)/lib -I$(brew --prefix jpeg-xl)/lib -L$(brew --prefix little-cms2)/lib -L$(brew --prefix openexr)/lib -L$(brew --prefix libomp)/lib -L$(brew --prefix libpng)/lib -L$(brew --prefix libtiff)/lib -L$(brew --prefix liblqr)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix webp)/lib -L$(brew --prefix zstd)/lib"
21
+ export CPPFLAGS="-I$(brew --prefix jpeg)/include -I$(brew --prefix jpeg-xl)/include -I$(brew --prefix openexr)/include/OpenEXR -I$(brew --prefix libtiff)/include -I$(brew --prefix zlib)/include -I$(brew --prefix zstd)/include -I$(brew --prefix glib)/include/glib-2.0 -I$(brew --prefix glib)/lib/glib-2.0/include"
22
22
 
23
23
  project_dir=$(pwd)
24
24
  build_dir="${project_dir}/build-ImageMagick/ImageMagick-${IMAGEMAGICK_VERSION}"
@@ -41,7 +41,11 @@ build_imagemagick() {
41
41
  fi
42
42
 
43
43
  cd "${build_dir}"
44
- ./configure --prefix=/usr/local "${options}" --without-raw
44
+ ./configure \
45
+ --prefix=/usr/local \
46
+ "${options}" \
47
+ --with-gs-font-dir=/opt/homebrew/share/ghostscript/fonts \
48
+ --without-raw
45
49
  make -j
46
50
  }
47
51
 
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib_dir = File.expand_path('../../lib', File.dirname(__FILE__))
2
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
3
- require 'rubygems'
4
5
  require 'mkmf'
5
6
  require 'pkg-config'
6
7
 
@@ -20,6 +21,7 @@ module RMagick
20
21
  ImageMagick-6.Q32
21
22
  ImageMagick-6.Q16
22
23
  ImageMagick-6.Q8
24
+ ImageMagick-6
23
25
  ].freeze
24
26
 
25
27
  # ImageMagick 7 packages
@@ -32,6 +34,7 @@ module RMagick
32
34
  ImageMagick-7.Q32
33
35
  ImageMagick-7.Q16
34
36
  ImageMagick-7.Q8
37
+ ImageMagick-7
35
38
  ].freeze
36
39
 
37
40
  attr_reader :headers
@@ -106,9 +109,6 @@ module RMagick
106
109
 
107
110
  else
108
111
 
109
- check_multiple_imagemagick_versions
110
- check_partial_imagemagick_versions
111
-
112
112
  original_ldflags = $LDFLAGS.dup
113
113
 
114
114
  libdir = PKGConfig.libs_only_L($magick_package).chomp.sub('-L', '')
@@ -125,11 +125,9 @@ module RMagick
125
125
  # if linker does not recognizes '-Wl,-rpath,somewhere' option, it revert to original option
126
126
  $LDFLAGS = "#{original_ldflags} #{ldflags}"
127
127
  end
128
-
129
- configure_archflags_for_osx($magick_package) if RUBY_PLATFORM.include?('darwin') # osx
130
-
131
128
  end
132
- $CPPFLAGS += ' $(optflags) $(debugflags)'
129
+
130
+ $CPPFLAGS += ' $(optflags) $(debugflags) -fomit-frame-pointer'
133
131
  end
134
132
 
135
133
  def exit_failure(msg)
@@ -165,10 +163,14 @@ module RMagick
165
163
 
166
164
  def determine_imagemagick_package
167
165
  packages = [installed_im7_packages, installed_im6_packages].flatten
166
+ return if packages.empty?
168
167
 
169
- if packages.empty?
170
- exit_failure "Can't install RMagick #{RMAGICK_VERS}. Can't find ImageMagick with pkg-config\n"
171
- end
168
+ msg = "\nDetected ImageMagick packages:\n"
169
+ Logging.message msg
170
+ message msg
171
+ package_paths = packages.map { |package| "- #{PKGConfig.package_config(package).pc_path}" }.join("\n")
172
+ Logging.message package_paths + "\n\n"
173
+ message package_paths + "\n\n"
172
174
 
173
175
  if installed_im6_packages.any? && installed_im7_packages.any?
174
176
  checking_for('forced use of ImageMagick 6') do
@@ -183,8 +185,7 @@ module RMagick
183
185
  end
184
186
 
185
187
  if packages.length > 1
186
- package_lines = packages.map { |package| " - #{package}" }.join("\n")
187
- msg = "\nWarning: Found more than one ImageMagick installation. This could cause problems at runtime.\n#{package_lines}\n\n"
188
+ msg = "\nWarning: Found more than one ImageMagick installation. This could cause problems at runtime.\n\n"
188
189
  Logging.message msg
189
190
  message msg
190
191
  end
@@ -192,80 +193,6 @@ module RMagick
192
193
  packages.first
193
194
  end
194
195
 
195
- # Seems like lots of people have multiple versions of ImageMagick installed.
196
- def check_multiple_imagemagick_versions
197
- versions = []
198
- path = ENV['PATH'].split(File::PATH_SEPARATOR)
199
- path.each do |dir|
200
- file = File.join(dir, 'Magick-config')
201
- next unless File.executable? file
202
-
203
- vers = `#{file} --version`.chomp.strip
204
- prefix = `#{file} --prefix`.chomp.strip
205
- versions << [vers, prefix, dir]
206
- end
207
- versions.uniq!
208
- return unless versions.size > 1
209
-
210
- msg = "\nWarning: Found more than one ImageMagick installation. This could cause problems at runtime.\n"
211
- versions.each do |vers, prefix, dir|
212
- msg << " #{dir}/Magick-config reports version #{vers} is installed in #{prefix}\n"
213
- end
214
- msg << "Using #{versions[0][0]} from #{versions[0][1]}.\n\n"
215
- Logging.message msg
216
- message msg
217
- end
218
-
219
- # Ubuntu (maybe other systems) comes with a partial installation of
220
- # ImageMagick in the prefix /usr (some libraries, no includes, and no
221
- # binaries). This causes problems when /usr/lib is in the path (e.g., using
222
- # the default Ruby installation).
223
- def check_partial_imagemagick_versions
224
- prefix = config_string('prefix') || ''
225
- matches = [
226
- prefix + '/lib/lib?agick*',
227
- prefix + '/include/ImageMagick',
228
- prefix + '/bin/Magick-config'
229
- ].map do |file_glob|
230
- Dir.glob(file_glob)
231
- end
232
- matches.delete_if(&:empty?)
233
- return unless !matches.empty? && matches.length < 3
234
-
235
- msg = <<~MESSAGE
236
-
237
- Warning: Found a partial ImageMagick installation. Your operating
238
- system likely has some built-in ImageMagick libraries but not all of
239
- ImageMagick. This will most likely cause problems at both compile and
240
- runtime.
241
- Found partial installation at: #{prefix}
242
-
243
- MESSAGE
244
-
245
- Logging.message msg
246
- message msg
247
- end
248
-
249
- # issue #169
250
- # set ARCHFLAGS appropriately for OSX
251
- def configure_archflags_for_osx(magick_package)
252
- return unless PKGConfig.libs_only_L(magick_package) =~ %r{-L(.+)/lib}
253
-
254
- imagemagick_dir = Regexp.last_match(1)
255
- command = Dir.glob(File.join(imagemagick_dir, "bin/*")).find { |file| File.executable? file }
256
- fileinfo = `file #{command}`
257
-
258
- # default ARCHFLAGS
259
- archs = $ARCH_FLAG.scan(/-arch\s+(\S+)/).flatten
260
-
261
- archflags = []
262
- archs.each do |arch|
263
- archflags << "-arch #{arch}" if fileinfo.include?(arch)
264
- end
265
-
266
- $ARCH_FLAG = archflags.join(' ') unless archflags.empty?
267
- end
268
-
269
196
  def search_paths_for_windows
270
197
  msg = 'searching PATH for the ImageMagick library...'
271
198
  Logging.message msg
@@ -297,7 +224,6 @@ module RMagick
297
224
  end
298
225
 
299
226
  def assert_can_compile!
300
- assert_minimum_ruby_version!
301
227
  assert_has_dev_libs!
302
228
 
303
229
  # Check for compiler. Extract first word so ENV['CXX'] can be a program name with arguments.
@@ -305,14 +231,6 @@ module RMagick
305
231
  exit_failure "No C++ compiler found in ${ENV['PATH']}. See mkmf.log for details." unless find_executable(cxx)
306
232
  end
307
233
 
308
- def assert_minimum_ruby_version!
309
- supported = checking_for("Ruby version >= #{MIN_RUBY_VERS}") do
310
- Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(MIN_RUBY_VERS)
311
- end
312
-
313
- exit_failure "Can't install RMagick #{RMAGICK_VERS}. Ruby #{MIN_RUBY_VERS} or later required.\n" unless supported
314
- end
315
-
316
234
  def assert_has_dev_libs!
317
235
  failure_message = <<~END_FAILURE
318
236
  Can't install RMagick #{RMAGICK_VERS}.
@@ -325,11 +243,10 @@ module RMagick
325
243
  $magick_version = Regexp.last_match(1)
326
244
  exit_failure failure_message unless $magick_version
327
245
  else
328
- unless PKGConfig.libs('MagickCore')[/\bl\s*(MagickCore|Magick)6?\b/]
246
+ unless ($magick_package = determine_imagemagick_package)
329
247
  exit_failure failure_message
330
248
  end
331
249
 
332
- $magick_package = determine_imagemagick_package
333
250
  $magick_version = PKGConfig.modversion($magick_package)[/^(\d+\.\d+\.\d+)/]
334
251
  end
335
252
 
@@ -273,8 +273,8 @@ typedef struct
273
273
 
274
274
  //! Quantum expression adapter.
275
275
  /**
276
- * Both ImageMagick and GraphicsMagick define an enum type for quantum-level
277
- * expressions, but they're different types. The QuantumExpressionOperator
276
+ * ImageMagick defines an enum type for quantum-level expressions,
277
+ * but they're different types. The QuantumExpressionOperator
278
278
  * type is an adapter type that can be mapped to either one.
279
279
  */
280
280
  typedef enum _QuantumExpressionOperator
@@ -349,7 +349,7 @@ EXTERN VALUE Class_Chromaticity;
349
349
  EXTERN VALUE Class_Color;
350
350
  EXTERN VALUE Class_Font;
351
351
  EXTERN VALUE Class_Geometry;
352
- EXTERN VALUE Class_GeometryValue; // Defined in RMagick.rb
352
+ EXTERN VALUE Class_GeometryValue; // Defined in rmagick_internal.rb
353
353
  EXTERN VALUE Class_Pixel;
354
354
  EXTERN VALUE Class_Point;
355
355
  EXTERN VALUE Class_PolaroidOptions;
@@ -744,7 +744,7 @@ ImageList_optimize_layers(VALUE self, VALUE method)
744
744
  * No Ruby usage (internal function)
745
745
  *
746
746
  * Notes:
747
- * - this simply calls ImageList.new() in RMagick.rb
747
+ * - this simply calls ImageList.new() in rmagick_internal.rb
748
748
  *
749
749
  * @return a new imagelist
750
750
  */
@@ -11600,6 +11600,8 @@ rd_image(VALUE klass ATTRIBUTE_UNUSED, VALUE file, gvl_function_t fp)
11600
11600
  rm_check_exception(exception, images, DestroyOnError);
11601
11601
  DestroyExceptionInfo(exception);
11602
11602
 
11603
+ rm_ensure_result(images);
11604
+
11603
11605
  rm_set_user_artifact(images, info);
11604
11606
  rm_sync_image_options(images, info);
11605
11607
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magick
4
- VERSION = '6.0.0'
4
+ VERSION = '6.1.0'
5
5
  MIN_RUBY_VERSION = '3.0.0'
6
6
  MIN_IM_VERSION = '6.8.9'
7
7
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # $Id: RMagick.rb,v 1.84 2009/09/15 22:08:41 rmagick Exp $
3
+ # $Id: rmagick_internal.rb,v 1.84 2009/09/15 22:08:41 rmagick Exp $
4
4
  #==============================================================================
5
5
  # Copyright (C) 2009 by Timothy P. Hunter
6
- # Name: RMagick.rb
6
+ # Name: rmagick_internal.rb
7
7
  # Author: Tim Hunter
8
8
  # Purpose: Extend Ruby to interface with ImageMagick.
9
9
  # Notes: RMagick2.so defines the classes. The code below adds methods
@@ -11,12 +11,9 @@
11
11
  #==============================================================================
12
12
 
13
13
  if RUBY_PLATFORM.match?(/mingw/i)
14
- begin
15
- require 'ruby_installer'
16
- ENV['PATH'].split(File::PATH_SEPARATOR).grep(/ImageMagick/i).each do |path|
17
- RubyInstaller::Runtime.add_dll_directory(path) if File.exist?(File.join(path, 'CORE_RL_magick_.dll')) || File.exist?(File.join(path, 'CORE_RL_MagickCore_.dll'))
18
- end
19
- rescue LoadError
14
+ require 'ruby_installer'
15
+ ENV['PATH'].split(File::PATH_SEPARATOR).grep(/ImageMagick/i).each do |path|
16
+ RubyInstaller::Runtime.add_dll_directory(path) if File.exist?(File.join(path, 'CORE_RL_magick_.dll')) || File.exist?(File.join(path, 'CORE_RL_MagickCore_.dll'))
20
17
  end
21
18
  end
22
19
 
@@ -1616,7 +1613,7 @@ module Magick
1616
1613
  if @scene
1617
1614
  img = @images[@scene]
1618
1615
  new_img = img.public_send(meth_id, *args, &block)
1619
- img.object_id == new_img.object_id ? self : new_img
1616
+ img.equal?(new_img) ? self : new_img
1620
1617
  else
1621
1618
  super
1622
1619
  end
data/lib/rvg/clippath.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: clippath.rb,v 1.5 2009/02/28 23:52:13 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/container.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: container.rb,v 1.5 2009/02/28 23:52:13 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class RVG
3
5
  [PathData, Styles, Transforms].each do |c|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: describable.rb,v 1.5 2009/02/28 23:52:13 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: embellishable.rb,v 1.9 2009/02/28 23:52:13 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/misc.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # $Id: misc.rb,v 1.17 2010/03/21 01:43:01 baror Exp $
2
4
  # Copyright (C) 2009 Timothy P. Hunter
3
5
  module Magick
data/lib/rvg/paint.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: paint.rb,v 1.6 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/pathdata.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: pathdata.rb,v 1.5 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/rvg.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--############################################################################
2
4
  # $Id: rvg.rb,v 1.10 2009/02/28 23:52:28 rmagick Exp $
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: stretchable.rb,v 1.7 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/stylable.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: stylable.rb,v 1.7 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/text.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: text.rb,v 1.7 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # $Id: transformable.rb,v 1.5 2009/02/28 23:52:28 rmagick Exp $
3
5
  # Copyright (C) 2009 Timothy P. Hunter
data/lib/rvg/units.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # $Id: units.rb,v 1.5 2009/02/28 23:52:28 rmagick Exp $
2
4
  # Copyright (C) 2009 Timothy P. Hunter
3
5
  module Magick
data/rmagick.gemspec CHANGED
@@ -1,4 +1,5 @@
1
- require 'date'
1
+ # frozen_string_literal: true
2
+
2
3
  require 'English'
3
4
  require './lib/rmagick/version'
4
5
 
@@ -12,6 +13,11 @@ Gem::Specification.new do |s|
12
13
  s.homepage = 'https://github.com/rmagick/rmagick'
13
14
  s.license = 'MIT'
14
15
 
16
+ s.metadata['bug_tracker_uri'] = 'https://github.com/rmagick/rmagick/issues'
17
+ s.metadata['documentation_uri'] = 'https://rmagick.github.io/'
18
+ s.metadata['changelog_uri'] = 'https://github.com/rmagick/rmagick/blob/main/CHANGELOG.md'
19
+ s.metadata['rubygems_mfa_required'] = 'true'
20
+
15
21
  tracked_files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
16
22
  file_exclusion_regex = /\A(doc|benchmarks|examples|spec|Steepfile)/
17
23
  files = tracked_files.reject { |file| file[file_exclusion_regex] }
@@ -23,6 +29,6 @@ Gem::Specification.new do |s|
23
29
  s.required_ruby_version = ">= #{Magick::MIN_RUBY_VERSION}"
24
30
  s.requirements << "ImageMagick #{Magick::MIN_IM_VERSION} or later"
25
31
 
26
- s.add_runtime_dependency 'observer', '~> 0.1'
27
- s.add_runtime_dependency 'pkg-config', '~> 1.4'
32
+ s.add_dependency 'observer', '~> 0.1'
33
+ s.add_dependency 'pkg-config', '~> 1.4'
28
34
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  interface _DrawCommonMethods
3
5
  def affine: (magick_real sx, magick_real rx, magick_real ry, magick_real sy, magick_real tx, magick_real ty) -> self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  interface _ImageCommonMethods
3
5
  # Magick::Image / Magick::ImageList common methods
@@ -20,7 +22,7 @@ module Magick
20
22
  def matte_replace: (int x, int y) -> Image
21
23
  def matte_floodfill: (int x, int y) -> Image
22
24
  def matte_fill_to_border: (int x, int y) -> Image
23
- def matte_reset!: -> Image
25
+ def matte_reset!: () -> Image
24
26
  def resize_to_fill: (real ncols, ?real nrows, ?GravityType gravity) -> Image
25
27
  def resize_to_fill!: (real ncols, ?real nrows, ?GravityType gravity) -> Image
26
28
  alias crop_resized resize_to_fill
@@ -304,7 +306,7 @@ module Magick
304
306
  def raise: (?int width, ?int height, ?bool raised) -> Image
305
307
  def random_threshold_channel: (Geometry | string geometry, *ChannelType channel) -> Image
306
308
  def recolor: (Array[magick_real] color_matrix) -> Image
307
- def reduce_noise: (int radius) -> Image
309
+ def reduce_noise: (int radius) -> Image
308
310
  def resample: (?magick_real x_resolution, ?magick_real y_resolution, ?FilterType filter, ?magick_real blur) -> Image
309
311
  def resample!: (?magick_real x_resolution, ?magick_real y_resolution, ?FilterType filter, ?magick_real blur) -> self
310
312
  def resize: (magick_real scale) -> Image
data/sig/rmagick/draw.rbs CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class Draw
3
5
  include DrawAttribute
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  module DrawAttribute
3
5
  attr_writer affine: AffineMatrix
data/sig/rmagick/enum.rbs CHANGED
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class Enum
3
5
  def initialize: (interned sym, int val) -> void
4
- def to_s: -> String
5
- def to_i: -> Integer
6
+ def to_s: () -> String
7
+ def to_i: () -> Integer
6
8
  def <=>: (Enum other) -> (-1 | 0 | 1 | nil)
7
9
  def ===: (Enum other) -> bool
8
10
  def |: (Enum other) -> Enum
@@ -10,11 +12,11 @@ module Magick
10
12
 
11
13
  interface _EnumInstanceMethod
12
14
  def initialize: (interned sym, int val) -> void
13
- def inspect: -> String
15
+ def inspect: () -> String
14
16
  end
15
17
 
16
18
  interface _EnumClassMethod[T]
17
- def values: -> Array[T]
19
+ def values: () -> Array[T]
18
20
  end
19
21
 
20
22
  class GeometryValue < Enum
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class ImageMagickError < StandardError
3
5
  attr_reader magick_location: String
data/sig/rmagick/fill.rbs CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class GradientFill
3
5
  include _Fill
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Magick
2
4
  class Geometry
3
5
  attr_accessor width: Integer | Float
@@ -8,7 +10,7 @@ module Magick
8
10
 
9
11
  def initialize: (?magick_real? width, ?magick_real? height, ?real? x, ?real? y, ?GeometryValue? flag) -> void
10
12
  def self.from_s: (String str) -> Geometry
11
- def to_s: -> String
13
+ def to_s: () -> String
12
14
  end
13
15
  end
14
16