highline 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/Changelog.md +9 -1
- data/examples/menus.rb +1 -1
- data/lib/highline/menu.rb +8 -6
- data/lib/highline/terminal.rb +0 -2
- data/lib/highline/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1a24ee304e2743d872ff9fb582b95f18e765aec50298a68a5a18938a6193eea
|
4
|
+
data.tar.gz: 56d2e812ec72eabec8b4ebcf3a770d0265736bcb708bf752f8f7cbccce1e2a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34ca9e238a339b15c7b115fbb27c88dffc786002cf68b2c1026138a5b17ac54138992456cf78336fe380deb7209396e22e944acd41bdf8e51173eece10b8bb86
|
7
|
+
data.tar.gz: 0323fff59428d70b72972e6acf66cabb353d1400b1fc10684331bdc159abaef93439ef61e7b2357315a4e17795788abccb796906f2ebcb77d7eb628ed542f136
|
data/.travis.yml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
---
|
2
2
|
language: ruby
|
3
3
|
dist: trusty
|
4
|
-
sudo: false
|
5
4
|
cache: bundler
|
6
5
|
script: "bundle exec rake test"
|
7
6
|
rvm:
|
@@ -31,6 +30,9 @@ matrix:
|
|
31
30
|
- rvm: 2.5
|
32
31
|
before_install:
|
33
32
|
- gem install bundler
|
33
|
+
- rvm: 2.6
|
34
|
+
before_install:
|
35
|
+
- gem install bundler
|
34
36
|
- rvm: ruby-head
|
35
37
|
before_install:
|
36
38
|
- gem install bundler
|
data/Changelog.md
CHANGED
@@ -2,7 +2,15 @@
|
|
2
2
|
|
3
3
|
Below is a complete listing of changes for each revision of HighLine.
|
4
4
|
|
5
|
-
### 2.0.
|
5
|
+
### 2.0.2 / 2019-04-08
|
6
|
+
* PR #243 - Add new capital_letter option to menu index (@Ana06)
|
7
|
+
* This is a really special PR. It has come from "The Biggest
|
8
|
+
Mobprogramming Session Ever" and around 250 people
|
9
|
+
participated in crafting it!
|
10
|
+
* PR #241 - CI: Add 2.6 (@olleolleolle)
|
11
|
+
* PR #240 - Avoid YARD warning UnknownParam (@olleolleolle)
|
12
|
+
|
13
|
+
### 2.0.1 / 2019-01-23
|
6
14
|
* PR #238 / I #237 - Rescue Errno::ENOTTY when pipeing
|
7
15
|
|
8
16
|
### 2.0.0 / 2018-06-10
|
data/examples/menus.rb
CHANGED
data/lib/highline/menu.rb
CHANGED
@@ -374,9 +374,10 @@ class HighLine
|
|
374
374
|
end
|
375
375
|
|
376
376
|
def map_items_by_index
|
377
|
-
if @index
|
378
|
-
|
379
|
-
|
377
|
+
if [:letter, :capital_letter].include?(@index)
|
378
|
+
# @ and ` are the previous ASCII characters to A and a respectively
|
379
|
+
prev_char = (@index == :capital_letter ? '@' : '`')
|
380
|
+
all_items.map { prev_char.succ!.dup }
|
380
381
|
else
|
381
382
|
(1..all_items.size).map(&:to_s)
|
382
383
|
end
|
@@ -436,7 +437,7 @@ class HighLine
|
|
436
437
|
|
437
438
|
# 97 is the "a" letter at ascii table
|
438
439
|
# Ex: For "a" it will return 0, and for "c" it will return 2
|
439
|
-
index = selection.ord - 97
|
440
|
+
index = selection.downcase.ord - 97
|
440
441
|
items[index]
|
441
442
|
end
|
442
443
|
|
@@ -517,8 +518,9 @@ class HighLine
|
|
517
518
|
case @index
|
518
519
|
when :number
|
519
520
|
["#{ix + 1}#{@index_suffix}", text]
|
520
|
-
when :letter
|
521
|
-
|
521
|
+
when :letter, :capital_letter
|
522
|
+
first_letter = (@index == :capital_letter ? 'A' : 'a')
|
523
|
+
["#{(first_letter.ord + ix).chr}#{@index_suffix}", text]
|
522
524
|
when :none
|
523
525
|
[text, ""]
|
524
526
|
else
|
data/lib/highline/terminal.rb
CHANGED
@@ -81,7 +81,6 @@ class HighLine
|
|
81
81
|
# Use readline if question has readline mode set.
|
82
82
|
# @param question [HighLine::Question]
|
83
83
|
# @param highline [HighLine]
|
84
|
-
# @param options [Hash]
|
85
84
|
def get_line(question, highline)
|
86
85
|
raw_answer =
|
87
86
|
if question.readline
|
@@ -108,7 +107,6 @@ class HighLine
|
|
108
107
|
end
|
109
108
|
|
110
109
|
# Use readline to read one line
|
111
|
-
# @param prompt [String] Readline prompt
|
112
110
|
# @param question [HighLine::Question] question from where to get
|
113
111
|
# autocomplete candidate strings
|
114
112
|
def readline_read(question)
|
data/lib/highline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: highline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Edward Gray II
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.7.
|
148
|
+
rubygems_version: 2.7.9
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: HighLine is a high-level command-line IO library.
|