Giter Site home page Giter Site logo

nguyenquangminh0711 / ruby_jard Goto Github PK

View Code? Open in Web Editor NEW
847.0 15.0 28.0 18.14 MB

Just Another Ruby Debugger. Provide a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.

Home Page: https://rubyjard.org/

License: MIT License

Ruby 95.81% JavaScript 3.61% CSS 0.39% HTML 0.04% Roff 0.15%
ruby ruby-debugger debugger visual terminal console tty syntax-highlighting hacktoberfest

ruby_jard's Introduction

Gem GitHub Workflow Status (branch) GitHub stars From Vietnam with <3

Ruby Jard provides a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.

Please visit https://rubyjard.org/ for more information.

RubyJard Demo

(Click for demo video)

Note: Ruby Jard is still under heavy development. Bugs and weird behaviors are expected. If you see one, please don't hesitate to open an issue. I'll try my best to fix.

Install Ruby Jard

Bundler

Add one of those lines into your Gemfile. Note: Ruby Jard is discouraged to use on production environment.

gem 'ruby_jard', group: :development
❯ bundle install

If you would like to use Ruby Jard to debug a test, you can add to group test too.

gem 'ruby_jard', group: [:development, :test]

If you would like to use edged developing version of Ruby Jard:

gem 'ruby_jard', group: :development, git: 'https://github.com/nguyenquangminh0711/ruby_jard'

Ruby Gem

If you want to install Ruby Jard independently from bundler:

gem install ruby_jard

If you want to install a specific version published on Ruby gems:

gem install [email protected]

Run your program with Ruby Jard

How to run your program with Ruby Jard

To use Ruby Jard, you just need to put jard magic method before any places you want to stop. Jard supports stopping at anywhere, including top level binding, instance methods, class methods, string evaluation, or even inside a class declaration.

def test_method(input)
  a = 1
  b = 2
  jard # Debugger will stop here
  c = a + b + input
end

class TestClass
  jard # Yes, it can stop here too
  @dirty_class_method = 1 + 1

  def test_method
    jard
  end

  def self.test_class_method
    jard
  end
end

jard
test_method(5)

Afterward, run your program, just like normally. If your program meets jard execution break point, it gonna stop, show the UI, and let you debug.

In case you meet error undefined local variable or method jard, please require ruby_jard manually at initializing scripts. If you use Ruby Jard with famous frameworks, ruby_jard will be loaded by default

require 'ruby_jard'

Please visit https://rubyjard.org/ for more information.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nguyenquangminh0711/ruby_jard. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the RubyJard project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

ruby_jard's People

Contributors

camertron avatar dependabot[bot] avatar gregoryfm avatar hieuk09 avatar jonatas avatar nguyenquangminh0711 avatar qcam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby_jard's Issues

[BUG] Breaks when triggering a variable with long text

Describe the bug
Input is locked and jard can't be used after exploring a long value stored in a variable (when getting the interactive vi like scroll for long text)

