Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

[BUG] Source output incorrect #57

Closed
hirowatari opened this issue Sep 21, 2020 · 2 comments
Closed

[BUG] Source output incorrect #57

hirowatari opened this issue Sep 21, 2020 · 2 comments
Labels
bug Something isn't working released The issue is resolved with the newest release

Comments

@hirowatari
Copy link

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.

@hirowatari hirowatari added the bug Something isn't working label Sep 21, 2020
@0x2c7 0x2c7 mentioned this issue Sep 22, 2020
3 tasks
@0x2c7
Copy link
Owner

0x2c7 commented Sep 22, 2020

Hi @hirowatari, thanks for reporting this issue. I tested on my local environment, and confirmed that this happens. The root cause is from variable screen, instead. I forgot to escape special characters (\n in this case) from SQL before printing it out to the screen. So, it overlaps and breaks the source screen. I implemented a fix at #56, and already merged into master. You can try the fix at master branch first. I'll push a relase soon.

gem 'ruby_jard', git: 'https://github.com/nguyenquangminh0711/ruby_jard', ref: 'master'

@hirowatari
Copy link
Author

@nguyenquangminh0711 Thanks!! That fixed it. Appreciate the quick fix.

@0x2c7 0x2c7 closed this as completed Sep 23, 2020
@0x2c7 0x2c7 added released The issue is resolved with the newest release and removed wait for release labels Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released The issue is resolved with the newest release
Projects
None yet
Development

No branches or pull requests

2 participants