From bbc4edf67e7a55dcad676f469667a2b2d4071f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 27 Oct 2023 14:40:28 +0000 Subject: [PATCH] Make sure this gem works without the Rails app being loaded --- Gemfile.lock | 1 + importmap-rails.gemspec | 1 + lib/importmap/reloader.rb | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 4d0408c..361b6a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,7 @@ PATH specs: importmap-rails (1.2.2) actionpack (>= 6.0.0) + activesupport (>= 6.0.0) railties (>= 6.0.0) GEM diff --git a/importmap-rails.gemspec b/importmap-rails.gemspec index 5f13a13..8e9f96c 100644 --- a/importmap-rails.gemspec +++ b/importmap-rails.gemspec @@ -16,5 +16,6 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.7.0" spec.add_dependency "railties", ">= 6.0.0" + spec.add_dependency "activesupport", ">= 6.0.0" spec.add_dependency "actionpack", ">= 6.0.0" end diff --git a/lib/importmap/reloader.rb b/lib/importmap/reloader.rb index af66b1e..daee235 100644 --- a/lib/importmap/reloader.rb +++ b/lib/importmap/reloader.rb @@ -1,3 +1,6 @@ +require "active_support" +require "active_support/core_ext/module/delegation" + class Importmap::Reloader delegate :execute_if_updated, :execute, :updated?, to: :updater