| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Downcase answer after having compared it with the text options to avoid
breaking this case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Problem when issueing terminal commands like
`echo = true` in non tty input/outputs.
Like in `echo "asdf" | ruby script.rb`
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
... and update Changelog.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|