Skip to content

Conversation

@joshuay03
Copy link
Contributor

Motivation / Background

Addresses ruby/debug#1098 (comment)

Detail

ruby/debug#1140 introduced a new no_repeat config option (see ruby/debug#1098 for context) which is included in the latest release. debug isn't pinned to a specific version in the generated Gemfile, so we can start using this in new apps.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Jun 20, 2025
@joshuay03
Copy link
Contributor Author

Hmm, I tested this out with a new app and it worked as expected, but CI disagrees.

@joshuay03 joshuay03 force-pushed the app-generator-enable-debug-no-repeat branch 9 times, most recently from f288d92 to e550270 Compare June 20, 2025 08:29
@joshuay03 joshuay03 moved this to In Progress / Pending Review in Open Source Jun 20, 2025
@joshuay03 joshuay03 force-pushed the app-generator-enable-debug-no-repeat branch 2 times, most recently from d687f3e to c085ed8 Compare June 20, 2025 08:36
sass-embedded (~> 1.63)
date (3.4.1)
debug (1.10.0)
debug (1.11.0)
Copy link
Contributor Author

@joshuay03 joshuay03 Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I tested this out with a new app and it worked as expected, but CI disagrees.

It seems some of the railties tests are picking up the framework Gemfile.lock, so we need to bump this to get CI green.

require "debug"

# See https://github.com/ruby/debug#configuration-list for more options.
DEBUGGER__::CONFIG[:no_repeat] = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the easiest way to configure debug without messing around with environment variables (ref: ruby/debug#1098).

@joshuay03 joshuay03 force-pushed the app-generator-enable-debug-no-repeat branch from c085ed8 to 5c04e4b Compare June 27, 2025 14:23
Comment on lines -17 to +18
# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only commented out gem in plugins, and it isn't commented out in apps, so I opted to un-comment it here rather than have a separate conditional initializer just for plugins that does something hacky like check if the gem is loaded first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants