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/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
@ -77,6 +78,7 @@
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u* **/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x* **/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util **/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
**/vendor/bundle/ruby/*/gems/byebug-*/
# Ignore dependencies we don't wish to vendor # Ignore dependencies we don't wish to vendor
**/vendor/bundle/ruby/*/gems/ast-*/ **/vendor/bundle/ruby/*/gems/ast-*/

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

@ -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-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\.
. .