diff --git a/rubygem-gem2rpm.changes b/rubygem-gem2rpm.changes index 8b1ac7b..c71d5fc 100644 --- a/rubygem-gem2rpm.changes +++ b/rubygem-gem2rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 8 10:52:39 UTC 2024 - Marcus Rueckert + +- update suse.patch: + handle ERB.new for older ruby versions + ------------------------------------------------------------------- Tue Oct 8 00:26:29 UTC 2024 - Marcus Rueckert diff --git a/suse.patch b/suse.patch index 3957761..67d4e58 100644 --- a/suse.patch +++ b/suse.patch @@ -184,7 +184,7 @@ index 0000000..2d4adf0 +# /bin/echo foo +# diff --git a/lib/gem2rpm.rb b/lib/gem2rpm.rb -index 017ecd1..349c897 100644 +index 017ecd1..3db6853 100644 --- a/lib/gem2rpm.rb +++ b/lib/gem2rpm.rb @@ -31,12 +31,15 @@ module Gem2Rpm @@ -205,15 +205,21 @@ index 017ecd1..349c897 100644 download_path = "" unless local begin -@@ -46,7 +49,7 @@ module Gem2Rpm +@@ -46,8 +49,12 @@ module Gem2Rpm $stderr.puts e.inspect end end - template = ERB.new(template, 0, '-') -+ template = ERB.new(template, trim_mode: '-') - out.puts template.result(binding) +- out.puts template.result(binding) ++ erb_instance = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6') ++ ERB.new(str=template, trim_mode: '-') ++ else ++ ERB.new(str=template, safe_mode=0, trim_mode='-') ++ end ++ out.puts erb_instance.result(binding) rescue Gem::Exception => e puts e + end diff --git a/lib/gem2rpm/specification.rb b/lib/gem2rpm/specification.rb index 9a8d5a1..2e4f7b2 100644 --- a/lib/gem2rpm/specification.rb