summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Bump up version to 3.0.0.pre.1Abinoam P. Marques Jr2023-04-271-1/+1
|
* Do not call stty on non-ttyKeenan Brock2023-04-242-3/+5
| | | | | | | | | | | | | | | | | | | | | When testing on a non-tty (e.g.: github actions), either one of these lines produces an error: ```ruby input.echo = true ask("question", "y") { |q| q.readline = true } ``` The error is produced by ruby internals: ```bash echo | rake | cat ......stty: stdin isn't a terminal...... ``` This change skips the stty calls if the input is not on a tty, so the errors will not be produced.
* Use existing save_stty functionalityKeenan Brock2023-04-241-2/+2
| | | | | Yes, `save_stty` and `restore_stty` should probably not live in terminal, but they do. No reason to re-implement them. And they handle error cases better.
* Fix #43 - Handle erase line correctly (CTRL-U)Abinoam P. Marques Jr2023-01-061-0/+3
|
* Update IOConsoleCompatible#getch to io/console signatureAbinoam P. Marques Jr2023-01-051-1/+1
|
* Handle interrupts directly at io/consoleAbinoam P. Marques Jr2023-01-051-1/+1
| | | | | | | | | | | | | | | Added to io/console at commit at 24, September, 2019 * https://github.com/ruby/io-console/commit/7cba76561a39722fbcee3a65d4d6b8bc6f15df67 Released in Ruby 2.7.0, released at 25, December, 2019 * https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/ Documented at 17, February, 2020 * https://github.com/ruby/io-console/commit/82b630cd79594339d4b05ebe211f47d62dbe1fc5 Documented in Ruby 2.7.1, released at 31, March, 2020 * https://ruby-doc.org/stdlib-2.7.1/libdoc/io/console/rdoc/IO.html#method-i-getch * https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-7-1-released/
* Handle Ctrl-C when Question#echo = false (raw_no_echo_mode)Faheetah2023-01-041-0/+1
|
* Update Question#validate inline documentationAbinoam P. Marques Jr2023-01-021-0/+3
|
* Enable using a validator class for validationAbinoam P. Marques Jr2023-01-021-1/+2
|
* Document the new Question#default_hint_showAbinoam P. Marques Jr2023-01-011-6/+16
|
* Disentangle check_range stepAbinoam P. Marques Jr2022-12-312-2/+2
|
* Check_range even if it's not being convertedAbinoam P. Marques Jr2022-12-311-3/+1
|
* Bump up version to 2.1.0Abinoam P. Marques Jr2022-12-311-1/+1
|
* These files have no shebang and should not be executableBrandon Dunne2022-02-235-0/+0
|
* Release 2.0.3v2.0.3Abinoam Praxedes Marques Junior2019-10-111-1/+1
|
* Bump up version to 2.0.2v2.0.2Abinoam Praxedes Marques Junior2019-04-081-1/+1
|
* Move downcase of capital letterAna María Martínez Gómez2019-04-081-2/+2
| | | | | Downcase answer after having compared it with the text options to avoid breaking this case.
* Refactor letter options for indexAna María Martínez Gómez2019-04-081-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid code repetition and add comment. Although we didn't have time to implement it, this was suggested during The Biggest Mobprogramming session ever at RubyConfBY 2019: https://rubyconference.by Co-authored-by: Mikhail <imikailoby@gmail.com> Co-authored-by: Alex <alexneisc@gmail.com> Co-authored-by: Eduardo <eduardoj@gmail.com> Co-authored-by: Tung Nguyen <tongueroo@gmail.com> Co-authored-by: Mikhail <mikhaildyomin@gmail.com> Co-authored-by: Gennady <minenkov3108@gmail.com> Co-authored-by: Tatiana <tatiana.karpesh@gmail.com> Co-authored-by: Pavel <bondek777@gmail.com> Co-authored-by: Suhakou Yauheni <shiroginne@gmail.com> Co-authored-by: Vladislav Berdinskiy <vvberdinskiy@yandex.ru> Co-authored-by: Andreyeu Uladzislau <me@vld.by> Co-authored-by: Dan <d.kachur@daarokets.com> Co-authored-by: Denis Defreyne <denis@denis.ws> Co-authored-by: Nikita <bulajnikita@gmail.com> Co-authored-by: Dmitry <dsalahitdinov@gmail.com> Co-authored-by: Aleksey <lesha@kurepin.com> Co-authored-by: Vladislav Kalach <kalach.vladislav@gmail.com> Co-authored-by: Dzmitry <kremez19@gmail.com> Co-authored-by: Tung Nguyen <tongueroo@gmail.com> Co-authored-by: Ilya <ilyabyar@gmail.com> Co-authored-by: Aliaksei Hrechushkin <ahrechushkin@gmail.com> Co-authored-by: Piotr Wasiak <chooosen@gmail.com> Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com> Co-authored-by: Ihar <iharidla@gmail.com> Co-authored-by: Maks <rusakovich94@gmail.com> Co-authored-by: Karol Topolski <ktopolski.it@gmail.com> Co-authored-by: Konstantin Rudy <konstantin.rudy@gmail.com> Co-authored-by: Artyom <artemshibalko@gmail.com> Co-authored-by: Yuri <mkrvch.yury@gmail.com> Co-authored-by: Oleg <o.bekasov96@gmail.com> Co-authored-by: Rostislav Zhuravsky <rostislav.zhuravsky@gmail.com> Co-authored-by: Hanna Novikava <arnikasky@gmail.com> Co-authored-by: Alex <goodniceweb@gmail.com> Co-authored-by: Anton <orangeudav@gmail.com> Co-authored-by: Alexander <alexander.skachko@gmail.com> Co-authored-by: igorpolyakov <igorpolyakov@protonmail.com> Co-authored-by: Inna <ina.karatkova@itechart-group.com> Co-authored-by: Yury Matusevich <yury.a.matusevich@gmail.com> Co-authored-by: Paul Pavlovsky <fatpaher@gmail.com> Co-authored-by: Vlad <vlad.horbachevsky@gmail.com> Co-authored-by: Serge <Kislak7@gmail.com> Co-authored-by: Boris & Anton <Borisanton@mail.ru> Co-authored-by: Karina <rktiurina@gmail.com> Co-authored-by: Andrei Kryuda <a.kryuda@gmail.com> Co-authored-by: Artem <artemkrivonozhko@gmail.com> Co-authored-by: DimaAleks <dimaalekseichik@gmail.com> Co-authored-by: Hanna Kolesnikova <kolesaak@gmail.com> Co-authored-by: Aliaksandr Lomau <lomov.as@gmail.com> Co-authored-by: Eugene Khrantsov <eugene.kstu@gmail.com> Co-authored-by: Dmitry Zhlobo <dima.zhlobo@gmail.com> Co-authored-by: Oleg Ryzhko <ryz.oleg@gmail.com> Co-authored-by: Aleksandr <skyksandr@gmail.com> Co-authored-by: Dmitriy Kiriyenko <dmitriy.kiriyenko@gmail.com>
* Add new capital_letter option to menu indexAna María Martínez Gómez2019-04-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To configure menu indexes we could use `:number`, `:letter` and `none` options. The `:letter` option uses lowercase letter. Add a new option `:capital_letter` which uses uppercase letter as indexes. This code was written as it is in The Biggest Mobprogramming session ever at RubyConfBY 2019: https://rubyconference.by Co-authored-by: Mikhail <imikailoby@gmail.com> Co-authored-by: Alex <alexneisc@gmail.com> Co-authored-by: Eduardo <eduardoj@gmail.com> Co-authored-by: Tung Nguyen <tongueroo@gmail.com> Co-authored-by: Mikhail <mikhaildyomin@gmail.com> Co-authored-by: Gennady <minenkov3108@gmail.com> Co-authored-by: Tatiana <tatiana.karpesh@gmail.com> Co-authored-by: Pavel <bondek777@gmail.com> Co-authored-by: Suhakou Yauheni <shiroginne@gmail.com> Co-authored-by: Vladislav Berdinskiy <vvberdinskiy@yandex.ru> Co-authored-by: Andreyeu Uladzislau <me@vld.by> Co-authored-by: Dan <d.kachur@daarokets.com> Co-authored-by: Denis Defreyne <denis@denis.ws> Co-authored-by: Nikita <bulajnikita@gmail.com> Co-authored-by: Dmitry <dsalahitdinov@gmail.com> Co-authored-by: Aleksey <lesha@kurepin.com> Co-authored-by: Vladislav Kalach <kalach.vladislav@gmail.com> Co-authored-by: Dzmitry <kremez19@gmail.com> Co-authored-by: Tung Nguyen <tongueroo@gmail.com> Co-authored-by: Ilya <ilyabyar@gmail.com> Co-authored-by: Aliaksei Hrechushkin <ahrechushkin@gmail.com> Co-authored-by: Piotr Wasiak <chooosen@gmail.com> Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com> Co-authored-by: Ihar <iharidla@gmail.com> Co-authored-by: Maks <rusakovich94@gmail.com> Co-authored-by: Karol Topolski <ktopolski.it@gmail.com> Co-authored-by: Konstantin Rudy <konstantin.rudy@gmail.com> Co-authored-by: Artyom <artemshibalko@gmail.com> Co-authored-by: Yuri <mkrvch.yury@gmail.com> Co-authored-by: Oleg <o.bekasov96@gmail.com> Co-authored-by: Rostislav Zhuravsky <rostislav.zhuravsky@gmail.com> Co-authored-by: Hanna Novikava <arnikasky@gmail.com> Co-authored-by: Alex <goodniceweb@gmail.com> Co-authored-by: Anton <orangeudav@gmail.com> Co-authored-by: Alexander <alexander.skachko@gmail.com> Co-authored-by: igorpolyakov <igorpolyakov@protonmail.com> Co-authored-by: Inna <ina.karatkova@itechart-group.com> Co-authored-by: Yury Matusevich <yury.a.matusevich@gmail.com> Co-authored-by: Paul Pavlovsky <fatpaher@gmail.com> Co-authored-by: Vlad <vlad.horbachevsky@gmail.com> Co-authored-by: Serge <Kislak7@gmail.com> Co-authored-by: Boris & Anton <Borisanton@mail.ru> Co-authored-by: Karina <rktiurina@gmail.com> Co-authored-by: Andrei Kryuda <a.kryuda@gmail.com> Co-authored-by: Artem <artemkrivonozhko@gmail.com> Co-authored-by: DimaAleks <dimaalekseichik@gmail.com> Co-authored-by: Hanna Kolesnikova <kolesaak@gmail.com> Co-authored-by: Aliaksandr Lomau <lomov.as@gmail.com> Co-authored-by: Eugene Khrantsov <eugene.kstu@gmail.com> Co-authored-by: Dmitry Zhlobo <dima.zhlobo@gmail.com> Co-authored-by: Oleg Ryzhko <ryz.oleg@gmail.com> Co-authored-by: Aleksandr <skyksandr@gmail.com> Co-authored-by: Dmitriy Kiriyenko <dmitriy.kiriyenko@gmail.com>
* Avoid YARD warning UnknownParamOlle Jonsson2019-03-291-2/+0
|
* Bump up version to 2.0.1Abinoam Praxedes Marques Junior2019-01-231-1/+1
|
* Apply Rubocop suggestionsAbinoam Praxedes Marques Junior2019-01-231-2/+2
|
* Quick fix for #237Abinoam Praxedes Marques Junior2019-01-231-0/+7
| | | | | | | Problem when issueing terminal commands like `echo = true` in non tty input/outputs. Like in `echo "asdf" | ruby script.rb`
* Release 2.0.0release/2.0Abinoam Praxedes Marques Junior2018-06-111-1/+1
|
* Release 2.0.0-develop.16v2.0.0.pre.develop.16Abinoam Praxedes Marques Junior2018-05-121-1/+1
|
* about shell and gather邹云慧2018-05-122-4/+27
|
* Deprecate safe_level of ERB.new in Ruby 2.6Koichi ITO2018-05-123-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR suppresses the following warnings when using Ruby 2.6.0-dev. ```console % be rake /Users/koic/.rbenv/versions/2.6.0-dev/bin/ruby -w -I"lib:test" -I"/Users/koic/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/rake-12.3.1/lib" "/Users/koic/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/rake-12.3.1/lib/rake/rake_test_loader.rb" "test/test_answer_converter.rb" "test/test_color_scheme.rb" "test/test_helper.rb" "test/test_highline.rb" "test/test_import.rb" "test/test_list.rb" "test/test_menu.rb" "test/test_paginator.rb" "test/test_question_asker.rb" "test/test_simulator.rb" "test/test_string_extension.rb" "test/test_string_highline.rb" "test/test_style.rb" "test/test_wrapper.rb" Tests will be run under: - HighLine::Terminal::IOConsole - HighLine::VERSION 2.0.0-develop.15 - ruby 2.6.0dev (2018-05-08 trunk 63359) [x86_64-darwin17] Run options: --seed 11307 # Running: .....................................SS..S/Users/koic/src/github.com/JEG2/highline/lib/highline/statement.rb:81: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. /Users/koic/src/github.com/JEG2/highline/lib/highline/statement.rb:81: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead. /Users/koic/src/github.com/JEG2/highline/lib/highline/list_renderer.rb:95: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. /Users/koic/src/github.com/JEG2/highline/lib/highline/list_renderer.rb:95: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead. (snip) ``` The interface of `ERB.new` will change from Ruby 2.6. > Add :trim_mode and :eoutvar keyword arguments to ERB.new. > Now non-keyword arguments other than first one are softly deprecated > and will be removed when Ruby 2.5 becomes EOL. [Feature #14256] https://github.com/ruby/ruby/blob/2311087/NEWS#stdlib-updates-outstanding-ones-only This PR uses `ERB.instance_method(:initialize).parameters.assoc(:key)` to switch `ERB.new` interface. Because HighLine supports multiple Ruby versions, it need to use the appropriate interface. This approach is built into Ruby. https://github.com/ruby/ruby/commit/3406c5d
* Bump version to 2.0.0-develop.15 and update Changelogupdate/ruby_version_on_travisAbinoam P. Marques Jr2017-12-281-1/+1
|
* Prepare for v2.0.0-develop.14issue_221Abinoam P. Marques Jr2017-11-211-1/+1
|
* Remove now useless codeAbinoam P. Marques Jr2017-11-211-4/+2
|
* Prompt treated the same with or without readlineAbinoam P. Marques Jr2017-11-212-2/+2
|
* Add completion hints to agree with readlineAbinoam P. Marques Jr2017-11-211-0/+1
|
* Bump up version to 2.0.0-develop.13Abinoam P. Marques Jr2017-11-051-1/+1
| | | | ... and update Changelog.
* Change rescue for a simple if/elseAbinoam P. Marques Jr2017-11-051-1/+5
|
* Move logic to QuestionAbinoam P. Marques Jr2017-11-052-7/+7
|
* Implement proc or string for errorAbinoam P. Marques Jr2017-11-051-1/+6
|
* Remove unused code. QuestionAsker has its ownAbinoam P. Marques Jr2017-11-051-9/+0
|
* Bump up version to 2.0.0-develop.12Abinoam P. Marques Jr2017-10-191-1/+1
|
* Expose IOConsoleCompatibleAbinoam P. Marques Jr2017-10-191-0/+37
|
* Copy use_color from HighLine.default_instanceAbinoam P. Marques Jr2017-10-191-2/+17
| | | | | | | | | | | This is gonna help people migrating code from 1.7.x to 2.0.x. At 1.7.x if you set HighLine.use_color to anything, the effect would be global. At 2.0.x this setting is saved per instance and were being default to true. With this commit, newly instantiated HighLine instances will copy use_color setting from the HighLine defaul_instance wich mimicks the behaviour at 1.7.x. The main difference is, as soon as an instance come to life, HighLine.use_color (class method) will have no effect on the instance use_color setting.
* Update Changelog / 2.0.0-develop.11rubocopAbinoam P. Marques Jr2017-09-251-1/+1
|
* Fix rescueing without error classAbinoam P. Marques Jr2017-09-253-4/+4
|
* Fix exception suppresionAbinoam P. Marques Jr2017-09-251-6/+0
|
* Use get_character name because it implies effortAbinoam P. Marques Jr2017-09-252-2/+2
|
* Add meaningful heredoc delimitersAbinoam P. Marques Jr2017-09-251-6/+6
|
* Use Hash#each_valueAbinoam P. Marques Jr2017-09-251-1/+1
|
* Fix class/module nestingAbinoam P. Marques Jr2017-09-251-195/+202
|
* Adjust documentationAbinoam P. Marques Jr2017-09-253-3/+3
|
* Revert %i use for 1.9 compatibilityAbinoam P. Marques Jr2017-09-252-10/+10
|
* Improve StringExtension method_missingAbinoam P. Marques Jr2017-09-251-3/+9
|