vips 8.10.5 → 8.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 791911df8d8ef4556cbf891fbb62f142cc13bfa062b6dc56de5a2fbc605b5af1
4
- data.tar.gz: 477e946c45322d528ff3e162f1bb0d12e2b8bb7774956a36fad2455281ddaf00
3
+ metadata.gz: 04f3fd36552bb4da990741e7ceabd7c3d45d1f9e46922cdc9395d4eef642ad03
4
+ data.tar.gz: 448cf9fa2b624c8867d030ed6403b5d4573671a260a2618cf7eed4bf62f1afa8
5
5
  SHA512:
6
- metadata.gz: be7311014c5f94c806ecfed73f99d09acd827439e91ae04803faa171510b725e6e097e5f2e3b5da5ffa72a469bac37d5bb56aa0add446329cd673c063fe802d7
7
- data.tar.gz: d8a1bf4e00c93f9efddab64b11d82e8e53c2b01eccad3f8c44ad699082d4c9bb721a916070a388f4a9263cace566ae1d7200d79227e64be0980643d5b4412038
6
+ metadata.gz: fc0f77d035c10ee9760c8c96e4dad26bf776d272e23360b24a4e15e0d6bcc5fdb26cda7e05900b7acd52ab62e602a6a3710be7b1b12b0de6cbcf1d96e88726bf
7
+ data.tar.gz: e88b05b9b2382d7ecc3ef061a3e96a4a35013e232da294d963b9765ebd0204598352dcda4a09b3f83bdc31538021be8506f17ac5af03f0aeec5ec7f39abdcb2a
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Questions or suggestions**
11
+
12
+ We are using [Discussions](https://github.com/libvips/ruby-vips/discussions) for questions and suggestions for new features. Issues are only for bug reports.
13
+
14
+ **Describe the bug**
15
+ A clear and concise description of what the bug is.
16
+
17
+ **To Reproduce**
18
+ Steps to reproduce the behavior:
19
+ 1. Go to '...'
20
+ 2. Click on '....'
21
+ 3. Scroll down to '....'
22
+ 4. See error
23
+
24
+ **Expected behavior**
25
+ A clear and concise description of what you expected to happen.
26
+
27
+ **Screenshots**
28
+ If applicable, add screenshots to help explain your problem.
29
+
30
+ **Desktop (please complete the following information):**
31
+ - OS: [e.g. iOS]
32
+ - Browser [e.g. chrome, safari]
33
+ - Version [e.g. 22]
34
+
35
+ **Smartphone (please complete the following information):**
36
+ - Device: [e.g. iPhone6]
37
+ - OS: [e.g. iOS8.1]
38
+ - Browser [e.g. stock browser, safari]
39
+ - Version [e.g. 22]
40
+
41
+ **Additional context**
42
+ Add any other context about the problem here.
@@ -0,0 +1,54 @@
1
+ name: Development
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ name: ${{matrix.ruby}} on ${{matrix.os}}
8
+ runs-on: ${{matrix.os}}-latest
9
+ continue-on-error: ${{matrix.experimental}}
10
+
11
+ strategy:
12
+ matrix:
13
+ os:
14
+ - ubuntu
15
+ # - macos
16
+
17
+ ruby:
18
+ - "2.6"
19
+ - "2.7"
20
+ - "3.0"
21
+ - "3.1"
22
+
23
+ experimental: [false]
24
+ env: [""]
25
+
26
+ include:
27
+ - os: ubuntu
28
+ ruby: truffleruby
29
+ experimental: true
30
+ - os: ubuntu
31
+ ruby: jruby
32
+ experimental: true
33
+ - os: ubuntu
34
+ ruby: head
35
+ experimental: true
36
+
37
+ steps:
38
+ - uses: actions/checkout@v2
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{matrix.ruby}}
42
+ bundler-cache: true
43
+
44
+ - name: Install libvips
45
+ env:
46
+ DEBIAN_FRONTEND: noninteractive
47
+ run: |
48
+ sudo apt-get update -qq -o Acquire::Retries=3
49
+ sudo apt-get install --fix-missing -qq -o Acquire::Retries=3 libvips
50
+ bundle exec rake ext
51
+
52
+ - name: Run tests
53
+ timeout-minutes: 5
54
+ run: ${{matrix.env}} bundle exec rake spec
data/.standard.yml ADDED
@@ -0,0 +1,17 @@
1
+ fix: false # default: false
2
+ parallel: true # default: false
3
+ format: progress # default: Standard::Formatter
4
+ ruby_version: 2.0 # default: RUBY_VERSION
5
+ default_ignores: false # default: true
6
+
7
+ ignore: # default: []
8
+ - '**/*':
9
+ - Standard/SemanticBlocks
10
+ - 'lib/vips/methods.rb'
11
+ - '{lib,example}/**/*':
12
+ - Lint/IneffectiveAccessModifier
13
+ - Lint/RescueException
14
+ - Style/GlobalVars
15
+ - 'spec/**/*':
16
+ - Lint/BinaryOperatorWithIdenticalOperands
17
+ - 'vendor/**/*'
data/.yardopts CHANGED
@@ -1,2 +1 @@
1
- --markup-provider=redcarpet
2
1
  --markup=markdown
