getc
method you will get similar behaviour. Had a similar issue recently to do with TTY::Prompt behaviour (see piotrmurach/tty-prompt#137). Glad you managed to figure this out!
macbook:app masaino$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]
macbook:app masaino$ teletype -v
v0.10.0
macbook:app masaino$ uname -a
Darwin macbook.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
macbook:app masaino$ teletype add com --desc 'desc A'
create spec/integration/com_spec.rb
create spec/unit/com_spec.rb
create lib/app/commands/com.rb
create lib/app/templates/com/.gitkeep
inject lib/app/cli.rb
macbook:app masaino$ teletype add com --desc 'desc B' --force
force spec/integration/com_spec.rb
identical spec/unit/com_spec.rb
identical lib/app/commands/com.rb
identical lib/app/templates/com/.gitkeep
macbook:app masaino$ exe/app
Commands:
app com # desc A
app help [COMMAND] # Describe available commands or one specific command
app version # app version
teletype
isn't yet that smart to figure this out, unfortunately. When you come across things that could be improved or have suggestions please post them on the project issues tracker or even better submit a pull request. At the moment I'm updating all tty components and working on the tty
itself to provide a bit smoother experience in v0.11.0
.
params
invalid but no actual errors are raised. I would suggest reading parse method section and params section. I wrote the Readme to document all the APIs and usage but please free to submit PR if something is missing or not clear enough. I'm keen to make sure the docs are complete and easy to use.
help needed: for some reason, I "gem install tty" but don't get "teletype" as a new command.
effrey@Mac-mini youtube % gem install tty
Successfully installed tty-0.10.0
Parsing documentation for tty-0.10.0
Done installing documentation for tty after 0 seconds
1 gem installed
jeffrey@Mac-mini youtube % teletype new app
zsh: command not found: teletype
tty
gem. I verified by installing v0.10.0
that the teletype
executable works as expected. I'd potentially look into reinstalling Ruby version that you're using. However, this is an issue for yourself to figure out why your system fails to find Ruby installed executables.
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