highline 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -2
- data/.rubocop.yml +1 -1
- data/Changelog.md +4 -0
- data/Gemfile +1 -0
- data/lib/highline/list_renderer.rb +2 -2
- data/lib/highline/menu.rb +7 -5
- data/lib/highline/version.rb +1 -1
- data/lib/highline.rb +17 -12
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d2b093cb533443369ed3d5c31f6c09f1d5fdfd4d5b9f89a1e48d8da20a377a
|
4
|
+
data.tar.gz: 150008ffff933909afcc40ebdee9bba538dc1170331a4a58cd5ebff5fc582738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 016dc7d742577f9cb8fbca44a07e14a9911b314afb9ad4974456ae29fb379705a4161e48eb19c73fb2a7afe6ae602272360141b09cc17ad33346eb00a03f34e8
|
7
|
+
data.tar.gz: 41d933367b093d1296535eedcf8ffc147c561dd51f07ef81d20d3c044877c93d1c3eb0c96a783e1c0f4cfd444ceb1bbbda26c21509519515571cab87ac3744ba
|
data/.github/workflows/ci.yml
CHANGED
@@ -10,6 +10,7 @@ jobs:
|
|
10
10
|
os: [ubuntu-latest]
|
11
11
|
ruby-version:
|
12
12
|
- head
|
13
|
+
- '3.4'
|
13
14
|
- '3.3'
|
14
15
|
- '3.2'
|
15
16
|
- '3.1'
|
@@ -23,7 +24,7 @@ jobs:
|
|
23
24
|
- os: windows-latest
|
24
25
|
ruby-version: head
|
25
26
|
- os: windows-latest
|
26
|
-
ruby-version: '3.
|
27
|
+
ruby-version: '3.4'
|
27
28
|
- os: windows-latest
|
28
29
|
ruby-version: mingw
|
29
30
|
- os: windows-latest
|
@@ -33,7 +34,7 @@ jobs:
|
|
33
34
|
- os: macos-latest
|
34
35
|
ruby-version: 'head'
|
35
36
|
- os: macos-latest
|
36
|
-
ruby-version: '3.
|
37
|
+
ruby-version: '3.4'
|
37
38
|
runs-on: ${{ matrix.os }}
|
38
39
|
steps:
|
39
40
|
- uses: actions/checkout@v4
|
data/.rubocop.yml
CHANGED
data/Changelog.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Below is a complete listing of changes for each revision of HighLine.
|
4
4
|
|
5
|
+
### 3.1.2 / 2025-01-05
|
6
|
+
* PR #279 - Upgrades and adjustments for Ruby 3.4 release (@abinoam)
|
7
|
+
* PR #278 - Prevent ArgumentError for #col_count_calculate when items exceed 80 chars (@davidjkling, @justintsteele)
|
8
|
+
|
5
9
|
### 3.1.1 / 2024-08-18
|
6
10
|
* PR #276 - Update #say to always flush the output after a #puts (@blipper)
|
7
11
|
* PR #274 / I #273 (@costa)
|
data/Gemfile
CHANGED
@@ -236,8 +236,8 @@ class HighLine
|
|
236
236
|
end
|
237
237
|
|
238
238
|
def col_count_calculate
|
239
|
-
(line_size_limit + row_join_str_size) /
|
240
|
-
|
239
|
+
result = (line_size_limit + row_join_str_size) / (items_max_length + row_join_str_size)
|
240
|
+
result == 0 ? 1 : result
|
241
241
|
end
|
242
242
|
|
243
243
|
def col_count
|
data/lib/highline/menu.rb
CHANGED
@@ -374,12 +374,14 @@ class HighLine
|
|
374
374
|
end
|
375
375
|
|
376
376
|
def map_items_by_index
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
377
|
+
size = all_items.size
|
378
|
+
case @index
|
379
|
+
when :letter
|
380
|
+
("a".."z").first(size)
|
381
|
+
when :capital_letter
|
382
|
+
("A".."Z").first(size)
|
381
383
|
else
|
382
|
-
(1..
|
384
|
+
(1..size).map(&:to_s)
|
383
385
|
end
|
384
386
|
end
|
385
387
|
|
data/lib/highline/version.rb
CHANGED
data/lib/highline.rb
CHANGED
@@ -555,21 +555,26 @@ class HighLine
|
|
555
555
|
terminal.raw_no_echo_mode_exec do
|
556
556
|
loop do
|
557
557
|
character = terminal.get_character
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
#
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
558
|
+
|
559
|
+
case character
|
560
|
+
when "\u0003" # Ctrl+C (Interrupt)
|
561
|
+
raise Interrupt
|
562
|
+
when nil # No character received
|
563
|
+
break
|
564
|
+
when "\n", "\r" # Newline or carriage return
|
565
|
+
break
|
566
|
+
when "\b", "\u007F" # Backspace and delete
|
567
|
+
unless line.empty?
|
568
|
+
line = line.chop
|
569
|
+
output_erase_char if question.echo
|
570
|
+
end
|
571
|
+
when "\cU" # Clear line
|
567
572
|
line.size.times { output_erase_char } if question.echo
|
568
573
|
line = ""
|
569
|
-
|
574
|
+
when "\e" # Escape key
|
570
575
|
ignore_arrow_key
|
571
|
-
else
|
572
|
-
line
|
576
|
+
else # Any other character
|
577
|
+
line += character
|
573
578
|
say_last_char_or_echo_char(line, question)
|
574
579
|
end
|
575
580
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: highline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Edward Gray II
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -159,7 +158,6 @@ licenses:
|
|
159
158
|
- Ruby
|
160
159
|
metadata:
|
161
160
|
changelog_uri: https://github.com/JEG2/highline/blob/master/Changelog.md
|
162
|
-
post_install_message:
|
163
161
|
rdoc_options: []
|
164
162
|
require_paths:
|
165
163
|
- lib
|
@@ -174,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
172
|
- !ruby/object:Gem::Version
|
175
173
|
version: '0'
|
176
174
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
178
|
-
signing_key:
|
175
|
+
rubygems_version: 3.6.2
|
179
176
|
specification_version: 4
|
180
177
|
summary: HighLine is a high-level command-line IO library.
|
181
178
|
test_files: []
|