rmagick 5.4.4 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/ImageMagick6/devcontainer.json +1 -1
  3. data/.devcontainer/devcontainer.json +1 -1
  4. data/.github/workflows/ci.yml +41 -31
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +36 -9
  7. data/.rubocop_todo.yml +369 -187
  8. data/CHANGELOG.md +77 -0
  9. data/Gemfile +14 -0
  10. data/README.md +3 -3
  11. data/Rakefile +12 -1
  12. data/before_install_linux.sh +1 -11
  13. data/before_install_osx.sh +5 -7
  14. data/ext/RMagick/extconf.rb +58 -68
  15. data/ext/RMagick/rmagick.h +7 -12
  16. data/ext/RMagick/rmdraw.cpp +10 -20
  17. data/ext/RMagick/rmfill.cpp +4 -4
  18. data/ext/RMagick/rmilist.cpp +10 -2
  19. data/ext/RMagick/rmimage.cpp +342 -344
  20. data/ext/RMagick/rminfo.cpp +22 -21
  21. data/ext/RMagick/rmkinfo.cpp +5 -18
  22. data/ext/RMagick/rmmain.cpp +42 -91
  23. data/ext/RMagick/rmmontage.cpp +5 -5
  24. data/ext/RMagick/rmpixel.cpp +3 -3
  25. data/ext/RMagick/rmutil.cpp +58 -89
  26. data/lib/rmagick/version.rb +3 -3
  27. data/lib/rmagick.rb +1 -1
  28. data/lib/rmagick_internal.rb +111 -103
  29. data/lib/rvg/container.rb +3 -3
  30. data/lib/rvg/embellishable.rb +7 -3
  31. data/lib/rvg/misc.rb +15 -15
  32. data/lib/rvg/rvg.rb +6 -6
  33. data/lib/rvg/stretchable.rb +2 -2
  34. data/lib/rvg/stylable.rb +2 -2
  35. data/lib/rvg/transformable.rb +1 -1
  36. data/lib/rvg/units.rb +1 -0
  37. data/rmagick.gemspec +2 -15
  38. data/sig/rmagick/_draw_common_methods.rbs +64 -0
  39. data/sig/rmagick/_image_common_methods.rbs +387 -0
  40. data/sig/rmagick/draw.rbs +38 -0
  41. data/sig/rmagick/draw_attribute.rbs +28 -0
  42. data/sig/rmagick/enum.rbs +820 -0
  43. data/sig/rmagick/error.rbs +11 -0
  44. data/sig/rmagick/fill.rbs +21 -0
  45. data/sig/rmagick/geometry.rbs +14 -0
  46. data/sig/rmagick/image.rbs +196 -0
  47. data/sig/rmagick/image_list.rbs +183 -0
  48. data/sig/rmagick/iptc.rbs +101 -0
  49. data/sig/rmagick/kernel_info.rbs +12 -0
  50. data/sig/rmagick/optional_method_arguments.rbs +10 -0
  51. data/sig/rmagick/pixel.rbs +46 -0
  52. data/sig/rmagick/struct.rbs +90 -0
  53. data/sig/rmagick.rbs +43 -0
  54. data/sig/rvg/clippath.rbs +34 -0
  55. data/sig/rvg/container.rbs +78 -0
  56. data/sig/rvg/deep_equal.rbs +48 -0
  57. data/sig/rvg/describable.rbs +30 -0
  58. data/sig/rvg/embellishable.rbs +226 -0
  59. data/sig/rvg/misc.rbs +145 -0
  60. data/sig/rvg/paint.rbs +55 -0
  61. data/sig/rvg/pathdata.rbs +77 -0
  62. data/sig/rvg/rvg.rbs +125 -0
  63. data/sig/rvg/stretchable.rbs +56 -0
  64. data/sig/rvg/stylable.rbs +66 -0
  65. data/sig/rvg/text.rbs +118 -0
  66. data/sig/rvg/transformable.rbs +59 -0
  67. data/sig/rvg/units.rbs +33 -0
  68. metadata +38 -134
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fd768daa5bf84d7e835a4c300d57f6826b3fd86820dd3048a12d73db62ec89f
4
- data.tar.gz: b7afe50d7396365282e6d5e8ff7b8a6c2b0e91e7f1e2d9562d1078dd26bda7a4
3
+ metadata.gz: 4002a5d6c97fb78a5f1a75b4b192cf5151a43570702da719262b34ea08f19c28
4
+ data.tar.gz: 61a03fd6de17ec92ddbf4650a03076072dfda17a6a6c9bcb5db7bb90089c5c84
5
5
  SHA512:
