From dc08da22084dee5dc5d4d828d0c0e171ce0ec0c4 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 14 Mar 2024 20:33:19 -0700 Subject: [PATCH] switch approach again for console access to `site` and `collections` --- .../lib/bridgetown-core/commands/console.rb | 11 +++-------- bridgetown-website/Gemfile.lock | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/commands/console.rb b/bridgetown-core/lib/bridgetown-core/commands/console.rb index 544ae547b..9b1e43bca 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/console.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/console.rb @@ -92,14 +92,9 @@ def console # rubocop:disable Metrics IRB::ExtendCommandBundle.include ConsoleMethods IRB.setup(nil) - workspace = IRB::WorkSpace.new( - begin - site = Bridgetown::Current.site - collections = site.collections - - binding - end - ) + workspace = IRB::WorkSpace.new + workspace.main.define_singleton_method(:site) { Bridgetown::Current.site } + workspace.main.define_singleton_method(:collections) { site.collections } irb = IRB::Irb.new(workspace) IRB.conf[:IRB_RC]&.call(irb.context) IRB.conf[:MAIN_CONTEXT] = irb.context diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index 7d0766662..b6f13da14 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -25,7 +25,7 @@ PATH listen (~> 3.0) rake (>= 13.0) roda (~> 3.46) - rouge (~> 3.0) + rouge (>= 3.0, < 5.0) serbea (~> 1.0) thor (~> 1.1) tilt (~> 2.0)