From 61cfa36dd802ec62928607575f8150483e507f53 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 21 Jan 2021 15:22:51 -0600 Subject: [PATCH] Add compatibility with zeitwerk Same fix as this one https://github.com/schneems/derailed_benchmarks/commit/88b33a0c9cdecc4b77c27d9f52aec39b5025a695 H/t to @engwan I'm honestly not 100% the full chain of events that cause this. Some other history is: - https://github.com/schneems/derailed_benchmarks/issues/128 @engwan do you know of a way I could make this fail in a similar way without Rails so I could add a test? --- CHANGELOG.md | 4 ++++ Gemfile.lock | 2 +- lib/dead_end/auto.rb | 2 ++ lib/dead_end/version.rb | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a1a662..8d5e574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## HEAD (unreleased) +## 1.1.3 + +- Add compatibility with zeitwerk (https://github.com/zombocom/dead_end/pull/52) + ## 1.1.2 - Namespace Kernel method aliases (https://github.com/zombocom/dead_end/pull/51) diff --git a/Gemfile.lock b/Gemfile.lock index a268c50..a90e68e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dead_end (1.1.2) + dead_end (1.1.3) GEM remote: https://rubygems.org/ diff --git a/lib/dead_end/auto.rb b/lib/dead_end/auto.rb index 8af8572..3e5dbd3 100644 --- a/lib/dead_end/auto.rb +++ b/lib/dead_end/auto.rb @@ -5,6 +5,8 @@ # Monkey patch kernel to ensure that all `require` calls call the same # method module Kernel + module_function + alias_method :dead_end_original_require, :require alias_method :dead_end_original_require_relative, :require_relative alias_method :dead_end_original_load, :load diff --git a/lib/dead_end/version.rb b/lib/dead_end/version.rb index 3fc9564..349bca7 100644 --- a/lib/dead_end/version.rb +++ b/lib/dead_end/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module DeadEnd - VERSION = "1.1.2" + VERSION = "1.1.3" end