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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dc957c24398353cf8247f3462d3af82168b0ba6601c9c690321fd826749709e
4
- data.tar.gz: becb6f0eeb7b8ec08bf61cad4206ddcd7ed5d9e44bd312b5f983f66b47b7aa60
3
+ metadata.gz: e1a24ee304e2743d872ff9fb582b95f18e765aec50298a68a5a18938a6193eea
4
+ data.tar.gz: 56d2e812ec72eabec8b4ebcf3a770d0265736bcb708bf752f8f7cbccce1e2a9a
5
5
  SHA512:
6
- metadata.gz: 0ed961a254e5df967983bd3590da488ba3c78e65dd599ed9290006b5083b6355215514c790a17686e66741c21a8411a8903bed51ac9f14b45d12638eef4c94ac
7
- data.tar.gz: b853518b2b4c27e10a91ae20126c37671a0ab7b19deea6f81874a1c49a56be4728fed94ee2925acc8d918531d4ca7aedf6616ff2cf4cdbc6db8a5c5736d64265
6
+ metadata.gz: 34ca9e238a339b15c7b115fbb27c88dffc786002cf68b2c1026138a5b17ac54138992456cf78336fe380deb7209396e22e944acd41bdf8e51173eece10b8bb86
7
+ data.tar.gz: 0323fff59428d70b72972e6acf66cabb353d1400b1fc10684331bdc159abaef93439ef61e7b2357315a4e17795788abccb796906f2ebcb77d7eb628ed542f136
@@ -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
@@ -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.1 / 2018-01-23
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
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  say("\nThis is letter indexing...")
35
35
  choose do |menu|
36
- menu.index = :letter
36
+ menu.index = :letter # Use :capital_letter for uppercase
37
37
  menu.index_suffix = ") "
38
38
 
39
39
  menu.prompt = "Please choose your favorite programming language? "
@@ -374,9 +374,10 @@ class HighLine
374
374
  end
375
375
 
376
376
  def map_items_by_index
377
- if @index == :letter
378
- l_index = "`"
379
- all_items.map { l_index.succ!.dup }
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
- ["#{('a'.ord + ix).chr}#{@index_suffix}", text]
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
@@ -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)
@@ -2,5 +2,5 @@
2
2
 
3
3
  class HighLine
4
4
  # The version of the installed library.
5
- VERSION = "2.0.1".freeze
5
+ VERSION = "2.0.2".freeze
6
6
  end
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.1
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-01-23 00:00:00.000000000 Z
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.6
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.