Skip to content

Commit e24cafc

Browse files
committed
bin: Hotpatch octocatalog-diff to not crash on Ruby 3.1.2
Ref github/octocatalog-diff#261
1 parent 387789a commit e24cafc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

bin/octodiff-docker.sh

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apt-get update -qq && \
1010
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes apt-get install -y -qq git octocatalog-diff puppet-agent puppet-module-puppetlabs-sshkeys-core g10k > /dev/null && \
1111
\
1212
cd /infrastructure-puppet && \
13+
patch -u /usr/lib/ruby/vendor_ruby/octocatalog-diff/catalog-diff/filter/compilation_dir.rb bin/patches/octocatalogdiff_issue261_compilationdir.rb.patch &&
1314
git config --global --add safe.directory /infrastructure-puppet && \
1415
g10k -puppetfile -quiet && \
1516
echo && \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://github.com/github/octocatalog-diff/issues/261
2+
--- compilation_dir.rb 2024-03-30 18:11:27
3+
+++ compilation_dir_patched.rb 2024-03-30 18:12:04
4+
@@ -66,12 +66,12 @@
5+
value
6+
end
7+
8+
- def traverse(a)
9+
+ def traverse(a, &proc)
10+
case a
11+
when Array
12+
- a.map { |v| traverse(v, &Proc.new) }
13+
+ a.map { |v| traverse(v, &proc) }
14+
when Hash
15+
- traverse(a.values, &Proc.new)
16+
+ traverse(a.values, &proc)
17+
else
18+
yield a
19+
end

0 commit comments

Comments
 (0)