6
- metadata.gz: 23b6376b8c659276107e35c4e58428bc68a4cd8d2d24830ee27c99a83dea0349516af72bf8746a9064f115d35ae3e2f8affa376c6b6ec77d8b7a89aa7ddede8c
7
- data.tar.gz: 7633f97e950e07f2381f25d1a181b427408fa8e46790b0506c31d83d029f58f5098a073446d659d82a05988c20848f60a37fbfe5759340a8613da87bdbc53cae
6
+ metadata.gz: dd88b3a404b7dedd24bd18a71cd5245af2b4cc38df32c377b9a3e8dbcb99b1790e9bd349e6c9abc9e45a0f64c6d75fdd5b92333e4febd1e3884cd04e8a07c23a
7
+ data.tar.gz: aa9ac858769d7332a334cfa154f361028650eeb2947fb0f28dc254d71d72932e0e39a04726586847230f53ee658bb2d169fab385c6992d20e3bac2e8343c707a
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "../Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "6.9.13-4"
7
+ "IMAGEMAGICK_VERSION": "6.9.13-7"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.1.2",
7
- "IMAGEMAGICK_VERSION": "7.1.1-26"
7
+ "IMAGEMAGICK_VERSION": "7.1.1-29"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -16,32 +16,41 @@ jobs:
16
16
  timeout-minutes: 20
17
17
  steps:
18
18
  - uses: actions/checkout@v4
19
- - name: Set up Ruby 2.3
19
+ - name: Set up Ruby 3.0
20
20
  uses: ruby/setup-ruby@master
21
21
  with:
22
- ruby-version: '2.3'
22
+ ruby-version: '3.0'
23
+ bundler-cache: true
23
24
  - name: Build and test with Rake
24
25
  run: |
25
- bundle install --path=vendor/bundle --jobs 4 --retry 3
26
26
  STYLE_CHECKS=true bundle exec rubocop
27
27
 
28
+ rbs:
29
+ runs-on: ubuntu-latest
30
+ name: RBS
31
+ timeout-minutes: 20
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Set up Ruby 3.0
35
+ uses: ruby/setup-ruby@master
36
+ with:
37
+ ruby-version: '3.0'
38
+ bundler-cache: true
39
+ - name: Validate RBS signatures
40
+ run: |
41
+ bundle exec rake rbs:validate && bundle exec steep check
42
+
28
43
  test-linux:
29
44
  runs-on: ubuntu-latest
30
45
  timeout-minutes: 20
31
46
  strategy:
32
47
  matrix:
33
- ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
48
+ ruby-version: ['3.0', '3.1', '3.2', '3.3']
34
49
  imagemagick-version:
35
- - { full: 6.7.7-10, major-minor: '6.7' }
36
50
  - { full: 6.8.9-10, major-minor: '6.8' }
37
- - { full: 6.9.13-4, major-minor: '6.9' }
51
+ - { full: 6.9.13-9, major-minor: '6.9' }
38
52
  - { full: 7.0.11-14, major-minor: '7.0' }