data/CHANGELOG.md ADDED
@@ -0,0 +1,330 @@
1
+ # Changelog
2
+
3
+ ## master
4
+
5
+ * add `draw_point!` [jcupitt]
6
+ * add `Vips.tracked_*` for getting file and memory metrics [jeremy]
7
+ * add `Vips.cache_*` for getting cache settings [jeremy]
8
+ * add `Vips.vector?` to get/set SIMD status [jeremy]
9
+ * add `Vips.concurrency` to get/set threadpool size [jeremy]
10
+ * add `Vips.concurrency_default` to get the default threadpool size [jeremy]
11
+
12
+ ## Version 2.1.4 (2021-10-28)
13
+
14
+ * `write_to_buffer` tries to use the new target API, then falls back to the old
15
+ buffer system [jcupitt]
16
+ * don't generate yard docs for deprecated args [jcupitt]
17
+ * add hyperbolic trig functions [jcupitt]
18
+
19
+ ## Version 2.1.3 (2021-8-23)
20
+
21
+ * fix a gtype size error on win64 [danini-the-panini]
22
+
23
+ ## Version 2.1.2 (2021-5-3)
24
+
25
+ * allow `FFI::Pointer` as an argument to `new_from_memory` etc. [sled]
26
+
27
+ ## Version 2.1.1 (2021-5-3)
28
+
29
+ * fix "mutate" with libvips 8.9 [jcupitt]
30
+ * update autodocs for libvips 8.11 [jcupitt]
31
+
32
+ ## Version 2.1.0 (2021-3-8)
33
+
34
+ * add "mutate" system [jcupitt]
35
+ * better behaviour with some nil parameters [jcupitt]
36
+ * revise gemspec [jcupitt]
37
+ * allow symbols for Interpolate.new [noraj]
38
+ * update docs for 8.10, fix minor doc formatting issues [jcupitt]
39
+ * `new_from_array` checks array argument more carefully [dkam]
40
+ * add `new_from_memory` and `new_from_memory_copy` [ankane]
41
+ * jruby added to CI testing [pftg]
42
+ * switch to github actions for CI [pftg]
43
+ * remove rubocop, revise formatting for standardrb [pftg]
44
+
45
+ ## Version 2.0.17 (2019-10-29)
46
+
47
+ * install msys2 libvips on Windows [larskanis]
48
+ * better `-` to `_` conversion [Nakilon]
49
+ * fix `GValue#set` for stricter metadata rules in 8.9 [jcupitt]
50
+ * fix a ref leak on operation build error [jcupitt]
51
+ * faster operation call [jcupitt]
52
+ * add support for VipsConnection [jcupitt]
53
+ * add `signal_connect` [jcupitt]
54
+ * add `Image#set_kill` for progress termination [jcupitt]
55
+
56
+ ## Version 2.0.16 (2019-9-21)
57
+
58
+ * better library name generation [renchap]
59
+ * allow `_` as a separator in enum names [D-W-L]
60
+ * add `Vips::Region` and `Region#fetch` [jcupitt]
61
+
62
+ ## Version 2.0.15 (2019-6-12)
63
+
64
+ * better error messages from `write_to_memory` [linkyndy]
65
+ * fix doc generation typo for array return [jcupitt]
66
+ * update tests for libvips 8.8 [jcupitt]
67
+
68
+ ## Version 2.0.14 (2018-10-3)
69
+
70
+ * update links for new home [jcupitt]
71
+ * various doc fixes [janko-m]
72
+ * add `Vips::get_suffixes` [jcupitt]
73
+ * prefer options splat [ioquatix]
74
+ * update docs for 8.8 [jcupitt]
75
+
76
+ ## Version 2.0.13 (2018-8-6)
77
+
78
+ * allow optional args to have `nil` as a value [janko-m]
79
+ * fix five small memleaks [kleisauke]
80
+
81
+ ## Version 2.0.12 (2018-4-25)
82
+
83
+ * fix `Vips::Image#has_alpha?` with older libvips [larskanis]
84
+
85
+ ## Version 2.0.11 (2018-4-23)
86
+
87
+ * fix init with older glib [lsat12357]
88
+ * add `Vips::Image#has_alpha?` and `#add_alpha` [aried3r]
89
+
90
+ ## Version 2.0.10 (2017-12-21)
91
+
92
+ * add support for uint64 parameters
93
+ * add `draw_point` convenience method
94
+ * add docs for `CompassDirection` [janko-m]
95
+ * add `MAX_COORD` constant
96
+ * doc fixes [janko-m]
97
+ * remove duplicate function attach [janko-m]
98
+ * fix a crash with `new_from_buffer` with a UTF-8 string [janko-m]
99
+
100
+ ## Version 2.0.9 (2017-12-21)
101
+
102
+ * update docs for libvips 8.6
103
+
104
+ ## Version 2.0.8 (2017-09-14)
105
+
106
+ * add `thumb.rb` example, and verify we run stably and in constant memory
107
+ * cleanups and polish [Nakilon]
108
+ * add `composite` convenience method
109
+ * add `Vips::concurrency_set` and `Vips::vector_set`
110
+
111
+ ## Version 2.0.7 (2017-09-08)
112
+
113
+ * disable the logging for now, it could deadlock
114
+
115
+ ## Version 2.0.6 (2017-09-02)
116
+
117
+ * improve get() behaviour on error with older libvipses
118
+
119
+ ## Version 2.0.5 (2017-09-02)
120
+
121
+ * fix get() with older libvipses
122
+
123
+ ## Version 2.0.4 (2017-09-02)
124
+
125
+ * add a test for `get_fields`, since it appeared in libvips 8.5 (thanks zverok)
126
+
127
+ ## Version 2.0.3 (2017-09-02)
128
+
129
+ * add `get_fields`
130
+
131
+ ## Version 2.0.2 (2017-08-26)
132
+
133
+ * switch to `logger` for all logging output
134
+ * add libvips cache control functions `Vips::cache_set_max()` etc.
135
+ * fix a ref leak
136
+
137
+ ## Version 2.0.1 (2017-08-23)
138
+
139
+ * add support for `VipsRefStr` in gvalue, thanks tomasc
140
+
141
+ ## Version 2.0.0 (2017-08-22)
142
+
143
+ * rewrite on top of 'ffi' [John Cupitt, Kleis Auke Wolthuizen]
144
+
145
+ ## Version 1.0.6 (2017-07-17)
146
+
147
+ * remove lazy load, fixing a race with multi-threading [felixbuenemann]
148
+ * make `Image#to_a` much faster [John Cupitt]
149
+ * remove the `at_exit` handler [John Cupitt]
150
+
151
+ ## Version 1.0.5 (2017-04-29)
152
+
153
+ * fix `_const` for libvips 8.5 [John Cupitt]
154
+ * add `scaleimage`, the scale operation renamed to avoid a clash with the
155
+ `scale` property [John Cupitt]
156
+ * add `.new_from_image`: make a new image from a constant [John Cupitt]
157
+ * `bandjoin` will use `bandjoin_const`, if it can [John Cupitt]
158
+ * update generated docs for libvips 8.5 [John Cupitt]
159
+ * added docs for new libvips 8.5 enums [John Cupitt]
160
+
161
+ ## Version 1.0.4 (2017-02-07)
162
+
163
+ * remove stray comma from some docs lines [John Cupitt]
164
+ * update generated docs for libvips 8.5 [John Cupitt]
165
+ * small doc improvements [John Cupitt]
166
+ * update for gobject-introspection 3.1 [John Cupitt]
167
+ * support ruby 2.4 [John Cupitt]
168
+
169
+ ## Version 1.0.3 (2016-08-18)
170
+
171
+ * doc improvements [John Cupitt]
172
+ * add `Image#size` to get `[width, height]` [John Cupitt]
173
+ * only ask for ruby 2.0 to help OS X [John Cupitt]
174
+ * break up `Image.call` to make it easier to understand [John Cupitt]
175
+ * detect operation build fail correctly [John Cupitt]
176
+ * lock gobject-introspection at 3.0.8 to avoid breakage [John Cupitt]
177
+
178
+ ## Version 1.0.2 (2016-07-07)
179
+
180
+ * add `.yardopts` to fix ruby-gems docs [John Cupitt]
181
+
182
+ ## Version 1.0.1 (2016-07-07)
183
+
184
+ * simplify gemspec [sandstrom]
185
+ * remove jeweler dependency [John Cupitt]
186
+ * add `.to_a` to Image [John Cupitt]
187
+
188
+ ## Version 1.0.0 (2016-06-07)
189
+
190
+ * complete rewrite, API break [John Cupitt]
191
+
192
+ ## Version 0.3.14 (2016-01-25)
193
+
194
+ * more GC tuning [felixbuenemann]
195
+ * add `write.rb` example program [felixbuenemann]
196
+
197
+ ## Version 0.3.13 (2016-01-18)
198
+
199
+ * don't use generational GC options on old Rubys [John Cupitt]
200
+
201
+ ## Version 0.3.12 (2016-01-17)
202
+
203
+ * incremental GC every 10 writes [felixbuenemann]
204
+ * updated bundle [John Cupitt]
205
+
206
+ ## Version 0.3.11 (2015-10-15)
207
+
208
+ * added magick load from buffer [John Cupitt]
209
+
210
+ ## Version 0.3.10 (2015-06-24)
211
+
212
+ * added webp write [John Cupitt]
213
+
214
+ ## Version 0.3.9 (2014-07-17)
215
+
216
+ * removed a stray file from gemspec [Alessandro Tagliapietra]
217
+ * updated bundle [John Cupitt]
218
+ * revised spec tests [John Cupitt]
219
+ * fix a segv in im.label_regions [John Cupitt]
220
+ * add a Valgrind suppressions file [John Cupitt]
221
+ * fix .monotonic? [John Cupitt]
222
+ * fix .data on coded images [John Cupitt]
223
+ * add .size, see issue #58 [John Cupitt]
224
+ * add rdoc-data dep, maybe it will help ruby-gems docs [John Cupitt]
225
+
226
+ ## Version 0.3.8 (2014-05-11)
227
+
228
+ * add VIPS::thread_shutdown(), must be called on foreign thread exit [John Cupitt]
229
+
230
+ ## Version 0.3.7 (2014-02-04)
231
+
232
+ * update build dependencies [John Cupitt]
233
+ * README updated [John Cupitt]
234
+
235
+ ## Version 0.3.6 (2013-06-25)
236
+
237
+ * add png and jpg load from memory buffer [John Cupitt]
238
+ * README updated to include buffer read/write example [John Cupitt]
239
+ * better vips version testing [John Cupitt]
240
+ * spec tests for new buffer read/write code [John Cupitt]
241
+ * fix rdoc build to include C sources [John Cupitt]
242
+ * better compat with older libvips [John Cupitt]
243
+
244
+ ## Version 0.3.5 (2013-01-15)
245
+
246
+ * rb_raise() in mask.c no longer passes a string pointer as the fmt arg, stopping gcc bailing out on some platforms [John Cupitt]
247
+ * Image.magick() now calls im_magick2vips() directly rather than relying on libvips file type sniffing [John Cupitt]
248
+
249
+ ## Version 0.3.4 (2012-09-11)
250
+
251
+ * Update specs for lcms changes, thanks Stanislaw [John Cupitt]
252
+ * VIPS::Reader supports .exif() / .exif?() methods for better back compat, thanks Jeremy [John Cupitt]
253
+ * VIPS::Reader fallbacks load the image if its not been loaded [John Cupitt]
254
+ * VIPS::Reader no longer allows VIPS::Header methods [John Cupitt]
255
+
256
+ ## Version 0.3.3 (2012-08-31)
257
+
258
+ * Typo in workaround in 0.3.2 [John Cupitt]
259
+
260
+ ## Version 0.3.2 (2012-08-31)
261
+
262
+ ### Fixed
263
+
264
+ * Workaround helps ruby-vips compile (and run) against 7.26.3 [John Cupitt and
265
+ James Harrison]
266
+
267
+ ## Version 0.3.1 (2012-08-30)
268
+
269
+ ### Fixed
270
+
271
+ * PNG writer no longer changes the filename argument [John Cupitt]
272
+ * Workaround helps ruby-vips compile against 7.26.3 [John Cupitt]
273
+ * Image read now runs GC and retries on fail [John Cupitt]
274
+ * Image write GCs every 100 images [John Cupitt]
275
+
276
+ ## Version 0.3.0 (2012-07-20)
277
+
278
+ ### Added
279
+
280
+ * More rspec tests [John Cupitt]
281
+ * Updated to libvips-7.30 [John Cupitt]
282
+
283
+ ### Changed
284
+
285
+ * Reworked Reader class offers better performance and compatibility [John
286
+ Cupitt]
287
+ * Don't use :sequential option for older libvipses [John Cupitt]
288
+ * Rename "tone_analyze" as "tone_analyse" for consistency with the rest of
289
+ vips [John CUpitt]
290
+
291
+ ### Fixed
292
+
293
+ * Now passes rspec test suite cleanly in valgrind [John Cupitt]
294
+ * Fixed check of sequential mode support [Stanislaw Pankevich]
295
+
296
+ ## Version 0.2.0 (2012-06-29)
297
+
298
+ ### Added
299
+
300
+ * Add tile_cache [John Cupitt]
301
+ * Add :sequential option to tiff, jpeg and png readers [John Cupitt]
302
+ * Add raise if suitable pkg_config for libvips is not found, thanks to Pierre
303
+ Chapuis [Stanislaw Pankevich]
304
+ * Add backward compatibility of 0.1.x ruby-vips with libvips versions less than 7.28 [John Cupitt]
305
+ * Add Travis. ruby-vips now is being tested on travis-ci.org. [Stanislaw Pankevich]
306
+
307
+ ### Changed
308
+
309
+ * Disable the vips8 operation cache to save some memory [John Cupitt]
310
+ * Update example shrinker [John Cupitt]
311
+
312
+ ### Fixed
313
+
314
+ * #8: Memory allocation-free issues [Grigoriy Chudnov]
315
+
316
+ ## Version 0.1.1 (2012-06-22)
317
+
318
+ ### Changed
319
+
320
+ * Upgrade spec/* code to latest RSpec [Stanislaw Pankevich]
321
+
322
+ ### Added
323
+
324
+ * Added CHANGELOG.md file (thanks to jnicklas/capybara - using the layout of their History.txt) [Stanislaw Pankevich]
325
+ * Added Gemfile with the only 'rspec' dependency. [Stanislaw Pankevich]
326
+ * Added Jeweler Rakefile contents to release ruby-vips as a gem. [Stanislaw Pankevich]
327
+
328
+ ## Before (initial unreleased version 0.1.0)
329
+
330
+ Long-long history here undocumented...
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # all gems are handled by .gemspec (since this repo is for a gem)
4
4
  gemspec
5
+
6
+ group :maintenance, optional: true do
7
+ gem "bake"
8
+ gem "bake-gem"
9
+ end
10
+
11
+ gem "github-markup"
data/README.md CHANGED
@@ -1,24 +1,45 @@
1
1
  # Vips
2
2
 
3
- Programs that use `vips` don't manipulate images directly, instead they create pipelines of image processing operations building on a source image. When the end of the pipe is connected to a destination, the whole pipeline executes at once, streaming the image in parallel from source to destination a section at a time. Because `ruby-vips` is parallel, it's quick, and because it doesn't need to keep entire images in memory, it's light.
4
-
5
- This gem is a backwards compatible fork of `ruby-vips` but also includes (and compiles) the [libvips] source code.
3
+ [![Development](https://github.com/ioquatix/vips/workflows/Development/badge.svg)](https://github.com/libvips/ruby-vips/actions?query=workflow%3ATest)
4
+
5
+ This gem is a Ruby binding for the [libvips image processing
6
+ library](https://libvips.github.io/libvips). It has been tested on
7
+ Linux, macOS and Windows, and with ruby 2, ruby 3 and jruby. It uses
8
+ [ruby-ffi](https://github.com/ffi/ffi) to call functions in the libvips
9
+ library.
10
+
11
+ This fork is compatible witih `ruby-vips` but also includes (and compiles)
12
+ the [libvips] source code.
13
+
14
+ libvips is a [demand-driven, horizontally
15
+ threaded](https://github.com/libvips/libvips/wiki/Why-is-libvips-quick)
16
+ image processing library. Compared to similar
17
+ libraries, [libvips runs quickly and uses little
18
+ memory](https://github.com/libvips/libvips/wiki/Speed-and-memory-use).
19
+ libvips is licensed under the [LGPL
20
+ 2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html).
21
+
22
+ ## Install on linux and macOS
23
+
24
+ Install the libvips binary with your package manager (eg. `apt install
25
+ libvips42` or perhaps `brew install vips`, see the [libvips install
26
+ instructions](https://libvips.github.io/libvips/install.html)) then install
27
+ this gem with:
28
+
29
+ ``` shell
30
+ $ bundle add vips
31
+ ```
6
32
 
7
- [![Build Status](https://secure.travis-ci.org/ioquatix/vips.svg)](http://travis-ci.org/ioquatix/vips)
33
+ ## Install on Windows
8
34
 
9
- [libvips]: https://libvips.github.io/libvips
35
+ The gemspec will pull in the msys libvips for you.
10
36
 
11
- ## Installation
37
+ Tested with the ruby and msys from choco, but others may work.
12
38
 
13
- Add this line to your application's Gemfile:
39
+ ## Example
14
40
 
15
41
  ```ruby
16
- gem 'vips'
17
- ```
18
-
19
- And then execute:
20
-
21
- $ bundle
42
+ require "vips"
22
43
 
23
44
  Or install it yourself as:
24
45
 
@@ -40,7 +61,24 @@ Exactly the same way as [ruby-vips].
40
61
  4. Push to the branch (`git push origin my-new-feature`)
41
62
  5. Create new Pull Request
42
63
 
43
- ## License
64
+ ## Documentation
65
+
66
+ There are [full API docs for ruby-vips on
67
+ rubydoc](https://www.rubydoc.info/gems/ruby-vips). This sometimes has issues
68
+ updating, so we have a [copy on the gh-pages for this site as
69
+ well](http://libvips.github.io/ruby-vips), which
70
+ should always work.
71
+
72
+ See the `Vips` section in the docs for a [tutorial introduction with
73
+ examples](https://www.rubydoc.info/gems/ruby-vips/Vips).
74
+
75
+ The [libvips reference manual](https://libvips.github.io/libvips/API/current/)
76
+ has a complete explanation of every method.
77
+
78
+ The [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
79
+ directory has some simple example programs.
80
+
81
+ ## Benchmarks
44
82
 
45
83
  Released under the MIT license.
46
84
 
data/Rakefile CHANGED
@@ -1,28 +1,33 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
2
 
4
- RSpec::Core::RakeTask.new(:test)
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ warn e.message
7
+ warn "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
5
10
 
6
- task :default => :test
11
+ require "rake"
7
12
 
8
- task :ext do
9
- Dir.chdir "ext" do
10
- sh "rake"
11
- end
13
+ require "rspec/core"
14
+ require "rspec/core/rake_task"
15
+ RSpec::Core::RakeTask.new(:spec) do |spec|
16
+ spec.pattern = FileList["spec/**/*_spec.rb"]
12
17
  end