To Reproduce
Steps to reproduce the behavior:

  1. Add jard on any place where you have a longer than terminal screen text (a long hash for example)
  2. Run jard and explore the variable contents
  3. When the output is returned the screen freezes and the input is broken (can't write anything except quit)

Expected behavior
Able to scroll the variable contents on the screen by pressing enter or quit the interactive scrolling using q

Screenshots
image

Environment (please complete the following information):

  • OS: Mac OS Catalina
  • Terminal Emulator iTerm 2
  • Output when you run tput colors in your terminal: 256
  • Output when you run echo $TERM in your terminal: xterm-256color
  • Output when you run stty:
speed 38400 baud;
lflags: echoe echok echoke echonl echoctl pendin
iflags: istrip -imaxbel iutf8 ignbrk
oflags: -oxtabs
cflags: cs8 -parenb

  • Do you use tmux/screen or similar tty multiplexer? no

undefined method `clear_screen' for #<IO:<STDOUT>>

Hey, just trying to kick the tires on jard and I got the error mentioned above. Using Ruby 2.6.3 and RVM. Here's the script:

#!/usr/bin/env ruby
require 'ruby_jard'


def sieve(n)

  primes = (0..n).to_a
  limit =  Math.sqrt(n)
  jard
  (2..limit).each do |i|
    (( i + i )..n).step(i) do |x|
      primes[x] = nil
    end
  end

  primes.compact
end

puts sieve(100).inspect

and the traceback:

Internal error from Jard. I'm sorry to mess up your debugging experience.
It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues

undefined method `clear_screen' for #<IO:<STDOUT>>
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/console.rb:44:in `clear_screen'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:199:in `clear_screen'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:113:in `rescue in update'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:112:in `update'
/Users/ggoodrich/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in `update'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:45:in `process_commands'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:37:in `block (2 levels) in process_commands_with_lock'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:56:in `block in lock'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `synchronize'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `lock'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:36:in `block in process_commands_with_lock'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/helpers/eval.rb:94:in `allowing_other_threads'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:35:in `process_commands_with_lock'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:21:in `at_line'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/context.rb:98:in `at_line'
primes.rb:10:in `sieve'
primes.rb:19:in `<main>'
-------------

Traceback (most recent call last):
	15: from primes.rb:19:in `<main>'
	14: from primes.rb:10:in `sieve'
	13: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/context.rb:98:in `at_line'
	12: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:21:in `at_line'
	11: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:35:in `process_commands_with_lock'
	10: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/helpers/eval.rb:94:in `allowing_other_threads'
	 9: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:36:in `block in process_commands_with_lock'
	 8: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `lock'
	 7: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `synchronize'
	 6: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:56:in `block in lock'
	 5: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:37:in `block (2 levels) in process_commands_with_lock'
	 4: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:45:in `process_commands'
	 3: from /Users/ggoodrich/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in `update'
	 2: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:106:in `update'
	 1: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:199:in `clear_screen'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/console.rb:44:in `clear_screen': undefined method `clear_screen' for #<IO:<STDOUT>> (NoMethodError)
	16: from primes.rb:19:in `<main>'
	15: from primes.rb:10:in `sieve'
	14: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/context.rb:98:in `at_line'
	13: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:21:in `at_line'
	12: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:35:in `process_commands_with_lock'
	11: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/byebug-11.1.3/lib/byebug/helpers/eval.rb:94:in `allowing_other_threads'
	10: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:36:in `block in process_commands_with_lock'
	 9: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `lock'
	 8: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:55:in `synchronize'
	 7: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/session.rb:56:in `block in lock'
	 6: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:37:in `block (2 levels) in process_commands_with_lock'
	 5: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/repl_processor.rb:45:in `process_commands'
	 4: from /Users/ggoodrich/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in `update'
	 3: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:112:in `update'
	 2: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:113:in `rescue in update'
	 1: from /Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/screen_manager.rb:199:in `clear_screen'
/Users/ggoodrich/.rvm/gems/ruby-2.6.3@jard/gems/ruby_jard-0.2.0/lib/ruby_jard/console.rb:44:in `clear_screen': undefined method `clear_screen' for #<IO:<STDOUT>> (NoMethodError)

Thanks.

[BUG] - No ERB support

Describe the bug
Adding Jard to an erb file does not pause at runtime

To Reproduce
Steps to reproduce the behavior:
1: Add jard to an erb file (Rails)

Expected behavior
Jard to stop execution at the point specified in the erb file

Actual behavior
Jard does not stop execution

[BUG] Source output incorrect

Describe the bug
Jard source output does not match what is the file.

To Reproduce
Steps to reproduce the behavior:

  1. Here's my file
    [jobs_controller.rb.txt] (https://github.com/nguyenquangminh0711/ruby_jard/files/5257455/jobs_controller.rb.txt)
    There's a comment in that file that explains things a bit more on line 68.
#snippet of actual file
      def index; end

      def create
        jard
        authorize Legacy::Job
        job = Legacy::Job.create!(legacy_user: current_user, legacy_collection: @collection,
                                  status: Legacy::Job.statuses[:pending], locations_file: params.fetch(:locations))
        import_job(job)
      rescue ActionController::ParameterMissing
        job&.destroy
  1. Run jard (in my case docker-compose exec rails bundle exec rspec
  2. Jard shows the file as with some output from a function at the bottom of the file:
    Screenshot from 2020-09-21 11-19-24

Expected behavior
Show the file correctly

Screenshots
works correctly on more narrow layout:
Screenshot from 2020-09-21 11-22-13

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 20, MacOS Big Suck, FreeBSD]
uname -a
Linux inni 5.8.10-arch1-1 #1 SMP PREEMPT Thu, 17 Sep 2020 18:01:06 +0000 x86_64 GNU/Linux
  • Terminal Emulator [e.g Alacritty, Terminal.app (Mac's default one), GNOME Terminal (Ubuntu's default one), etc.]
    terminator 1.92
  • Output when you run tput colors in your terminal
    8
  • Output when you run echo $TERM in your terminal
    screen
  • Output when you run stty

speed 38400 baud; line = 0;
-brkint -imaxbel

  • Do you use tmux/screen or similar tty multiplexer?
    yes but issue exists without it as well.

Thanks a lot for Jard. It's beautiful.

[BUG] Debugging console freezes when executing a Rails' association on a model instance

It freezes when trying to run an Activerecord association. For instance:

User has_many :journeys

I'm inside User.some_method:

def some_method
  jard
  journeys
end

Inside the method, when I run:

jard >> journeys

It just freezes and won't output the ActiveRecord::Associations::CollectionProxy instance.

This doesn't happen with gem 'byebug', where I'm able to see the result.

Thanks!

Support for JRuby

First, thank you for this tool. It's really sweet.

Are you planning to add support for JRuby at all, and if so do you need help in making that happen?

Error with Ruby 3.2, need pry > 0.14

When using ruby 3.2, an error occurred during Rails initialization : undefined method =~ for class Pry::Code (NameError)
Pry added support for Ruby 3.2 at v0.14.2, but ruby_jard depends on ~> 0.13.0

Can we bump pry version ?

[BUG] breaks with foreman and rails

Describe the bug
When I try to run with foreman, it errors out

To Reproduce
Steps to reproduce the behavior:

  1. put a jard breakpoint in a rails application
  2. start foreman
  3. see error

Expected behavior
The jard window to pop up somwhere

here's the stack trace in a gist

Environment (please complete the following information):

  • OS: MacOS
  • Terminal Emulator Terminal.app
  • Output when you run tput colors in your terminal
  • Output when you run echo $TERM in your terminal
  • Output when you run stty
  • tux

Error uninitialized constant #<Class:0x00007f96b6e8aa68>::Analyzable

Installing Jard for the first time and placing the jard command in my controller results in uninitialized constant #<Class:0x00007f96b6e8aa68>::Analyzable

ruby '2.7.3'
rails '6.1.3'

It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues

uninitialized constant #<Class:0x00007f96b6e8aa68>::Analyzable
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activestorage-6.1.3.1/app/models/active_storage/blob.rb:33:in `<class:Blob>'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activestorage-6.1.3.1/app/models/active_storage/blob.rb:32:in `<main>'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/elastic-apm-3.13.0/lib/elastic_apm/spies.rb:91:in `require'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:288:in `const_get'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:288:in `block in constantize'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `inject'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:284:in `constantize'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:330:in `safe_constantize'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/dependencies/zeitwerk_integration.rb:23:in `safe_constantize'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/inheritance.rb:230:in `block in compute_type'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/inheritance.rb:229:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/inheritance.rb:229:in `compute_type'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/reflection.rb:409:in `compute_class'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/reflection.rb:366:in `klass'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/association.rb:150:in `klass'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:159:in `block in grouped_records'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:157:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:157:in `grouped_records'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:143:in `preloaders_for_one'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:110:in `preloaders_on'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:123:in `block (3 levels) in preloaders_for_hash'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:122:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:122:in `flat_map'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:122:in `block (2 levels) in preloaders_for_hash'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:118:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:118:in `flat_map'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:118:in `block in preloaders_for_hash'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:117:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:117:in `flat_map'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:117:in `preloaders_for_hash'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:108:in `preloaders_on'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:94:in `block in preload'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:93:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:93:in `flat_map'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/associations/preloader.rb:93:in `preload'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:769:in `block in preload_associations'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:767:in `each'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:767:in `preload_associations'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:852:in `block in exec_queries'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:867:in `skip_query_cache_if_necessary'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:834:in `exec_queries'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:638:in `load'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/elasticsearch-model-6.1.1/lib/elasticsearch/model/adapters/active_record.rb:34:in `block (2 levels) in records'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation.rb:244:in `to_ary'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation/finder_methods.rb:532:in `find_take_with_limit'
....../.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.1.3.1/lib/active_record/relation/finder_methods.rb:98:in `take'
-------------
jard >>

[BUG] Internal error from jard - undefined method `shift` for nil

Describe the bug

Using jard and it printed this message in my console. Jard worked fine tough:

jard >> --- Error ---
rails     | Internal error from Jard. I'm sorry to mess up your debugging experience.
rails     | It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues
rails     |
rails     | undefined method `shift' for nil:NilClass
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/decorators/color_decorator.rb:46:in `decorate'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/row_renderer.rb:108:in `block in generate_bitmap'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/row_renderer.rb:96:in `each'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/row_renderer.rb:96:in `generate_bitmap'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/row_renderer.rb:40:in `render'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/screen_renderer.rb:146:in `row_content'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/screen_renderer.rb:105:in `block in find_seleted_window'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/screen_renderer.rb:104:in `each'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/screen_renderer.rb:104:in `each_with_index'
rails     | /Users/dev/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/screen_renderer.rb:104:in `find_seleted_window'
rails     | -------------

Environment (please complete the following information):

OS: MacOs Catalina 10.15.6
iTerm2 (tested with and without Overmind)
Output when you run tput colors in your terminal: 256
Output when you run echo $TERM in your terminal: xterm-256color
Output when you run stty:
speed 38400 baud;
lflags: echoe echok echoke echoctl pendin
iflags: iutf8
oflags: -oxtabs
cflags: cs8 -parenb
Do you use tmux/screen or similar tty multiplexer?: I use Overmind, but I tested with a vanilla rails s in a new tab and it happens just the same

[BUG] - Resizing terminal window breaks layout

Describe the bug
When resizing the terminal window the layout breaks

To Reproduce
Steps to reproduce the behavior:

  1. add jard toa. file
  2. resize terminal window

Expected behavior
Layout to adjust with the window

Screenshots
Screen Shot 2020-09-14 at 9 33 45 AM

dRB compatibility?

This looks amazing. Thank you for creating it! I run my projects with foreman, which means I have to use debuggers over dRB in order to have a REPL that functions properly. Is there a possibility of a dRB client coming for jard?

[BUG] - Ctl+d causes error

Describe the bug
Using ctrl-d (pry continue command) causes error

To Reproduce
Steps to reproduce the behavior:
1: add jard to a file
2: enter ctrl+d
Expected behavior
Program to continue

Screenshots

Control command is empty
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/control_flow.rb:33:in `validate!'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/control_flow.rb:28:in `initialize'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/control_flow.rb:53:in `new'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/control_flow.rb:53:in `dispatch'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/repl_proxy.rb:169:in `rescue in repl'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/repl_proxy.rb:166:in `repl'
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ruby_jard-0.3.0/lib/ruby_jard/repl_processor.rb:70:in `block in process_commands'

[BUG] Not compatible with Rails CurrentAttributes - attributes come back as nil

Describe the bug

When using jard to debug a Rails application which is using CurrentAttributes the attributes set on the Current object are coming back as nil. When doing the same debugging with pry the attributes on the Current object are set correctly.

To Reproduce

Here's a single file Rails application based on the Rails bug report template for controllers.

# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  gem "rails"

  #gem "ruby_jard"
  #gem "pry"
end

require "action_controller/railtie"

class TestApp < Rails::Application
  config.root = __dir__
  config.hosts << "example.org"
  secrets.secret_key_base = "secret_key_base"

  config.logger = Logger.new($stdout)
  Rails.logger  = config.logger

  routes.draw do
    get "/" => "test#index"
  end
end

class Current < ActiveSupport::CurrentAttributes
  attribute :request
end

class TestController < ActionController::Base
  include Rails.application.routes.url_helpers

  before_action do
    Current.request = request
  end

  def index
    render plain: "Home"
  end
end


require "minitest/autorun"
require "rack/test"

class BugTest < Minitest::Test
  include Rack::Test::Methods

  def test_returns_success
    get "/"

    #jard
    #binding.pry

    assert last_response.ok?
    assert Current.request.uuid.present?
  end

  private

  def app
    Rails.application
  end
end

If you run it as-is the tests should pass.

If you uncomment the Jard lines (lines 10 and 55) then run it again the jard debugger starts up. If you continue out of it the tests pass. But the bug is that on the Jard debugging REPL the Current attributes are nil.

jard >> Current.request.class
=> NilClass
jard >> Current.request.uuid
NoMethodError: undefined method `uuid' for nil:NilClass
from (pry):2:in `test_returns_success'

If you instead uncomment the pry lines (11 and 56) then the tests pass and the Current attributes are accessible through the debugging REPL.

[1] pry(#<BugTest>)> Current.request.class
=> ActionDispatch::Request
[2] pry(#<BugTest>)> Current.request.uuid
=> "2213791d-da75-438d-a1f5-1ab605201111"

Expected behavior

Jard's debugging REPL should behave the same as Pry's and have access to Current.request.

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Terminal Emulator: gnome-terminal
  • Output when you run tput colors in your terminal: 256
  • Output when you run echo $TERM in your terminal: xterm-256
  • Output when you run stty: speed 38400 baud; line = 0; -brkint -imaxbel iutf8
  • Do you use tmux/screen or similar tty multiplexer?: no

Also not on your list but I've tried this on Ruby 2.6.6 and 2.7.2, on Rails 6.0.3.4

Thanks ❤️ Jard looks incredible!

Anyone able to use this on Rails with Passenger?

Is your feature request related to a problem? Please describe.
I am just wondering if anyone was able to use this with on Rails with Passenger.

Because I am getting this error:

App 47027 output: Failed to attach. Jard could not detect a valid tty device.
App 47027 output: This bug occurs when the process Jard trying to access is a non-interactive environment  such as docker, daemon, sub-processes, etc.
App 47027 output: If you are confused, please submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues.

Describe the solution you'd like
Jard working on Rails with Passenger.

Describe alternatives you've considered

Additional context
This gem looks great. I was having issues trying to use it on Rails with Passenger. I am just wondering if anyone was able to do that.

[BUG]

Describe the bug
I'm getting error when try to get the response from nokogiri when I make a crawler in site (it works with byebug).

To Reproduce

  1. lesson_link = 'https://escuelasabatica.co/escuela-sabatica-cuarto-trimestre-2020-educacion-cristiana-introduccion/'
  2. lesson = Nokogiri::HTML(URI.open(lesson_link))
  3. lesson.search('.post_content')
  4. See error .rvm/gems/ruby-2.7.1/gems/ruby_jard-0.3.0/lib/ruby_jard/session.rb:69:in write': "\xC2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)`

Expected behavior
Retrieve the content of the object.

(byebug) lesson.search('.post_content')
[#<Nokogiri::XML::Element:0x3b9c name="div" attributes=[#<Nokogiri::XML::Attr:0x341c name="class" value="post_content">, #<Nokogiri::XML::Attr:0x3430 name="itemprop" value="articleBody">] children=[#<Nokogiri::XML::Text:0x3444 "\n">, #<Nokogiri::XML::Element:0x3480 name="style" attributes=[#<Nokogiri::XML::Attr:0x3458 name="type" value="text/css">] children=[#<Nokogiri::XML::CDATA:0x346c "\r\n\r\n.bssb-buttons {\r\ndisplay:inline-block;\r\nfloat:left;\r\npadding-bottom:7px;\r\n}\r\n\r\n.bssb-buttons > .facebook{\r\nfont-size: 13px;\r\nborder-radius: 3px;\r\nmargin-right: 6px;\r\nbackground: #2d5f9a;\r\nposition: relative;\r\ndisplay: inline-block;\r\ncursor: pointer;\r\nheight: 41px;\r\nwidth: 164px;\r\ncolor: #FFF;\r\nline-height:41px;\r\nbackground: url(https://escuelasabatica.co/wp-content/plugins/big-social-share-buttons/facebook.png) no-repeat 10px 12px #2D5F9A;\r\npadding-left: 35px;\r\nbox-shadow: 0px 4px 0px #A4A4A4, 0px 2px 0px rgba(0, 0, 0, 0.35);\r\n}\r\n\r\n.bssb-buttons > .twitter{\r\nfont-size: 13px;\r\nborder-radius: 3px;\r\nmargin-right: 6px;\r\nbackground: #00c3f3;\r\nposition: relative;\r\ndisplay: inline-block;\r\ncursor: pointer;\r\nheight: 41px;\r\nwidth: 165px;\r\ncolor: #FFF;\r\nline-height:41px;\r\nbackground: url(https://escuelasabatica.co/wp-content/plugins/big-social-share-buttons/twitter.png) no-repeat 10px 14px #00c3f3;\r\npadding-left:37px;\r\nbox-shadow: 0px 4px 0px #A4A4A4, 0px 2px 0px rgba(0, 0, 0, 0.35);\r\n}\r\n\r\n.bssb-buttons > .google {\r\nfont-size: 13px;\r\nborder-radius: 3px;\r\nmargin-right: 6px;\r\nbackground: #eb4026;\r\nposition: relative;\r\ndisplay: inline-block;\r\ncursor: pointer;\r\nheight: 41px;\r\nwidth: 165px;\r\ncolor: #FFF;\r\nline-height:41px;\r\nbackground: url(https://escuelasabatica.co/wp-content/plugins/big-social-share-buttons/google.png) no-repeat 10px 11px #eb4026;\r\npadding-left:37px;\r\nbox-shadow: 0px 4px 0px #A4A4A4, 0px 2px 0px rgba(0, 0, 0, 0.35);\r\n}\r\n\r\n\r\n ">]>,

Screenshots
Screenshot from 2020-09-20 11-34-21

Environment (please complete the following information):

  • OS: Ubuntu 20
  • Terminal: Terminator
  • tput colors: 256
  • echo $TERM: xterm-256color
  • stty: speed 38400 baud; line = 0; \n-brkint -imaxbel iutf8
  • Do you use tmux/screen or similar tty multiplexer? No

[BUG] Slows the the Rails server to a crawl after first use (30+ seconds page loads)

Describe the bug

First of all, this gem is awesome. However, I can only use it once, forcing me to restart the rails server afterwards.

The bug manifests itself like this: I use jard anywhere in my code, inspect what I wanted to expect, and then I type exit on it's console to finish execution. I then proceed to remove the jard line and go back to normal life.

However, Rails thens takes an unreasonable time to render the next page... what was a 500ms load in development becomes a Completed 200 OK in 27468ms (27 seconds) after using jard.

What is even weirder is that Chrome keeps spinning even after rails console stated that it had completed the request. It takes one extra minute to display the page in the browser.

To solve it, I need to restart my rails server.

Environment (please complete the following information):

  • OS: MacOs Catalina 10.15.6
  • iTerm2 (tested with and without Overmind)
  • Output when you run tput colors in your terminal: 256
  • Output when you run echo $TERM in your terminal: xterm-256color
  • Output when you run stty:
    speed 38400 baud;
    lflags: echoe echok echoke echoctl pendin
    iflags: iutf8
    oflags: -oxtabs
    cflags: cs8 -parenb
  • Do you use tmux/screen or similar tty multiplexer?: I use Overmind, but I tested with a vanilla rails s in a new tab and it happens just the same

Pager isn't working

When I view a variable in the REPL that doesn't fit on one screen it appears to display the attributes using less, and I have the : prompt at the bottom of the screen. But the less key bindings don't work. I've tried the vim style bindings, emacs style, typed space to page down, and typed q to exit the pager. All the keys are just echoed to the screen but they do not actually do anything. It appears they are simply not passed through to the pager. All I can do is ctl-c to exit jard and start over.

To Reproduce
Steps to reproduce the behavior:

  1. Debug a script with a variable with a lot of attributes
  2. View the variable in the REPL
  3. It appears to display the attributes in the pager, but you can't actually move around in the pager.

Expected behavior
Standard pager movement should work.

Environment (please complete the following information):

  • OS: MacOS 10.15.6 Catalina
  • ITerm2
  • Output when you run tput colors in your terminal => 256
  • Output when you run echo $TERM in your terminal => xterm-256color
  • Output when you run stty
speed 38400 baud;
lflags: echoe echok echoke echoctl pendin
iflags: -ixon iutf8
oflags: -oxtabs
cflags: cs8 -parenb
  • Do you use tmux/screen or similar tty multiplexer? => No

Keyword to output the underlying SQL query of Active Record relation to the console

Is your feature request related to a problem? Please describe.
I want to output the underlying SQL query of an Active Record relation in a Rails project. I want this output to be shown in the console.

Describe the solution you'd like
Have a keyword that has the ability to always output the underlying SQL query of an Active Record in full to the console for copying purposes. It should be executable in a database query program. This should work even if the records are in memory.

Describe alternatives you've considered
Variables section of the GUI. It shows the SQL query if the records are not in memory yet. However, it truncates the query. Also, once the records are in memory, the query is no longer shown. Moreover, if the list of variables is too long, some variables are not shown on screen.

[BUG] Control command is empty

Hello again @nguyenquangminh0711 and thank you for bringing this amazing tool open source ❤️

I was amazed by the debugging UI that you created and tried my first session in my personal project getting into some insights about recursive stack:

Screen Shot 2020-10-06 at 08 51 07

Describe the bug

Just following the instructions.

jard >>
--- Error ---
Internal error from Jard. I'm sorry to mess up your debugging experience.
It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues

To Reproduce

I was trying to use it with my gem ffast. Check my branch:

git clone  https://github.com/jonatas/fast.git
git co ruby-jard-debugging

Then bundle install then try to run fast directly from the command line provided with the gem:

bin/fast '(def :match? (args (arg node)) ...)' lib/fast.rb

When I try the first F7 it fails and breaks the process.

jard >>
--- Error ---
Internal error from Jard. I'm sorry to mess up your debugging experience.
It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues

Control command is empty
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:33:in `validate!'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:28:in `initialize'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:53:in `new'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:53:in `dispatch'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_proxy.rb:180:in `rescue in repl'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_proxy.rb:177:in `repl'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:71:in `block in process_commands'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:61:in `block in listen'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:60:in `catch'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/control_flow.rb:60:in `listen'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:70:in `process_commands'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:59:in `block (2 levels) in process_commands_with_lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/session.rb:171:in `block in lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/session.rb:170:in `synchronize'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/session.rb:170:in `lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:52:in `block in process_commands_with_lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/helpers/eval.rb:94:in `allowing_other_threads'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:51:in `process_commands_with_lock'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ruby_jard-0.3.1/lib/ruby_jard/repl_processor.rb:37:in `at_line'
/Users/jonatasdp/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/context.rb:98:in `at_line'
/Users/jonatasdp/code/fast/lib/fast.rb:420:in `match_recursive'
/Users/jonatasdp/code/fast/lib/fast.rb:428:in `block in match_recursive'
/Users/jonatasdp/code/fast/lib/fast.rb:425:in `each'
/Users/jonatasdp/code/fast/lib/fast.rb:425:in `each_with_index'
/Users/jonatasdp/code/fast/lib/fast.rb:425:in `each'
/Users/jonatasdp/code/fast/lib/fast.rb:425:in `all?'
/Users/jonatasdp/code/fast/lib/fast.rb:425:in `match_recursive'
/Users/jonatasdp/code/fast/lib/fast.rb:416:in `match?'
/Users/jonatasdp/code/fast/lib/fast.rb:720:in `block in match_tail?'
/Users/jonatasdp/code/fast/lib/fast.rb:718:in `each'
/Users/jonatasdp/code/fast/lib/fast.rb:718:in `each_with_index'
/Users/jonatasdp/code/fast/lib/fast.rb:718:in `each'
/Users/jonatasdp/code/fast/lib/fast.rb:718:in `all?'
/Users/jonatasdp/code/fast/lib/fast.rb:718:in `match_tail?'
/Users/jonatasdp/code/fast/lib/fast.rb:713:in `match?'
/Users/jonatasdp/code/fast/lib/fast.rb:164:in `match?'
/Users/jonatasdp/code/fast/lib/fast.rb:241:in `search'
/Users/jonatasdp/code/fast/lib/fast.rb:246:in `block in search'

[BUG] Error on app startup -1 out of range

Describe the bug
Stacktrace error as soon as application is starting,

Using the master branch, still having same issues.

To Reproduce
on startup

Screenshots
If applicable, add screenshots to help explain your problem.

--- Error ---
web_1 | 17:05:09 web.1 | Internal error from Jard. I'm sorry to mess up your debugging experience.
web_1 | 17:05:09 web.1 | It would be great if you can submit an issue in https://github.com/nguyenquangminh0711/ruby_jard/issues
web_1 | 17:05:09 web.1 |
web_1 | 17:05:09 web.1 | -2..-1 out of range
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:75:in []=' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:75:in render_span'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:33:in block (2 levels) in render' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:32:in each'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:32:in block in render' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:25:in each'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/row_renderer.rb:25:in render' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:146:in row_content'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:105:in block in find_seleted_window' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:104:in each'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:104:in each_with_index' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:104:in find_seleted_window'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:97:in calculate_window' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_renderer.rb:18:in render'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_manager.rb:172:in render_screen' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_manager.rb:147:in block in build_screens'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_manager.rb:143:in map' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_manager.rb:143:in build_screens'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/screen_manager.rb:85:in draw_screens' web_1 | 17:05:09 web.1 | /usr/local/lib/ruby/2.6.0/forwardable.rb:230:in draw_screens'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_processor.rb:66:in process_commands' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_processor.rb:59:in block (2 levels) in process_commands_with_lock'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/session.rb:163:in block in lock' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/session.rb:162:in synchronize'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/session.rb:162:in lock' web_1 | 17:05:09 web.1 | /usr/local/lib/ruby/2.6.0/forwardable.rb:230:in lock'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_processor.rb:52:in block in process_commands_with_lock' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/byebug-11.1.3/lib/byebug/helpers/eval.rb:94:in allowing_other_threads'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_processor.rb:51:in process_commands_with_lock' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_processor.rb:37:in at_line'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/byebug-11.1.3/lib/byebug/context.rb:98:in at_line' web_1 | 17:05:09 web.1 | /usr/src/app/app/controllers/employees_controller.rb:290:in leave'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/abstract_controller/base.rb:195:in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/rendering.rb:30:in process_action' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/abstract_controller/callbacks.rb:42:in block in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:112:in block in run_callbacks' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/sentry-raven-3.1.0/lib/raven/integrations/rails/controller_transaction.rb:7:in block in included'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in instance_exec' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in block in run_callbacks'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:139:in run_callbacks' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/abstract_controller/callbacks.rb:41:in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/rescue.rb:22:in process_action' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:33:in block in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/appsignal-2.11.0/lib/appsignal/hooks/active_support_notifications.rb:21:in block in instrument' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/notifications/instrumenter.rb:24:in instrument'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/appsignal-2.11.0/lib/appsignal/hooks/active_support_notifications.rb:35:in instrument' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/appsignal-2.11.0/lib/appsignal/hooks/active_support_notifications.rb:20:in instrument'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:32:in process_action' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal/params_wrapper.rb:245:in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/searchkick-4.4.1/lib/searchkick/logging.rb:212:in process_action' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activerecord-6.0.3.3/lib/active_record/railties/controller_runtime.rb:27:in process_action'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/abstract_controller/base.rb:136:in process' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionview-6.0.3.3/lib/action_view/rendering.rb:39:in process'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal.rb:190:in dispatch' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_controller/metal.rb:254:in dispatch'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:50:in dispatch' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:33:in serve'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:49:in block in serve' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:32:in each'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:32:in serve' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:834:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:192:in call!' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/bullet-6.1.0/lib/bullet/rack.rb:15:in call' web_1 | 17:05:09 web.1 | /usr/src/app/config/application.rb:46:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/remotipart-1.4.4/lib/remotipart/middleware.rb:32:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/warden-1.2.9/lib/warden/manager.rb:36:in block in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/warden-1.2.9/lib/warden/manager.rb:34:in catch' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/warden-1.2.9/lib/warden/manager.rb:34:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/etag.rb:27:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/head.rb:12:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/http/content_security_policy.rb:18:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in context'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/cookies.rb:648:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activerecord-6.0.3.3/lib/active_record/migration.rb:567:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/callbacks.rb:27:in block in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:101:in run_callbacks' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/callbacks.rb:26:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/executor.rb:14:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/appsignal-2.11.0/lib/appsignal/rack/rails_instrumentation.rb:32:in call_with_appsignal_monitoring' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/appsignal-2.11.0/lib/appsignal/rack/rails_instrumentation.rb:17:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/better_errors-2.8.1/lib/better_errors/middleware.rb:87:in protected_app_call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/better_errors-2.8.1/lib/better_errors/middleware.rb:82:in better_errors_call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/better_errors-2.8.1/lib/better_errors/middleware.rb:60:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/debug_exceptions.rb:32:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/web-console-4.0.4/lib/web_console/middleware.rb:132:in call_app' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/web-console-4.0.4/lib/web_console/middleware.rb:19:in block in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/web-console-4.0.4/lib/web_console/middleware.rb:17:in catch' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/railties-6.0.3.3/lib/rails/rack/logger.rb:37:in call_app' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/railties-6.0.3.3/lib/rails/rack/logger.rb:26:in block in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/tagged_logging.rb:80:in block in tagged' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/tagged_logging.rb:28:in tagged'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/tagged_logging.rb:80:in tagged' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/railties-6.0.3.3/lib/rails/rack/logger.rb:26:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/sprockets-rails-3.2.2/lib/sprockets/rails/quiet_assets.rb:13:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/remote_ip.rb:81:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/request_store-1.5.0/lib/request_store/middleware.rb:19:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/request_id.rb:27:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/method_override.rb:24:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/runtime.rb:22:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/activesupport-6.0.3.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/executor.rb:14:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/static.rb:126:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/host_authorization.rb:82:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/sentry-raven-3.1.0/lib/raven/integrations/rack.rb:51:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-cors-1.1.1/lib/rack/cors.rb:100:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-mini-profiler-2.1.0/lib/mini_profiler/profiler.rb:357:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/webpacker-5.2.1/lib/webpacker/dev_server_proxy.rb:25:in perform_request' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/railties-6.0.3.3/lib/rails/engine.rb:527:in call' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/puma-5.0.0/lib/puma/configuration.rb:238:in call'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/puma-5.0.0/lib/puma/server.rb:620:in handle_request' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/puma-5.0.0/lib/puma/server.rb:377:in process_client'
web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/puma-5.0.0/lib/puma/server.rb:231:in block in run' web_1 | 17:05:09 web.1 | /usr/local/bundle/gems/puma-5.0.0/lib/puma/thread_pool.rb:141:in block in spawn_thread'
web_1 | 17:05:09 web.1 | -------------
bundler: failed to load command: puma (/usr/local/bundle/bin/puma)
web_1 | 17:05:09 web.1 | EOFError: end of file reached
web_1 | 17:05:09 web.1 | internal:prelude:73:in __read_nonblock' web_1 | 17:05:09 web.1 | <internal:prelude>:73:in read_nonblock'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/console.rb:93:in getch' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:196:in read_key'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:238:in block (2 levels) in listen_key_press' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/key_bindings.rb:40:in block in match'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/key_bindings.rb:39:in loop' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/key_bindings.rb:39:in match'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:238:in block in listen_key_press' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:231:in loop'
web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:231:in listen_key_press' web_1 | 17:05:09 web.1 | /usr/local/bundle/bundler/gems/ruby_jard-f3dc5a3f333e/lib/ruby_jard/repl_proxy.rb:171:in block in repl'
web_1 | 17:05:09 log.1 | Completed 401 Unauthorized in 818ms (ActiveRecord: 35.3ms | Allocations: 284496)
web_1 | 17:05:09 log.1 |
web_1 | 17:05:09 log.1 |
web_1 | 17:05:11 web.1 | exited with code 1
web_1 | 17:05:11 system | sending SIGTERM to all processes
web_1 | 17:05:11 worker_default.1 | 2020-09-19T17:05:11.224Z pid=8 tid=go5qdq9us INFO: Shutting down
web_1 | 17:05:11 worker_default.1 | 2020-09-19T17:05:11.224Z pid=8 tid=go5qdq9us INFO: Terminating quiet workers
web_1 | 17:05:11 worker_default.1 | 2020-09-19T17:05:11.224Z pid=8 tid=go5s2kzfs INFO: Scheduler exiting...
web_1 | 17:05:11 worker_converters.1 | 2020-09-19T17:05:11.227Z pid=10 tid=gpg5zh1mi INFO: Shutting down
web_1 | 17:05:11 worker_converters.1 | 2020-09-19T17:05:11.227Z pid=10 tid=gpg5zh1mi INFO: Terminating quiet workers
web_1 | 17:05:11 worker_converters.1 | 2020-09-19T17:05:11.228Z pid=10 tid=gpg7o9nim INFO: Scheduler exiting...
web_1 | 17:05:11 webpacker.1 | exited with code 0
web_1 | 17:05:11 log.1 | terminated by SIGTERM
web_1 | 17:05:11 worker_default.1 | 2020-09-19T17:05:11.726Z pid=8 tid=go5qdq9us INFO: Bye!
web_1 | 17:05:11 worker_converters.1 | 2020-09-19T17:05:11.729Z pid=10 tid=gpg5zh1mi INFO: Bye!
web_1 | 17:05:11 worker_default.1 | exited with code 0
web_1 | 17:05:11 worker_converters.1 | exited with code 0

Environment (please complete the following information):

  • docker
  • foreman
  • rails 6.0.3.2
  • ruby 2.6.6

[BUG] empty space below the prompt when running in Rails project on WSL/Ubuntu

Describe the bug
Jard does not take up the full height of the console window. There is empty space below the prompt.

To Reproduce
Steps to reproduce the behavior:

  1. Install jard on a Ruby on Rails project.
  2. Add the jard command somewhere in the project.
  3. Run rails server (and perform action to launch jard if needed).
  4. See jard console.

Expected behavior
Jard takes up the full height of the console window.

Screenshots
image

Environment:

  • OS: Ubuntu 20.04.2 LTS running on WSL (Windows Subsystem for Linux; Windows 10)
  • Terminal Emulator: Xterm from Ubuntu on Windows Terminal
  • tput colors: 256
  • echo $TERM: xterm-256color
  • stty: speed 38400 baud; line = 0; -brkint -imaxbel
  • Do you use tmux/screen or similar tty multiplexer? No. Not that I know of.

Absolutely Gorgeous !! add documentation about stdin/stdout redirections precautions for hard

Is your feature request related to a problem? Please describe.

This is more a documentation (or details) process.

When using launcher (e.g pumactl or some wrapper around rack builder, it often happen that
the stdin/stdout (and in a minor importance ? stderr) are closed or redirected elsewhere
(e.g std/null or a file for logging).

In those case, it seems that jard (pry) continue to work as one can see that pressing 'Ctrl-D'
close the standard input and then the whole process seems to continue and then accept the
'Ctrl-C' to terminate the parent process.

Describe the solution you'd like

It would be nice (I'll try to help) to detail what to do, in order to 'protect' the minimum
requirement needed by jard in order to keep the IO for its own use.

Additional context

I'm testing a Grape Application launched by puma (using pumactl) and possibly
the solution is here to see that the launcher do not touch any of 'terminal launched'
standard descriptors.

Possibly similar launch like 'xxxx.ru' rack launcher could be handler the same way.

This will allow tremendous benefits for debugging inside Docker container using manual 'launch'
of the Docker process/CMD as it is indicated here to not touch thoses. If handled properly
it could allow to 'debug' containers using terminal and docker -it .... commands.

Would be terrific !

Supporting "disable-pry" kind of functionality

With pry, I've used following logic to allow resuming rails app, basically to resume from the loop. I.e. when rendering some long table and having breakpoint inside renderer, then just plain "continue" hits breakpoint on every iteration, but this trick have allowed to resume app and let it render page into end.

Pry::Commands.block_command "ec", "Continue from binding.pry" do |x, y, z|
  # @see https://stackoverflow.com/questions/8015531/how-do-i-step-out-of-a-loop-with-ruby-pry
  Pry::Commands.process_line String.new('disable-pry'), context
end

Problem is that with "jard", this causes this instead

{
  "exception_name": "SystemExit",
  "message": "exit",
  "inspect": "#<SystemExit: exit>",
  "drt_stacktrace": [
    "/gems/ruby-2.6.6@drt_ui/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/repl_processor.rb:145:in `exit'",
    "/gems/ruby-2.6.6@drt_ui/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/repl_processor.rb:145:in `handle_exit_command'",
    "/gems/ruby-2.6.6@drt_ui/bundler/gems/ruby_jard-cbba19ba3354/lib/ruby_jard/repl_processor.rb:87:in `handle_flow'",
    "    ... skipped 10 ...",
    "/gems/ruby-2.6.6@drt_ui/gems/byebug-11.1.3/lib/byebug/context.rb:98:in `at_line'",
   ...

thus internal error.

[BUG] Seems to break "binding.pry"

Describe the bug
Tried to evaluate "jard", but since simply installing "ruby_jard" gem broke usage of "binding.pry" as breakpoint, had to uninstall "ruby_jard".

To Reproduce
Steps to reproduce the behavior:

  1. add "binding.pry" breakpoint in rails app
  2. Hit breakpoint

=> error when breakpoint is hit

before_session hook failed: UncaughtThrowError: uncaught throw :jard_control_flow
//.rvm/gems/ruby-2.6.6@drt_ui/gems/ruby_jard-0.3.0/lib/ruby_jard/control_flow.rb:53:in `throw'
(see pry_instance.hooks.errors to debug)

[BUG] F2 Mode doesn't work as expected

Describe the bug
F2 - mode didn't work as I expected

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'rails console'
  2. See all systems and application variables in variables panel
  3. Click F2 to switch mode
  4. Nothing happened

Expected behavior
The variables should be updated to show only application variables

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2020-08-03 at 10 05 34

Environment (please complete the following information):

  • OS: MacOS Catalina
  • Terminal Emulator: Tmux + Iterm2
  • Do you use tmux/screen or similar tty multiplexer? tmux

[BUG] ~/.jardrc does not seem to work with Rails Console

Describe the bug
The ~/.jardrc configuration file doesn't seem to be read or applied when running Jard in Rails Console.

To Reproduce
Steps to reproduce the behavior:

  1. Install jard in a Rails project.
  2. Run rails console
  3. Execute def j; jard; end; j
  4. Configuration file is not read. All settings are at default.

Expected behavior
Configuration file is read and settings applied.

Environment:

  • OS: Ubuntu 20.04.2 LTS running on WSL (Windows Subsystem for Linux; Windows 10)
  • Terminal Emulator: Xterm from Ubuntu on Windows Terminal
  • tput colors: 256
  • echo $TERM: xterm-256color
  • stty: speed 38400 baud; line = 0; -brkint -imaxbel
  • Do you use tmux/screen or similar tty multiplexer? No. Not that I know of.

[BUG] Can't type

Describe the bug
I'm trying to use it with a Rails 6 app, in test mode. Namely I am adding the breakpoint in a controller and running my cucumber tests.

Jard starts and displays everything, but I cannot interact with it in any way. Only thing I can do is C-c to quit.

The gem is included in my development and test groups.

Environment (please complete the following information):

  • OS
    Mac OS 10.15.6
  • Terminal Emulator
    iTerm2 (with zsh)
  • Output when you run tput colors in your terminal
    256
  • Output when you run echo $TERM in your terminal
    xterm-256color
  • Output when you run stty
    speed 38400 baud;
    lflags: echoe echok echoke echonl echoctl pendin
    iflags: istrip iutf8 ignbrk
    oflags: -oxtabs
    cflags: cs8 -parenb
  • Do you use tmux/screen or similar tty multiplexer?
    no

Support Ruby 2.4

I know Ruby 2.4 is EOL, but my workplace kinda required it. I'm happy to help in whatever way I can. Do you have a pointer on how to start working on this?

[BUG] Can not step into subsequent calls on the same line of code (only the call which is evaluated first by Ruby)

Describe the bug

Given code such as:

foo(bar.to_h)

it is not apparently possible to step into the foo call. When Jard stops on this line, Step will step into the #to_h call. Unlike something like byebug, Step Out does not take me back to the foo(bar.to_h) line but appears to step up/out past it or perhaps just steps over it (it's hard to tell).

To Reproduce

  1. Enter jard before a method call that contains arguments which need evaluation via a method call. For instance:
    image

  2. F7 will take you to the first evaluated method call (request.referrer or request, depending on whether request is a local var or a method)
    image
    image

  3. Shift+F7 will take you to line after the initial break point (or a frame higher, if the breakpoint was the last line.
    image

Expected behavior

There should be someway step into redirect_to (and any other calls on that break point). For instance, byebug (and pry-byebug) you could do step, up, step, up, step and you would be inside redirect_to. It's clumsy, but it works.

Ideally, jard would underline the call which it would next step into, but admittedly that may be impossible to do reliably. However, it would look something like:

redirect_to(r͟e͟q͟u͟e͟s͟t͟.referrer || request.fullpath)
redirect_to(request.r͟e͟f͟e͟r͟r͟e͟r͟ || request.fullpath)
redirect_to(request.referrer || r͟e͟q͟u͟e͟s͟t͟.fullpath) # in the case where `request.referrer` is `nil`
redirect_to(request.referrer || request.f͟u͟l͟l͟p͟a͟t͟h͟) # in the case where `request.referrer` is `nil`
r͟e͟d͟i͟r͟e͟c͟t͟_͟t͟o͟(request.referrer || request.fullpath)

I am pretty confident this is not possible without some pretty advanced static analysis, but it does at least illustrate the steps that are expected to be able to be taken manually.

Screenshots

(inline in reproduction steps)

Environment (please complete the following information):

  • OS: ArchLinux
  • Terminal Emulator: GNOME Terminal
  • Output when you run tput colors in your terminal: 256
  • Output when you run echo $TERM in your terminal: xterm-256color
  • Output when you run stty:
    speed 38400 baud; line = 0;
    -brkint -imaxbel iutf8
    
  • Do you use tmux/screen or similar tty multiplexer? no

Breakpoint in initializer throws error "undefined method `to_hash' for nil:NilClass"

The bug

Putting jard in an ActiveRecord model initializer causes an error as it is trying to call to_hash on nil.

To Reproduce

Run this code:

class Foo < ApplicationRecord
  def initialize(attrs = {})
    jard
    puts "Bang!"
  end
end

Expected behavior

It should know about being in an initializer and not error.

Stacktrace

undefined method `to_hash' for nil:NilClass
gems/activerecord-5.2.4.4/lib/active_record/attribute_methods.rb:327:in `attributes'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/rails_decorator.rb:36:in `decorate_singleline'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/rails_decorator.rb:44:in `decorate_multiline'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/rails_decorator.rb:187:in `block in decorate_multiline'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/rails_decorator.rb:184:in `each'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/rails_decorator.rb:184:in `decorate_multiline'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/inspection_decorator.rb:73:in `block in decorate_multiline'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/inspection_decorator.rb:70:in `each'
gems/ruby_jard-0.3.1/lib/ruby_jard/decorators/inspection_decorator.rb:70:in `decorate_multiline'
gems/ruby_jard-0.3.1/lib/ruby_jard/screens/variables_screen.rb:70:in `block in build'

Environment
All

Thank you for this excellent utility!

[BUG] - binding.pry

Describe the bug
Expected binding.pry to work as it does with pry, pry-rails, pry-debugger since pry is a dependency of this gem.
It would be great if Jard was backwards compatible so that users who prefer binding.pry can use it alongside other team members wishing to use Jard

To Reproduce
Steps to reproduce the behavior:

  1. Use binding.pry in a file

Expected behavior
Pry to work as it previously did

Screenshots

before_session hook failed: UncaughtThrowError: uncaught throw :jard_control_flow
/Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/ruby_jard-c794d14072ed/lib/ruby_jard/control_flow.rb:53:in `throw'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.