piotrmurach / tty-prompt

A beautiful and powerful interactive command line prompt
https://ttytoolkit.org
MIT License
1.47k stars 136 forks source link

First naiive attempt to combat wrapped long lines #82

Closed muellerj closed 6 years ago

muellerj commented 6 years ago

See #79.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.05%) to 94.649% when pulling 7088c2860adb6da7caa5cb2fa8d557f51acd8625 on muellerj:master into 170475bee42d68053d8f89647f8be969afb78371 on piotrmurach:master.

muellerj commented 6 years ago

The spec for the slider seems broken on my machine (on master as well as on my branch):

$ rspec

Randomized with seed 3194
..........................................F................................................................................#<Thread:0x000000060165f1b0@/cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:44 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        4: from /cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:57:in `block in async_run'
        3: from /cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:57:in `synchronize'
        2: from /cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:63:in `block (2 levels) in async_run'
        1: from /cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:10:in `block in <class:Timeout>'
/cygdrive/c/Users/muellerj/projects/tty-prompt/lib/tty/prompt/timeout.rb:10:in `raise': timeout expired (TTY::Prompt::Timeout::Error)
..................................................................................................................................................

Failures:

  1) TTY::Prompt#slider specifies range through DSL
     Failure/Error: @format.gsub(':slider', slider) % [value]

     ArgumentError:
       incomplete format specifier; use %% (double %) instead
     # ./lib/tty/prompt/slider.rb:187:in `%'
     # ./lib/tty/prompt/slider.rb:187:in `render_slider'
     # ./lib/tty/prompt/slider.rb:168:in `render_question'
     # ./lib/tty/prompt/slider.rb:129:in `render'
     # ./lib/tty/prompt/slider.rb:102:in `call'
     # ./lib/tty/prompt.rb:381:in `slider'
     # ./spec/unit/slider_spec.rb:42:in `block (2 levels) in <top (required)>'
muellerj commented 6 years ago

Fixed by @piotrmurach in 363819861710db984b4891e50f0f42e7e842a91b.