Hi @piotrmurach, TTY Toolkit is great and thank you for saving a lot of our time. However, I have a small problem. I can't figure out how to send the user input from
prompt.ask(">>") do |q|
q.validate(/(close)|(\A[0-9]+(\.[0-9]+)?[\+\-\*\√][0-9]+(\.[0-9]+)?\z)/, "Invalid question, #{ENV["USER"].capitalize}. Try again.\a")
end
to a global variable. How may I do this?
TTY::Table
, I was wondering what is the status of getting the following merged:# Describe available commands or one specific command.
RSpec.describe "`parc-cli version` command", type: :cli do
it "executes `parc-cli version --check` command successfully" do
VCR.use_cassette("version-check") do
output = `parc-cli version --check`
# assert here
end
end
end
enum_select
and expand
prompts. There is an piotrmurach/tty-prompt#151 and a piotrmurach/tty-prompt#152 where this feature is discussed. I cannot tell you when this will be done.
require 'git'
require "tty-prompt"
repo_name_list = ['repo_name_1', 'repo_name_2']
prompt = TTY::Prompt.new
prompt.multi_select("Which repos would you like to clone locally?", repo_name_list)
# NoMethodError: undefined method `disabled?' for nil:NilClass
prompt.enum_select("Which repos would you like to clone locally?", repo_name_list)
# NoMethodError: undefined method `disabled?' for nil:NilClass
TTY::ProgressBar::Multi
and was wondering if there was an off the shelf way to clear registered/child bars when they complete? I've tried adding clear: true
to both the new instance of TTY::ProgressBar::Multi
and as an option provided to #register
. Neither of these have any impact as the progress bars finish.
Hi folks! I'm trying to find a way to not use the space character as selection when filtering a list using select
. I'm using select
for a list of names that have spaces in them (e.g.team_names = ["Some Team", "Some Team: SubTeam"]
). When the user types "Some " the prompt selects the first instance and I want it to continue filtering using the space.
I'm using prompt.select('Select your team name:', team_names, filter: true)
.
I tried using prompt.select('Select your team name:', team_names, filter: true, keys: [:return])
but that didn't work. Is there another option I should be passing here? I'm using v 0.18.1
Thanks!
DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' ha
s been deprecated. Please call
DidYouMean.correct_error(errorname, spellinitialize': wrong number of arguments (given 1, expected 0) (Argum
entError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/cmd.
rb:33:in
new'command'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/comm
ands/new.rb:46:in
initialize'new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/cli.
rb:128:in
new'run'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/in
vocation.rb:126:in
invoke_command'dispatch'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/ba
se.rb:466:in
start'<top (required)>'
from C:/Ruby31-x64/bin/teletype:25:in
load'DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)
' ha s been deprecated. Please callDidYouMean.correct_error(errorname, spell
checker)
' instead.
C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / tty - command - 0.9 .0 / lib / tty / command.rb: 54: in initialize ': wrong number of arguments (given 1, expected 0) (Argum entError) from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/cmd. rb:33:innew'
from C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / tty - 0.10 .0 / lib / tty / cmd.
rb: 33: in command ' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/comm ands/new.rb:46:ininitialize'
from C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / tty - 0.10 .0 / lib / tty / cli.
rb: 128: in new ' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tty-0.10.0/lib/tty/cli. rb:128:innew'
from C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / thor - 0.20 .3 / lib / thor / co
mmand.rb: 27: in run ' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/in vocation.rb:126:ininvoke_command'
from C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / thor - 0.20 .3 / lib / thor.rb: 387: in dispatch ' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-0.20.3/lib/thor/ba se.rb:466:instart'
from C: /Ruby31-x64/lib / ruby / gems / 3.1 .0 / gems / tty - 0.10 .0 / exe / teletype: 14: in < top(required) > ' from C:/Ruby31-x64/bin/teletype:25:inload'
from C: /Ruby31-x64/bin / teletype: 25: in
<main>'`