Skip to content

Commit

Permalink
🔨 DevEx
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Feb 24, 2025
1 parent f5d117c commit 665b594
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spec/config/byebug.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
if ENV.fetch("DEBUG", "false").casecmp("true") == 0
if VersionGem::Ruby.gte_minimum_version?("2.7")
require "debug"
else
ruby_version = Gem::Version.create(RUBY_VERSION)
if ruby_version < Gem::Version.create("2.7")
# Use byebug in code
puts "[DEBUG Ruby < 2.7] debug with byebug in code"
require "byebug"
else
# Use binding.break, binding.b, or debugger in code
puts "[DEBUG Ruby >= 2.7] debug with binding.break, binding.b, or debugger in code"
require "debug"
end
end

0 comments on commit 665b594

Please sign in to comment.