39
- - { full: 7.1.1-26, major-minor: '7.1' }
40
- exclude:
41
- # Ghostscript 9.55.0 causes error with Ruby 3.3 + ImageMagick 6.7 when run Magick::Draw tests.
42
- # It disable running tests with Ruby 3.3 + ImageMagick 6.7 because it might be difficult to support old ImageMagick.
43
- - ruby-version: '3.3'
44
- imagemagick-version: { major-minor: '6.7' }
53
+ - { full: 7.1.1-31, major-minor: '7.1' }
45
54
 
46
55
  name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
47
56
  steps:
@@ -53,17 +62,17 @@ jobs:
53
62
  key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
54
63
  restore-keys: |
55
64
  v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
56
- - name: Set up Ruby ${{ matrix.ruby-version }}
57
- uses: ruby/setup-ruby@master
58
- with:
59
- ruby-version: ${{ matrix.ruby-version }}
60
65
  - name: Update/Install packages
61
66
  run: |
62
67
  export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }}
63
68
  ./before_install_linux.sh
69
+ - name: Set up Ruby ${{ matrix.ruby-version }}
70
+ uses: ruby/setup-ruby@master
71
+ with:
72
+ ruby-version: ${{ matrix.ruby-version }}
73
+ bundler-cache: true
64
74
  - name: Build and test with Rake
65
75
  run: |
66
- bundle install --path=vendor/bundle --jobs 4 --retry 3
67
76
  bundle exec rake
68
77
 
69
78
  test-macos:
@@ -71,10 +80,10 @@ jobs:
71
80
  timeout-minutes: 20
72
81
  strategy:
73
82
  matrix:
74
- ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
83
+ ruby-version: ['3.0', '3.1', '3.2', '3.3']
75
84
  imagemagick-version:
76
- - { full: 6.9.13-4, major-minor: '6.9' }
77
- - { full: 7.1.1-26, major-minor: '7.1' }
85
+ - { full: 6.9.13-9, major-minor: '6.9' }
86
+ - { full: 7.1.1-31, major-minor: '7.1' }
78
87
 
79
88
  name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
80
89
  steps:
@@ -86,16 +95,16 @@ jobs:
86
95
  key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
87
96
  restore-keys: |
88
97
  v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
98
+ - name: Update/Install packages
99
+ run: |
100
+ IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh
89
101
  - name: Set up Ruby ${{ matrix.ruby-version }}
90
102
  uses: ruby/setup-ruby@master
91
103
  with:
92
104
  ruby-version: ${{ matrix.ruby-version }}
93
- - name: Update/Install packages
94
- run: |
95
- IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh
105
+ bundler-cache: true
96
106
  - name: Build and test with Rake
97
107
  run: |
98
- bundle install --path=vendor/bundle --jobs 4 --retry 3
99
108
  bundle exec rake
100
109
 
101
110
  test-windows:
@@ -105,8 +114,8 @@ jobs:
105
114
  matrix:
106
115
  ruby-version: ['3.3']
107
116
  imagemagick-version:
108
- - { full: 6.9.13-4, major-minor: '6.9' }
109
- - { full: 7.1.1-26, major-minor: '7.1' }
117
+ - { full: 6.9.13-9, major-minor: '6.9' }
118
+ - { full: 7.1.1-31, major-minor: '7.1' }
110
119
  env:
111
120
  bundled_im_dir: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI
112
121
  install_im_dir: D:\ImageMagick
@@ -122,10 +131,6 @@ jobs:
122
131
  # Bundled ImageMagick does not have C/C++ library and dll which required by rmagick.
123
132
  run: |
124
133
  Start-Process -FilePath "${{ env.bundled_im_dir }}\unins000.exe" -ArgumentList "/VERYSILENT /NORESTART"
125
- - name: Set up Ruby ${{ matrix.ruby-version }}
126
- uses: ruby/setup-ruby@master
127
- with:
128
- ruby-version: ${{ matrix.ruby-version }}
129
134
  - name: Install ghostscript
130
135
  run: |
131
136
  choco install ghostscript
@@ -137,6 +142,11 @@ jobs:
137
142
  $url = "https://github.com/rmagick/ImageMagick-binaries/raw/main/$($installer_name)"
