highline 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/lib/highline.rb +10 -3
- data/lib/highline/menu.rb +4 -3
- data/lib/highline/system_extensions.rb +2 -0
- metadata +4 -15
data/CHANGELOG
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
Below is a complete listing of changes for each revision of HighLine.
|
4
4
|
|
5
|
+
== 1.6.2
|
6
|
+
|
7
|
+
* Correctly handle STDIN being closed before we receive any data (fix by
|
8
|
+
mleinart).
|
9
|
+
* Try if msvcrt, if we can't load crtdll on Windows (fix by pepijnve).
|
10
|
+
* A fix for nil_on_handled not running the action (reported by Andrew Davey).
|
11
|
+
|
5
12
|
== 1.6.1
|
6
13
|
|
7
14
|
* Fixed raw_no_echo_mode so that it uses stty -icanon rather than cbreak
|
data/lib/highline.rb
CHANGED
@@ -29,7 +29,7 @@ require "highline/color_scheme"
|
|
29
29
|
#
|
30
30
|
class HighLine
|
31
31
|
# The version of the installed library.
|
32
|
-
VERSION = "1.6.
|
32
|
+
VERSION = "1.6.2".freeze
|
33
33
|
|
34
34
|
# An internal HighLine error. User code does not need to trap this.
|
35
35
|
class QuestionError < StandardError
|
@@ -591,9 +591,16 @@ class HighLine
|
|
591
591
|
# work-around ugly readline() warnings
|
592
592
|
old_verbose = $VERBOSE
|
593
593
|
$VERBOSE = nil
|
594
|
+
raw_answer = Readline.readline(question, true)
|
595
|
+
if raw_answer.nil?
|
596
|
+
if @@track_eof
|
597
|
+
raise EOFError, "The input stream is exhausted."
|
598
|
+
else
|
599
|
+
raw_answer = String.new # Never return nil
|
600
|
+
end
|
601
|
+
end
|
594
602
|
answer = @question.change_case(
|
595
|
-
@question.remove_whitespace(
|
596
|
-
Readline.readline(question, true) ) )
|
603
|
+
@question.remove_whitespace(raw_answer))
|
597
604
|
$VERBOSE = old_verbose
|
598
605
|
|
599
606
|
answer
|
data/lib/highline/menu.rb
CHANGED
@@ -306,13 +306,14 @@ class HighLine
|
|
306
306
|
end
|
307
307
|
|
308
308
|
# Run or return it.
|
309
|
-
if not
|
309
|
+
if not action.nil?
|
310
310
|
@highline = highline_context
|
311
311
|
if @shell
|
312
|
-
action.call(name, details)
|
312
|
+
result = action.call(name, details)
|
313
313
|
else
|
314
|
-
action.call(name)
|
314
|
+
result = action.call(name)
|
315
315
|
end
|
316
|
+
@nil_on_handled ? nil : result
|
316
317
|
elsif action.nil?
|
317
318
|
name
|
318
319
|
else
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: highline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 1.6.1
|
4
|
+
prerelease:
|
5
|
+
version: 1.6.2
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- James Edward Gray II
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date:
|
13
|
+
date: 2011-05-13 00:00:00 -05:00
|
19
14
|
default_executable:
|
20
15
|
dependencies: []
|
21
16
|
|
@@ -84,23 +79,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
79
|
requirements:
|
85
80
|
- - ">="
|
86
81
|
- !ruby/object:Gem::Version
|
87
|
-
hash: 3
|
88
|
-
segments:
|
89
|
-
- 0
|
90
82
|
version: "0"
|
91
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
84
|
none: false
|
93
85
|
requirements:
|
94
86
|
- - ">="
|
95
87
|
- !ruby/object:Gem::Version
|
96
|
-
hash: 3
|
97
|
-
segments:
|
98
|
-
- 0
|
99
88
|
version: "0"
|
100
89
|
requirements: []
|
101
90
|
|
102
91
|
rubyforge_project: highline
|
103
|
-
rubygems_version: 1.
|
92
|
+
rubygems_version: 1.6.2
|
104
93
|
signing_key:
|
105
94
|
specification_version: 3
|
106
95
|
summary: HighLine is a high-level command-line IO library.
|