rmagick 4.2.2 → 5.3.0
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/.devcontainer/Dockerfile +14 -0
- data/.devcontainer/ImageMagick6/devcontainer.json +11 -0
- data/.devcontainer/devcontainer.json +11 -0
- data/.devcontainer/setup-repo.sh +10 -0
- data/.devcontainer/setup-user.sh +45 -0
- data/.github/workflows/ci.yml +55 -24
- data/.gitignore +2 -0
- data/.rubocop_todo.yml +0 -1
- data/CHANGELOG.md +93 -0
- data/README.md +8 -16
- data/Rakefile +53 -81
- data/before_install_linux.sh +4 -4
- data/before_install_osx.sh +7 -6
- data/ext/RMagick/extconf.rb +81 -37
- data/ext/RMagick/rmagick.h +29 -20
- data/ext/RMagick/rmagick_gvl.h +224 -0
- data/ext/RMagick/rmdraw.c +140 -127
- data/ext/RMagick/rmenum.c +34 -15
- data/ext/RMagick/rmfill.c +77 -16
- data/ext/RMagick/rmilist.c +163 -74
- data/ext/RMagick/rmimage.c +1130 -630
- data/ext/RMagick/rminfo.c +109 -121
- data/ext/RMagick/rmkinfo.c +43 -13
- data/ext/RMagick/rmmain.c +15 -11
- data/ext/RMagick/rmmontage.c +45 -24
- data/ext/RMagick/rmpixel.c +66 -42
- data/ext/RMagick/rmstruct.c +6 -6
- data/ext/RMagick/rmutil.c +29 -88
- data/lib/rmagick/version.rb +3 -1
- data/lib/rmagick.rb +2 -0
- data/lib/rmagick_internal.rb +9 -48
- data/lib/rvg/rvg.rb +2 -2
- data/rmagick.gemspec +6 -6
- metadata +25 -8
- data/.codeclimate.yml +0 -63
- data/deprecated/RMagick.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb6efb1cd1084ddfa7fcf81fa760b652ff8c2cf02609da08744931b71bfa5af9
|
4
|
+
data.tar.gz: 66a715d679ea9114f0525cdd5ee60643b8fb84f9f96548a1d82a27e8fc9d0821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '057860ced79ea3612eaae3df6840c57833da74b4eb25ddca45da7d40bf6577cbc6288b1a807dc9c9f8aeb6b0a652f3fe13007166fac2094ec9e75b59e170adf4'
|
7
|
+
data.tar.gz: df562bbda78354a5b595c2494ce6971b6a51c068df580cebd22c9accfb99c73f12ecaf55ab8c9b4f7f25a2cd05530a9b53af77fc29791ee9825bd6ef6b82320a
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -e
|
3
|
+
|
4
|
+
codespaces_bash="$(cat \
|
5
|
+
<<'EOF'
|
6
|
+
# Codespaces bash prompt theme
|
7
|
+
__bash_prompt() {
|
8
|
+
local userpart='`export XIT=$? \
|
9
|
+
&& [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
|
10
|
+
&& echo -n "\[\033[0;36m\][IM ${IMAGEMAGICK_VERSION}]" \
|
11
|
+
&& [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
|
12
|
+
local gitbranch='`\
|
13
|
+
if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
|
14
|
+
export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
|
15
|
+
if [ "${BRANCH}" != "" ]; then \
|
16
|
+
echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
|
17
|
+
&& if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
|
18
|
+
echo -n " \[\033[1;33m\]✗"; \
|
19
|
+
fi \
|
20
|
+
&& echo -n "\[\033[0;36m\]) "; \
|
21
|
+
fi; \
|
22
|
+
fi`'
|
23
|
+
local lightblue='\[\033[1;34m\]'
|
24
|
+
local removecolor='\[\033[0m\]'
|
25
|
+
PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
|
26
|
+
unset -f __bash_prompt
|
27
|
+
}
|
28
|
+
__bash_prompt
|
29
|
+
|
30
|
+
__show_notice() {
|
31
|
+
local __message="
|
32
|
+
\033[0;32mWelcome to Codespaces! You are using the pre-configured rmagick image.\033[0m
|
33
|
+
|
34
|
+
\033[0;35mTests can be executed with:\033[0m bundle exec rake
|
35
|
+
\033[0;35mCode style can be checked with:\033[0m STYLE_CHECKS=true bundle exec rubocop
|
36
|
+
"
|
37
|
+
echo -e "$__message"
|
38
|
+
|
39
|
+
unset -f __show_notice
|
40
|
+
}
|
41
|
+
__show_notice
|
42
|
+
EOF
|
43
|
+
)"
|
44
|
+
|
45
|
+
echo "${codespaces_bash}" >> "/root/.bashrc"
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,12 +7,15 @@ on:
|
|
7
7
|
pull_request:
|
8
8
|
workflow_dispatch:
|
9
9
|
|
10
|
+
permissions:
|
11
|
+
contents: read
|
12
|
+
|
10
13
|
jobs:
|
11
14
|
lint:
|
12
15
|
runs-on: ubuntu-latest
|
13
|
-
timeout-minutes:
|
16
|
+
timeout-minutes: 20
|
14
17
|
steps:
|
15
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v3
|
16
19
|
- name: Set up Ruby 2.3
|
17
20
|
uses: ruby/setup-ruby@master
|
18
21
|
with:
|
@@ -24,19 +27,27 @@ jobs:
|
|
24
27
|
|
25
28
|
test-linux:
|
26
29
|
runs-on: ubuntu-latest
|
27
|
-
timeout-minutes:
|
30
|
+
timeout-minutes: 20
|
28
31
|
strategy:
|
29
32
|
matrix:
|
30
|
-
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
|
33
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
|
31
34
|
imagemagick-version:
|
32
35
|
- { full: 6.7.7-10, major-minor: '6.7' }
|
33
36
|
- { full: 6.8.9-10, major-minor: '6.8' }
|
34
|
-
- { full: 6.9.
|
35
|
-
- { full: 7.0.
|
37
|
+
- { full: 6.9.12-85, major-minor: '6.9' }
|
38
|
+
- { full: 7.0.11-14, major-minor: '7.0' }
|
39
|
+
- { full: 7.1.1-7, major-minor: '7.1' }
|
36
40
|
|
37
41
|
name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
38
42
|
steps:
|
39
|
-
- uses: actions/checkout@
|
43
|
+
- uses: actions/checkout@v3
|
44
|
+
- name: Cache ImageMagick built objects
|
45
|
+
uses: actions/cache@v3
|
46
|
+
with:
|
47
|
+
path: ./build-ImageMagick
|
48
|
+
key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
49
|
+
restore-keys: |
|
50
|
+
v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
40
51
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
41
52
|
uses: ruby/setup-ruby@master
|
42
53
|
with:
|
@@ -55,14 +66,22 @@ jobs:
|
|
55
66
|
timeout-minutes: 20
|
56
67
|
strategy:
|
57
68
|
matrix:
|
58
|
-
ruby-version: ['2.6', '2.7', '3.0']
|
69
|
+
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
59
70
|
imagemagick-version:
|
60
|
-
- { full: 6.9.
|
61
|
-
- { full: 7.0.
|
71
|
+
- { full: 6.9.12-85, major-minor: '6.9' }
|
72
|
+
- { full: 7.0.11-14, major-minor: '7.0' }
|
73
|
+
- { full: 7.1.1-7, major-minor: '7.1' }
|
62
74
|
|
63
75
|
name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
64
76
|
steps:
|
65
|
-
- uses: actions/checkout@
|
77
|
+
- uses: actions/checkout@v3
|
78
|
+
- name: Cache ImageMagick built objects
|
79
|
+
uses: actions/cache@v3
|
80
|
+
with:
|
81
|
+
path: ./build-ImageMagick
|
82
|
+
key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
83
|
+
restore-keys: |
|
84
|
+
v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }}
|
66
85
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
67
86
|
uses: ruby/setup-ruby@master
|
68
87
|
with:
|
@@ -77,31 +96,43 @@ jobs:
|
|
77
96
|
|
78
97
|
test-windows:
|
79
98
|
runs-on: windows-latest
|
80
|
-
timeout-minutes:
|
99
|
+
timeout-minutes: 20
|
81
100
|
strategy:
|
82
101
|
matrix:
|
83
|
-
ruby-version: ['
|
102
|
+
ruby-version: ['3.2']
|
84
103
|
imagemagick-version:
|
85
|
-
- { full: 6.
|
86
|
-
- { full:
|
87
|
-
|
104
|
+
- { full: 6.9.12-85, major-minor: '6.9' }
|
105
|
+
- { full: 7.1.1-7, major-minor: '7.1' }
|
106
|
+
env:
|
107
|
+
bundled_im_dir: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI
|
108
|
+
install_im_dir: D:\ImageMagick
|
109
|
+
|
88
110
|
name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
|
89
111
|
steps:
|
90
|
-
- uses: actions/checkout@
|
112
|
+
- uses: actions/checkout@v3
|
113
|
+
- name: Setup environment variable
|
114
|
+
# https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos
|
115
|
+
run: |
|
116
|
+
Add-Content $env:GITHUB_PATH ${{ env.install_im_dir }}
|
117
|
+
- name: Uninstall bundled ImageMagick
|
118
|
+
# Bundled ImageMagick does not have C/C++ library and dll which required by rmagick.
|
119
|
+
run: |
|
120
|
+
Start-Process -FilePath "${{ env.bundled_im_dir }}\unins000.exe" -ArgumentList "/VERYSILENT /NORESTART"
|
91
121
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
92
122
|
uses: ruby/setup-ruby@master
|
93
123
|
with:
|
94
124
|
ruby-version: ${{ matrix.ruby-version }}
|
125
|
+
- name: Install ghostscript
|
126
|
+
run: |
|
127
|
+
choco install ghostscript
|
95
128
|
- name: Install ImageMagick
|
129
|
+
# https://github.com/rmagick/ImageMagick-binaries
|
96
130
|
run: |
|
97
131
|
$imagemagick_version = "${{ matrix.imagemagick-version.full }}"
|
98
|
-
$imagemagick_version_without_patch = $imagemagick_version.split("-")[0]
|
99
132
|
$installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe"
|
100
|
-
$url = "https://
|
101
|
-
|
102
|
-
|
103
|
-
wget $url --progress=dot
|
104
|
-
cmd.exe /D /S /C "$($installer_name) /DIR=D:\ImageMagick /VERYSILENT /TASKS=install_Devel"
|
133
|
+
$url = "https://github.com/rmagick/ImageMagick-binaries/raw/main/$($installer_name)"
|
134
|
+
Invoke-WebRequest -Uri $url -OutFile $installer_name
|
135
|
+
Start-Process -FilePath $installer_name -ArgumentList "/DIR=${{ env.install_im_dir }} /VERYSILENT /NORESTART /TASKS=install_Devel"
|
105
136
|
- name: Build and test with Rake
|
106
137
|
run: |
|
107
|
-
cmd.exe /D /S /C "
|
138
|
+
cmd.exe /D /S /C "bundle install --path=vendor/bundle --retry 3 & bundle exec rake"
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -182,7 +182,6 @@ Naming/ConstantName:
|
|
182
182
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
183
183
|
Naming/FileName:
|
184
184
|
Exclude:
|
185
|
-
- 'deprecated/RMagick.rb'
|
186
185
|
- 'doc/ex/InitialCoords.rb'
|
187
186
|
- 'doc/ex/NewCoordSys.rb'
|
188
187
|
- 'doc/ex/OrigCoordSys.rb'
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,99 @@
|
|
3
3
|
All notable changes to this project are documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## RMagick 5.3.0
|
7
|
+
|
8
|
+
Improvements
|
9
|
+
|
10
|
+
- Support GC compaction (#1388)
|
11
|
+
|
12
|
+
Bug Fixes
|
13
|
+
|
14
|
+
- Fix memory leak in `Magick::Draw` for recentry ImageMagick 6 by removing unnecessary `GetDrawInfo()` calling (#1406)
|
15
|
+
- Fix crash on ImageList#write with animation gif (#1379)
|
16
|
+
- Windows: Fix RubyInstaller::Runtime::DllDirectory::WinApiError (#1381)
|
17
|
+
|
18
|
+
## RMagick 5.2.0
|
19
|
+
|
20
|
+
Improvements
|
21
|
+
|
22
|
+
- Add OnAlphaChannel and OffAlphaChannel to the AlphaChannelOption enumeration. (#1377)
|
23
|
+
- Add Ruby 3.2 support (#1370)
|
24
|
+
|
25
|
+
## RMagick 5.1.0
|
26
|
+
|
27
|
+
Improvements
|
28
|
+
|
29
|
+
- Improve multi-thread performance by releasing GVL (#1352)
|
30
|
+
- Add Ractor support (#1349)
|
31
|
+
- Avoid overriding compilation variables (#1365)
|
32
|
+
- Remove pkg-config command dependency (#1366)
|
33
|
+
|
34
|
+
## RMagick 5.0.0
|
35
|
+
|
36
|
+
Improvements
|
37
|
+
|
38
|
+
- Improve installer in order to avoid SEGV within pkg-config command (#1359)
|
39
|
+
- Clean up the documents and comment in source code referring to something that no longer exist (#1363)
|
40
|
+
- Remove deprecated 'tile' attribute in Draw#marshal_dump (#1364)
|
41
|
+
- Remove deprecated #instance_eval calling when block was given with Magick::ImageList#montage, Magick::Image::Info.new and more (#1362)
|
42
|
+
- Remove deprecated RMagick.rb file (#1361)
|
43
|
+
- Remove deprecated Magick.trace_proc= (#1351)
|
44
|
+
- Remove deprecated Magick::{Image, Image::Info}#monitor= (#1356)
|
45
|
+
|
46
|
+
## RMagick 4.3.0
|
47
|
+
|
48
|
+
Deprecates
|
49
|
+
|
50
|
+
- Mark Magick.trace_proc= as deprecated (#1354)
|
51
|
+
- Mark Magick::{Image, Image::Info}#monitor= as deprecated (#1353)
|
52
|
+
|
53
|
+
These methods will be removed in RMagick 5.0 and no alternative.
|
54
|
+
|
55
|
+
## RMagick 4.2.6
|
56
|
+
|
57
|
+
Improvements
|
58
|
+
|
59
|
+
- Remove test_files to reduce gem package size (#1338)
|
60
|
+
|
61
|
+
Bug Fixes
|
62
|
+
|
63
|
+
- Guard against an empty rpath (#1333)
|
64
|
+
- Call GetImageDistortion instead of IsImagesEqual to fix the issue reported in #1342 (#1343)
|
65
|
+
|
66
|
+
## RMagick 4.2.5
|
67
|
+
|
68
|
+
Bug Fixes
|
69
|
+
|
70
|
+
- Specify rpath linker option to fix dynamic lib lookup failure on Linux (#1325)
|
71
|
+
- Fix Image#profile! that can't delete exif data (#1326)
|
72
|
+
|
73
|
+
## RMagick 4.2.4
|
74
|
+
|
75
|
+
Improvements
|
76
|
+
|
77
|
+
- spec_helper: drop require_relative to lib directory (#1306)
|
78
|
+
- Fix build error with Ruby 3.1 on macOS (#1313)
|
79
|
+
|
80
|
+
Bug Fixes
|
81
|
+
|
82
|
+
- remove Mutex in trace_proc= (#1303)
|
83
|
+
- channel_mean_spec: fix floating point comparison (#1307)
|
84
|
+
- changed_predicate_spec: ensure target directory exists (#1305)
|
85
|
+
- Doc: Fix documentation of Magick::Image#crop (#1311)
|
86
|
+
- Magick::UndefinedKernel should also not be used when creating a new KernelInfo. (#1312)
|
87
|
+
|
88
|
+
## RMagick 4.2.3
|
89
|
+
|
90
|
+
Bug Fixes
|
91
|
+
|
92
|
+
- Re-add block syntax deprecation warning and fix in RMagick source (#1279) (#1280)
|
93
|
+
- Doc: Replace Magick::Montage with Magick::ImageList::Montage (#1281)
|
94
|
+
- Update shadow example (#1297)
|
95
|
+
- Escape the backslashes in windows error message (#1298)
|
96
|
+
- Also set the alpha value of the target pixel (#1299)
|
97
|
+
- Set alpha_trait to BlendPixelTrait when the alpha value of the pixel is not opaque. (#1300)
|
98
|
+
|
6
99
|
## RMagick 4.2.2
|
7
100
|
|
8
101
|
Bug Fixes:
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
RMagick
|
2
2
|
=======
|
3
3
|
|
4
|
-
[](https://app.codacy.com/gh/rmagick/rmagick?utm_source=github.com&utm_medium=referral&utm_content=rmagick/rmagick&utm_campaign=Badge_Grade_Settings)
|
5
4
|
[](https://rubygems.org/gems/rmagick)
|
6
5
|

|
7
6
|
|
@@ -71,33 +70,33 @@ sudo yum install gcc ImageMagick-devel make which
|
|
71
70
|
On Arch Linux, you can run:
|
72
71
|
|
73
72
|
```sh
|
74
|
-
pacman -Syy
|
73
|
+
pacman -Syy imagemagick
|
75
74
|
```
|
76
75
|
|
77
76
|
#### Alpine Linux
|
78
77
|
On Alpine Linux, you can run:
|
79
78
|
|
80
79
|
```
|
81
|
-
apk add
|
80
|
+
apk add imagemagick imagemagick-dev imagemagick-libs
|
82
81
|
```
|
83
82
|
|
84
83
|
or you can run if you would like to use ImageMagick 6:
|
85
84
|
|
86
85
|
```
|
87
|
-
apk add
|
86
|
+
apk add imagemagick6 imagemagick6-dev imagemagick6-libs
|
88
87
|
```
|
89
88
|
|
90
89
|
### macOS
|
91
90
|
On macOS, you can run:
|
92
91
|
|
93
92
|
```sh
|
94
|
-
brew install
|
93
|
+
brew install imagemagick
|
95
94
|
```
|
96
95
|
|
97
96
|
or you can run if you would like to use ImageMagick 6:
|
98
97
|
|
99
98
|
```sh
|
100
|
-
brew install
|
99
|
+
brew install imagemagick@6
|
101
100
|
```
|
102
101
|
|
103
102
|
### Windows
|
@@ -105,7 +104,7 @@ brew install pkg-config imagemagick@6
|
|
105
104
|
2. You might need to configure `PATH` environment variable to where the compiler is located.
|
106
105
|
(Ex: `set PATH=C:\Ruby27-x64\msys64\usr\bin;C:\Ruby27-x64\msys64\mingw64\bin;%PATH%`)
|
107
106
|
3. Download `ImageMagick-7.XXXX-Q16-x64-dll.exe` (not, `ImageMagick-7.XXXX-Q16-x64-static.exe`) binary from [Windows Binary Release](https://imagemagick.org/script/download.php#windows), or you can download ImageMagick 6 from [Windows Binary Release](https://legacy.imagemagick.org/script/download.php#windows).
|
108
|
-
4. Install ImageMagick. You need to turn on checkboxes `Add application directory to your system path` and `Install development headers and
|
107
|
+
4. Install ImageMagick. You need to turn on checkboxes `Add application directory to your system path` and `Install development headers and libraries for C and C++` in an installer for RMagick.
|
109
108
|
<img width="50%" src="https://user-images.githubusercontent.com/199156/77183472-b72cbd00-6b11-11ea-8b9a-247bc1f9d8b1.png" />
|
110
109
|
|
111
110
|
Installing RMagick
|
@@ -164,15 +163,6 @@ subdirectory of the installation directory for any error messages. These
|
|
164
163
|
messages typically contain enough additional information for you to be able to
|
165
164
|
diagnose the problem. Also see [this FAQ][libmagick-faq].
|
166
165
|
|
167
|
-
On OS X with Homebrew, try (re)installing pkg-config:
|
168
|
-
|
169
|
-
```sh
|
170
|
-
brew uninstall pkg-config
|
171
|
-
brew install pkg-config
|
172
|
-
brew unlink pkg-config
|
173
|
-
brew link pkg-config
|
174
|
-
```
|
175
|
-
|
176
166
|
### Cannot open shared object file
|
177
167
|
|
178
168
|
If you get a message like this:
|
@@ -197,6 +187,8 @@ export LD_LIBRARY_PATH=/usr/local/lib
|
|
197
187
|
On Linux, see `ld(1)` and `ld.so(8)` for more information. On other operating
|
198
188
|
systems, see the documentation for the dynamic loading facility.
|
199
189
|
|
190
|
+
This operation might not be required when you can use 4.2.5 or later.
|
191
|
+
|
200
192
|
### Segmentation fault
|
201
193
|
|
202
194
|
Default stack size of your operating system might be too small. Try removing
|
data/Rakefile
CHANGED
@@ -63,26 +63,13 @@ end
|
|
63
63
|
desc 'Release'
|
64
64
|
task release: %i[assert_clean_repo push_and_tag]
|
65
65
|
|
66
|
-
|
67
|
-
|
66
|
+
namespace :website do
|
67
|
+
PATH_TO_LOCAL_WEBSITE_REPOSITORY = File.expand_path('../rmagick.github.io')
|
68
68
|
|
69
|
-
|
70
|
-
require 'find'
|
71
|
-
|
72
|
-
task :redcloth do
|
73
|
-
require 'redcloth'
|
74
|
-
end
|
75
|
-
|
76
|
-
README = 'README.html'
|
77
|
-
MANIFEST = 'ext/RMagick/MANIFEST'
|
78
|
-
|
79
|
-
# Change the version number placeholders in a file.
|
80
|
-
# Returns an array of lines from the file.
|
81
|
-
def reversion(name)
|
69
|
+
def replace_reversion(lines)
|
82
70
|
now = Time.new
|
83
71
|
now = now.strftime('%m/%d/%y')
|
84
72
|
|
85
|
-
lines = File.readlines name
|
86
73
|
lines.each do |line|
|
87
74
|
line.gsub!(/0\.0\.0/, Magick::VERSION)
|
88
75
|
line.gsub!(%r{YY/MM/DD}, now)
|
@@ -90,83 +77,68 @@ namespace :legacy do
|
|
90
77
|
lines
|
91
78
|
end
|
92
79
|
|
93
|
-
|
94
|
-
|
95
|
-
lines =
|
96
|
-
|
97
|
-
mv name, tmp_name
|
98
|
-
begin
|
99
|
-
File.open(name, 'w') { |f| lines.each { |line| f.write line } }
|
100
|
-
rescue StandardError
|
101
|
-
mv tmp_name, name
|
102
|
-
ensure
|
103
|
-
rm tmp_name
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
desc 'Update version in extconf'
|
108
|
-
task :extconf do
|
109
|
-
reversion_file 'ext/RMagick/extconf.rb'
|
110
|
-
end
|
111
|
-
|
112
|
-
desc 'Build README.txt from README.textile using RedCloth'
|
113
|
-
task 'README.txt' => [:redcloth] do
|
114
|
-
reversion_file 'README.textile'
|
115
|
-
body = File.readlines 'README.textile'
|
116
|
-
body = RedCloth.new(body.join).to_html + "\n"
|
117
|
-
File.open('README.txt', 'w') { |f| f.write body }
|
80
|
+
def update_html(input_dir, output_dir, file_name)
|
81
|
+
lines = File.readlines(File.join(input_dir, file_name))
|
82
|
+
lines = replace_reversion(lines)
|
83
|
+
File.open(File.join(output_dir, file_name), 'w') { |f| lines.each { |line| f.write line } }
|
118
84
|
end
|
119
85
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
86
|
+
ENTITY = {
|
87
|
+
'&' => '&',
|
88
|
+
'>' => '>',
|
89
|
+
'<' => '<'
|
90
|
+
}.freeze
|
91
|
+
|
92
|
+
def file_to_html(input_dir, input_file_name, output_dir, output_file_name)
|
93
|
+
File.open(File.join(input_dir, input_file_name)) do |src|
|
94
|
+
File.open(File.join(output_dir, output_file_name), 'w') do |dest|
|
95
|
+
dest.puts <<~END_EXHTMLHEAD
|
96
|
+
<!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">
|
127
98
|
<head>
|
128
|
-
<
|
129
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
130
|
-
<
|
99
|
+
<meta name="generator" content="ex2html.rb" />
|
100
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
101
|
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
102
|
+
<title>RMagick example: #{input_file_name}</title>
|
131
103
|
</head>
|
132
104
|
<body>
|
133
|
-
|
134
|
-
|
135
|
-
|
105
|
+
<h1>#{input_file_name}</h1>
|
106
|
+
<div class="bodybox">
|
107
|
+
<div class="bodyfloat">
|
108
|
+
<pre>
|
109
|
+
END_EXHTMLHEAD
|
110
|
+
|
111
|
+
src.each do |line|
|
112
|
+
line.gsub!(/[&><]/) { |s| ENTITY[s] }
|
113
|
+
dest.puts(line)
|
114
|
+
end
|
115
|
+
|
116
|
+
dest.puts <<~END_EXHTMLTAIL
|
117
|
+
</pre>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<div id="close"><a href="javascript:window.close();">Close window</a></div>
|
136
121
|
</body>
|
137
|
-
|
138
|
-
|
122
|
+
</html>
|
123
|
+
END_EXHTMLTAIL
|
124
|
+
end
|
139
125
|
end
|
140
126
|
end
|
141
127
|
|
142
|
-
desc 'Update
|
143
|
-
task :
|
144
|
-
|
145
|
-
|
128
|
+
desc 'Update RMagick website'
|
129
|
+
task :update do
|
130
|
+
unless File.exist?(PATH_TO_LOCAL_WEBSITE_REPOSITORY)
|
131
|
+
puts "Please clone the rmagick.github.io repository to #{PATH_TO_LOCAL_WEBSITE_REPOSITORY}"
|
132
|
+
exit 1
|
146
133
|
end
|
147
|
-
end
|
148
|
-
|
149
|
-
# Remove files we don't want in the tarball.
|
150
|
-
# Ensure files are not executable. (ref: bug #10080)
|
151
|
-
desc "Remove files we don't want in the .gem; ensure files are not executable"
|
152
|
-
task :fix_files do
|
153
|
-
rm 'README.txt', verbose: true
|
154
|
-
chmod 0o644, FileList['doc/*.html', 'doc/ex/*.rb', 'doc/ex/images/*', 'examples/*.rb']
|
155
|
-
end
|
156
134
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
now = now.strftime('%H:%M:%S %m/%d/%y')
|
161
|
-
puts "generating #{MANIFEST}"
|
162
|
-
|
163
|
-
File.open(MANIFEST, 'w') do |f|
|
164
|
-
f.puts "MANIFEST for #{Magick::VERSION} - #{now}\n\n"
|
165
|
-
Find.find('.') do |name|
|
166
|
-
next if File.directory? name
|
135
|
+
Dir.glob('doc/*.html') do |file|
|
136
|
+
update_html('doc', PATH_TO_LOCAL_WEBSITE_REPOSITORY, File.basename(file))
|
137
|
+
end
|
167
138
|
|
168
|
-
|
169
|
-
|
139
|
+
Dir.glob('doc/ex/*.rb') do |file|
|
140
|
+
file_name = File.basename(file)
|
141
|
+
file_to_html('doc/ex', file_name, PATH_TO_LOCAL_WEBSITE_REPOSITORY, "#{file_name}.html")
|
170
142
|
end
|
171
143
|
end
|
172
144
|
end
|
data/before_install_linux.sh
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
set -euox pipefail
|
4
4
|
|
5
|
-
gem install bundler
|
5
|
+
gem install bundler -v 2.3.26 # Bundler 2.4.x has dropped support for Ruby 2.3
|
6
6
|
|
7
7
|
if [ -v STYLE_CHECKS ]; then
|
8
8
|
set +ux
|
@@ -24,7 +24,7 @@ sudo apt-get autoremove -y imagemagick* libmagick* --purge
|
|
24
24
|
# install build tools, ImageMagick delegates
|
25
25
|
sudo apt-get install -y build-essential libx11-dev libxext-dev zlib1g-dev \
|
26
26
|
liblcms2-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev \
|
27
|
-
libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript
|
27
|
+
libtiff5-dev libwebp-dev liblqr-1-0-dev vim gsfonts ghostscript
|
28
28
|
|
29
29
|
if [ ! -d /usr/include/freetype ]; then
|
30
30
|
# If `/usr/include/freetype` is not existed, ImageMagick 6.7 configuration fails about Freetype.
|
@@ -41,7 +41,7 @@ build_imagemagick() {
|
|
41
41
|
mkdir -p build-ImageMagick
|
42
42
|
|
43
43
|
version=(${IMAGEMAGICK_VERSION//./ })
|
44
|
-
wget "https://imagemagick.org/
|
44
|
+
wget "https://imagemagick.org/archive/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
|
45
45
|
tar -xf "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
|
46
46
|
rm "ImageMagick-${IMAGEMAGICK_VERSION}.tar.xz"
|
47
47
|
mv "ImageMagick-${IMAGEMAGICK_VERSION}" "${build_dir}"
|
@@ -52,7 +52,7 @@ build_imagemagick() {
|
|
52
52
|
fi
|
53
53
|
|
54
54
|
cd "${build_dir}"
|
55
|
-
|
55
|
+
./configure --prefix=/usr "${options}"
|
56
56
|
make -j
|
57
57
|
}
|
58
58
|
|