Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true

require "bundler/setup"
require "tracer/irb"
require "tracer"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
10 changes: 9 additions & 1 deletion lib/tracer/irb.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
require_relative "../tracer"
require "irb/cmd/nop"
require "irb"

if Gem::Version.new(IRB::VERSION) < Gem::Version.new("1.6.0")
warn <<~MSG
Your version of IRB is too old so Tracer cannot register its commands.
Please upgrade IRB by adding `gem "irb", "~> 1.6.0"` to your Gemfile.
MSG

return
end

module Tracer
def self.register_irb_commands
ec = IRB::ExtendCommandBundle.instance_variable_get(:@EXTEND_COMMANDS)
Expand Down