Merge pull request #7577 from vidusheeamoli/add-byebug

Set up Byebug debugger
This commit is contained in:
Mike McQuaid 2020-05-19 08:27:53 +01:00 committed by GitHub
commit 0e9897c86d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 1 deletions

2
.gitignore vendored
View File

@ -18,6 +18,7 @@
/Library/Homebrew/vendor/portable-ruby /Library/Homebrew/vendor/portable-ruby
/Library/Taps /Library/Taps
/Library/PinnedTaps /Library/PinnedTaps
/Library/Homebrew/.byebug_history
# Ignore Bundler files # Ignore Bundler files
**/.bundle/bin **/.bundle/bin
@ -131,6 +132,7 @@
**/vendor/bundle/ruby/*/gems/unf-*/ **/vendor/bundle/ruby/*/gems/unf-*/
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/ **/vendor/bundle/ruby/*/gems/unicode-display_width-*/
**/vendor/bundle/ruby/*/gems/webrobots-*/ **/vendor/bundle/ruby/*/gems/webrobots-*/
**/vendor/bundle/ruby/*/gems/byebug-*/
# Ignore `bin` contents (again). # Ignore `bin` contents (again).
/bin /bin

View File

@ -3,6 +3,7 @@
source "https://rubygems.org" source "https://rubygems.org"
# installed gems # installed gems
gem "byebug"
gem "coveralls", "~> 0.8", require: false gem "coveralls", "~> 0.8", require: false
gem "parallel_tests" gem "parallel_tests"
gem "ronn", require: false gem "ronn", require: false

View File

@ -8,6 +8,7 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2) zeitwerk (~> 2.2, >= 2.2.2)
ast (2.4.0) ast (2.4.0)
byebug (11.1.3)
concurrent-ruby (1.1.6) concurrent-ruby (1.1.6)
connection_pool (2.2.2) connection_pool (2.2.2)
coveralls (0.8.23) coveralls (0.8.23)
@ -119,6 +120,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
activesupport activesupport
byebug
concurrent-ruby concurrent-ruby
coveralls (~> 0.8) coveralls (~> 0.8)
mechanize mechanize

View File

@ -22,6 +22,8 @@ module Homebrew
switch "--online", switch "--online",
description: "Include tests that use the GitHub API and tests that use any of the taps for "\ description: "Include tests that use the GitHub API and tests that use any of the taps for "\
"official external commands." "official external commands."
switch "--byebug",
description: "Enable debugging using byebug."
flag "--only=", flag "--only=",
description: "Run only <test_script>`_spec.rb`. Appending `:`<line_number> will start at a "\ description: "Run only <test_script>`_spec.rb`. Appending `:`<line_number> will start at a "\
"specific line." "specific line."
@ -39,6 +41,8 @@ module Homebrew
Homebrew.install_bundler_gems! Homebrew.install_bundler_gems!
gem_user_dir = Gem.user_dir gem_user_dir = Gem.user_dir
require "byebug" if args.byebug?
HOMEBREW_LIBRARY_PATH.cd do HOMEBREW_LIBRARY_PATH.cd do
ENV.delete("HOMEBREW_COLOR") ENV.delete("HOMEBREW_COLOR")
ENV.delete("HOMEBREW_NO_COLOR") ENV.delete("HOMEBREW_NO_COLOR")

View File

@ -39,6 +39,7 @@ require "rspec/retry"
require "rubocop" require "rubocop"
require "rubocop/rspec/support" require "rubocop/rspec/support"
require "find" require "find"
require "byebug"
$LOAD_PATH.push(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/test/support/lib")) $LOAD_PATH.push(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/test/support/lib"))
@ -177,7 +178,7 @@ RSpec.configure do |config|
@__stdout = $stdout.clone @__stdout = $stdout.clone
@__stderr = $stderr.clone @__stderr = $stderr.clone
unless example.metadata.key?(:focus) || ENV.key?("VERBOSE_TESTS") if (example.metadata.keys & [:focus, :byebug]).empty? && !ENV.key?("VERBOSE_TESTS")
$stdout.reopen(File::NULL) $stdout.reopen(File::NULL)
$stderr.reopen(File::NULL) $stderr.reopen(File::NULL)
end end

View File

@ -65,3 +65,4 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.83.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.5.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.5.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.39.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.39.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/byebug-11.1.3/lib"

View File

@ -1015,6 +1015,8 @@ Run Homebrew's unit and integration tests.
Do not load the compatibility layer when running tests. Do not load the compatibility layer when running tests.
* `--online`: * `--online`:
Include tests that use the GitHub API and tests that use any of the taps for official external commands. Include tests that use the GitHub API and tests that use any of the taps for official external commands.
* `--byebug`:
Enable debugging using byebug.
* `--only`: * `--only`:
Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line. Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line.
* `--seed`: * `--seed`:

View File

@ -1307,6 +1307,10 @@ Do not load the compatibility layer when running tests\.
Include tests that use the GitHub API and tests that use any of the taps for official external commands\. Include tests that use the GitHub API and tests that use any of the taps for official external commands\.
. .
.TP .TP
\fB\-\-byebug\fR
Enable debugging using byebug\.
.
.TP
\fB\-\-only\fR \fB\-\-only\fR
Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\. Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\.
. .