sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit b33d8c32d00499b6203a889506378b9cd799252a
parent e07b9b5f738dfa2aa12e5faca7853dd831f20bb0
Author: Dan Callaghan <djc@djc.id.au>
Date:   Mon, 18 Apr 2022 14:00:45 +1000

use xapian-ruby 1.2.2 on Ruby 2.0

Newer xapian-ruby requires Ruby 2.1+. The older one still works fine on
Ruby 2.0.

Diffstat:
M Gemfile | 6 +++++-
M ext/mkrf_conf_xapian.rb | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Gemfile b/Gemfile
@@ -2,7 +2,11 @@ source 'https://rubygems.org/'
 
 if !RbConfig::CONFIG['arch'].include?('openbsd')
   # update version in ext/mkrf_conf_xapian.rb as well.
-  gem 'xapian-ruby', '~> 1.2'
+  if /^2\.0\./ =~ RUBY_VERSION
+    gem 'xapian-ruby', ['~> 1.2', '< 1.3.6']
+  else
+    gem 'xapian-ruby', '~> 1.2'
+  end
 end
 
 gemspec
diff --git a/ext/mkrf_conf_xapian.rb b/ext/mkrf_conf_xapian.rb
@@ -17,7 +17,12 @@ begin
   if !RbConfig::CONFIG['arch'].include?('openbsd')
     # update version in Gemfile as well
     name    = "xapian-ruby"
-    version = "~> 1.2"
+    version =
+      if /^2\.0\./ =~ RUBY_VERSION
+        ["~> 1.2", "< 1.3.6"]
+      else
+        "~> 1.2"
+      end
 
     begin
       # try to load gem