13
18
 
14
- task :console do
15
- require 'pry'
16
-
17
- require_relative 'lib/vips'
18
-
19
- Pry.start
19
+ task default: :spec
20
+
21
+ task :ext do
22
+ Dir.chdir "ext" do
23
+ sh "rake"
24
+ end
20
25
  end
21
26
 
22
- require "yard/rake/yardoc_task"
27
+ unless RUBY_PLATFORM.include?("java")
28
+ require "github/markup"
29
+ require "yard"
30
+ require "yard/rake/yardoc_task"
23
31
 
24
- YARD::Rake::YardocTask.new do |yard|
25
- require "yard"
26
- require "github/markup"
27
- require "redcarpet"
32
+ YARD::Rake::YardocTask.new
28
33
  end
data/TODO ADDED
@@ -0,0 +1,43 @@
1
+ # Notes
2
+
3
+ - We should support complex constants, eg:
4
+
5
+ Complex(1, 2)
6
+ => (1+2i)
7
+
8
+ # Common operations
9
+
10
+ - Lint.
11
+
12
+ bundle exec standardrb
13
+
14
+ - Reinstall local copy of gem after a change.
15
+
16
+ bundle exec rake install
17
+
18
+ - Run test suite.
19
+
20
+ bundle exec rake
21
+
22
+ - Version bump.
23
+
24
+ edit lib/vips/version.rb
25
+ edit VERSION
26
+
27
+ - Regenerate autodocs.
28
+
29
+ cd lib/vips
30
+ ruby > methods.rb
31
+ require "vips"; Vips::Yard.generate
32
+ ^D
33
+
34
+ - Regenerate docs.
35
+
36
+ bundle exec rake yard
37
+
38
+ - Push new gem to rubygems, tag repository with version.
39
+
40
+ bundle exec rake release
41
+
42
+ You'll be asked for a otp from authy / google authenticator / etc.
43
+
data/example/annotate.rb CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- require 'vips'
3
+ require "vips"
4
4
 
5
- im = Vips::Image.new_from_file ARGV[0], :access => :sequential
5
+ im = Vips::Image.new_from_file ARGV[0], access: :sequential
6
6
 
7
- left_text = Vips::Image.text "left corner", :dpi => 300
7
+ left_text = Vips::Image.text "left corner", dpi: 300
8
8
  left = left_text.embed 50, 50, im.width, 150
9
9
 
10
- right_text = Vips::Image.text "right corner", :dpi => 300
10
+ right_text = Vips::Image.text "right corner", dpi: 300
11
11
  right = right_text.embed im.width - right_text.width - 50, 50, im.width, 150
12
12
 
13
- footer = (left | right).ifthenelse(0, [255, 0, 0], :blend => true)
13
+ footer = (left | right).ifthenelse(0, [255, 0, 0], blend: true)
14
14
 
15
- im = im.insert footer, 0, im.height, :expand => true
15
+ im = im.insert footer, 0, im.height, expand: true
16
16
 
17
17
  im.write_to_file ARGV[1]