138
143
  Invoke-WebRequest -Uri $url -OutFile $installer_name
139
144
  Start-Process -FilePath $installer_name -ArgumentList "/DIR=${{ env.install_im_dir }} /VERYSILENT /NORESTART /TASKS=install_Devel"
145
+ - name: Set up Ruby ${{ matrix.ruby-version }}
146
+ uses: ruby/setup-ruby@master
147
+ with:
148
+ ruby-version: ${{ matrix.ruby-version }}
149
+ bundler-cache: true
140
150
  - name: Build and test with Rake
141
151
  run: |
142
- cmd.exe /D /S /C "bundle install --path=vendor/bundle --retry 3 & bundle exec rake"
152
+ cmd.exe /D /S /C "bundle exec rake"
data/.gitignore CHANGED
@@ -23,6 +23,7 @@ tmp
23
23
  *.def
24
24
  Makefile
25
25
  extconf.h
26
+ compile_flags.txt
26
27
  build-ImageMagick/
27
28
  doc/node_modules/
28
29
  doc/package-lock.json
data/.rubocop.yml CHANGED
@@ -3,11 +3,12 @@ inherit_from:
3
3
 
4
4
  require:
5
5
  - rubocop-rspec
6
+ - rubocop-performance
6
7
 
7
8
  AllCops:
8
9
  DefaultFormatter: fuubar
9
10
  EnabledByDefault: true
10
- TargetRubyVersion: 2.3
11
+ TargetRubyVersion: 3.0
11
12
  Exclude:
12
13
  - 'vendor/bundle/**/*'
13
14
  - '**/*\.spec'
@@ -18,14 +19,34 @@ AllCops:
18
19
  #
19
20
  ################################################################################
20
21
 
21
- Layout/MultilineAssignmentLayout: { EnforcedStyle: same_line }
22
- RSpec/FilePath: { CustomTransform: { Magick: rmagick } }
23
- Style/FormatString: { EnforcedStyle: sprintf }
24
- Style/GuardClause: { MinBodyLength: 3 }
22
+ Layout/MultilineAssignmentLayout:
23
+ EnforcedStyle: same_line
24
+
25
+ RSpec/FilePath:
26
+ CustomTransform: { Magick: rmagick }
27
+
28
+ Style/FormatString:
29
+ EnforcedStyle: sprintf
30
+
31
+ Style/GuardClause:
32
+ MinBodyLength: 3
33
+
25
34
  # we may not need this after finishing RSpec conversion
26
35
  # seems like `rubocop-rspec` already excludes the `spec/` directory
27
- Style/MethodCalledOnDoEndBlock: { Exclude: [test/**/*.rb, spec/**/*.rb] }
28
- Style/NumericLiterals: { MinDigits: 6 }
36
+ Style/MethodCalledOnDoEndBlock:
37
+ Exclude: [spec/**/*.rb]
38
+
39
+ Style/NumericLiterals:
40
+ MinDigits: 6
41
+
42
+ Style/TopLevelMethodDefinition:
43
+ Exclude: [doc/**/*.rb, examples/**/*.rb, spec/**/*.rb]
44
+
45
+ RSpec/BeNil:
46
+ EnforcedStyle: be
47
+
48
+ RSpec/ClassCheck:
49
+ EnforcedStyle: be_kind_of
29
50
 
30
51
  ################################################################################
31
52
  #
@@ -33,5 +54,11 @@ Style/NumericLiterals: { MinDigits: 6 }
33
54
  #
34
55
  ################################################################################
35
56
 
36
- RSpec/AlignLeftLetBrace: { Enabled: false }
37
- RSpec/AlignRightLetBrace: { Enabled: false }
57
+ RSpec/AlignLeftLetBrace:
58
+ Enabled: false
59
+
60
+ RSpec/AlignRightLetBrace:
61
+ Enabled: false
62
+
63
+ Style/Copyright:
64
+ Enabled: false