From c1c85bc114f1d21713394f78e095f71f9b146831 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 2 Nov 2023 13:54:28 -0400 Subject: fixes for >= ruby-3.2 (nix ruby set ruby-3.3) --- flake.nix | 48 ++++++++++++++++++++++----------------------- lib/sisu/ao_misc_arrange.rb | 5 +++-- lib/sisu/ao_numbering.rb | 2 +- org/abstraction.org | 7 ++++--- org/config_nix.org | 2 +- shell.nix | 8 ++++---- 6 files changed, 37 insertions(+), 35 deletions(-) diff --git a/flake.nix b/flake.nix index dcae825e..5720103d 100644 --- a/flake.nix +++ b/flake.nix @@ -74,10 +74,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite jq git @@ -89,10 +89,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick zip @@ -122,10 +122,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick zip @@ -141,10 +141,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick zip @@ -167,10 +167,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick zip @@ -186,10 +186,10 @@ inherit shell; inherit devEnv; packages = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick perl538Packages.Po4a diff --git a/lib/sisu/ao_misc_arrange.rb b/lib/sisu/ao_misc_arrange.rb index 95ddf6a9..be0c18af 100644 --- a/lib/sisu/ao_misc_arrange.rb +++ b/lib/sisu/ao_misc_arrange.rb @@ -177,11 +177,12 @@ module SiSU_AO_MiscArrangeText else para end - para=if para =~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)\{|^\}(?:code|box|poem|alt|group|block|table)/m + para=if para.to_s =~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)\{|^\}(?:code|box|poem|alt|group|block|table)/m curly_braces(para) else para end + para.to_s end def prepare_text data=@data @@ -193,7 +194,7 @@ module SiSU_AO_MiscArrangeText data[0]=data[0].gsub(/^(SiSU\s*[\d.]*)$/,'% \1'). gsub(/^(sisu-[\d.]+)$/,'% \1') end - data.each.map do |para| + data=data.each.map do |para| para=conditional_headings(para) markup_blocks(para) end.flatten diff --git a/lib/sisu/ao_numbering.rb b/lib/sisu/ao_numbering.rb index 4b48bc39..3956fa4a 100644 --- a/lib/sisu/ao_numbering.rb +++ b/lib/sisu/ao_numbering.rb @@ -401,7 +401,7 @@ module SiSU_AO_Numbering when :extract then Mx[:segname_prefix_auto_num_extract] else '_'*dob.lv.to_i #should not occur end - if possible_seg_name =~/^[0-9]+?\.$/m #!~/[.,:-]+/ + if possible_seg_name.to_s =~/^[0-9]+?\.$/m #!~/[.,:-]+/ possible_seg_name=possible_seg_name. gsub(/\.$/,'') end diff --git a/org/abstraction.org b/org/abstraction.org index 477a5869..e5300c72 100644 --- a/org/abstraction.org +++ b/org/abstraction.org @@ -5730,11 +5730,12 @@ module SiSU_AO_MiscArrangeText else para end - para=if para =~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)\{|^\}(?:code|box|poem|alt|group|block|table)/m + para=if para.to_s =~/^(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)\{|^\}(?:code|box|poem|alt|group|block|table)/m curly_braces(para) else para end + para.to_s end def prepare_text data=@data @@ -5746,7 +5747,7 @@ module SiSU_AO_MiscArrangeText data[0]=data[0].gsub(/^(SiSU\s*[\d.]*)$/,'% \1'). gsub(/^(sisu-[\d.]+)$/,'% \1') end - data.each.map do |para| + data=data.each.map do |para| para=conditional_headings(para) markup_blocks(para) end.flatten @@ -6112,7 +6113,7 @@ module SiSU_AO_Numbering when :extract then Mx[:segname_prefix_auto_num_extract] else '_'*dob.lv.to_i #should not occur end - if possible_seg_name =~/^[0-9]+?\.$/m #!~/[.,:-]+/ + if possible_seg_name.to_s =~/^[0-9]+?\.$/m #!~/[.,:-]+/ possible_seg_name=possible_seg_name. gsub(/\.$/,'') end diff --git a/org/config_nix.org b/org/config_nix.org index 79e163cc..ca7bfc12 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -429,7 +429,7 @@ with pkgs; [ #+NAME: ruby_current #+BEGIN_SRC nix -<> +<> #+END_SRC *** ruby next diff --git a/shell.nix b/shell.nix index a22a36d4..ec794cda 100755 --- a/shell.nix +++ b/shell.nix @@ -4,10 +4,10 @@ with pkgs; mkShell { buildInputs = [ - ruby_3_1 - rubyPackages_3_1.rake - rubyPackages_3_1.sqlite3 - rubyPackages_3_1.thor + ruby_3_3 + rubyPackages_3_3.rake + rubyPackages_3_3.sqlite3 + rubyPackages_3_3.thor sqlite graphicsmagick unzip -- cgit v1.2.3