From e29e2b6bc87bd928eca1ca4149b93a27627a79e4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:09:46 +0000 Subject: [PATCH 1/4] update checkout to v4 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b93cfd..7846643 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -56,7 +56,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 From 257bcdba831fd0b166c728b5b76ef1cbc6ac81dd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:35:15 +0000 Subject: [PATCH 2/4] guard references --- lib/vips/image.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 8d35433..be85807 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -458,14 +458,14 @@ def self.new_from_source source, option_string, **opts loader = Vips.vips_foreign_find_load_source source raise Vips::Error if loader.nil? - image = Vips::Operation.call loader, [source], opts, option_string + result = Vips::Operation.call loader, [source], opts, option_string # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - image.references << source + result.references << source if result.is_a?(Vips::Image) - image + result end def self.matrix_from_array width, height, array From e1df3590fda47f7c59abbe78d5b913d85414c467 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:46:16 +0000 Subject: [PATCH 3/4] remove ruby2.0 support since something seems to have broken it --- .github/workflows/test.yml | 1 - lib/vips/image.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7846643..6eb76e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,6 @@ jobs: matrix: os-version: [ 'ubuntu-20.04' ] ruby-version: - - '2.0' - '2.1' - '2.2' - '2.3' diff --git a/lib/vips/image.rb b/lib/vips/image.rb index be85807..9aa581c 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -463,7 +463,7 @@ def self.new_from_source source, option_string, **opts # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - result.references << source if result.is_a?(Vips::Image) + result.references << source result end From b735f3e96136095868e78f8240d1e7dd1544f002 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 19 Feb 2024 14:50:38 +0000 Subject: [PATCH 4/4] lint --- lib/vips/image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vips/image.rb b/lib/vips/image.rb index 9aa581c..45bd2ed 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -463,7 +463,7 @@ def self.new_from_source source, option_string, **opts # keep a secret ref to the source object ... the libvips loader will # keep a ref to the C source object, but we need the ruby wrapper object # to stay alive too - result.references << source + result.references << source result end