Skip to content

Commit

Permalink
switch approach again for console access to site and collections
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Mar 15, 2024
1 parent c8ab4a1 commit dc08da2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions bridgetown-core/lib/bridgetown-core/commands/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-website/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dc08da2

Please sign in to comment.