set up byebug debugger

This commit is contained in:
vidusheeamoli 2020-05-18 16:28:43 +05:30
parent 95a8217223
commit 4f1e9f44a1
8 changed files with 18 additions and 1 deletions

2
.gitignore vendored
View File

@ -18,6 +18,7 @@
/Library/Homebrew/vendor/portable-ruby
/Library/Taps
/Library/PinnedTaps
/Library/Homebrew/.byebug_history
# Ignore Bundler files
**/.bundle/bin
@ -77,6 +78,7 @@
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
**/vendor/bundle/ruby/*/gems/byebug-*/
# Ignore dependencies we don't wish to vendor
**/vendor/bundle/ruby/*/gems/ast-*/

View File

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

View File

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

View File

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

View File

@ -39,6 +39,7 @@ require "rspec/retry"
require "rubocop"
require "rubocop/rspec/support"
require "find"
require "byebug"
$LOAD_PATH.push(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/test/support/lib"))
@ -177,7 +178,7 @@ RSpec.configure do |config|
@__stdout = $stdout.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)
$stderr.reopen(File::NULL)
end

View File

@ -67,3 +67,4 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.82.0/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/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.
* `--online`:
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`:
Run only *`test_script`*`_spec.rb`. Appending `:`*`line_number`* will start at a specific line.
* `--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\.
.
.TP
\fB\-\-byebug\fR
Enable debugging using byebug\.
.
.TP
\fB\-\-only\fR
Run only \fItest_script\fR\fB_spec\.rb\fR\. Appending \fB:\fR\fIline_number\fR will start at a specific line\.
.