highline 2.0.0.pre.develop.12 → 2.0.0.pre.develop.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +4 -1
- data/lib/highline.rb +0 -9
- data/lib/highline/question.rb +9 -0
- data/lib/highline/question_asker.rb +2 -2
- data/lib/highline/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15f4a2a4093aa40f67585d304e451b7015ef098d
|
4
|
+
data.tar.gz: 3a192714c98631c7ec8263993fa3effa8f1c36b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6544dfa49255c98a453fcde92a5da742bc22bf3f02553f648f8c7568e04a67a524fbfe6cf325ed009f3a00fbcbb30777707db243f87bc3cfe2a946ddb71b04a1
|
7
|
+
data.tar.gz: d5d06ecbb06d9d062a5b344cac7de0e547b0ef3122e895131d5f56ab7beb4f3a637e58b5af3755c6ad7f836c1e10ec97e9019f73011d26237158eb50f9877627
|
data/Changelog.md
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
Below is a complete listing of changes for each revision of HighLine.
|
4
4
|
|
5
|
-
###
|
5
|
+
### 2.0.0-develop.13 / 2017-11-05
|
6
|
+
* PR #219 - Make possible to use a callable as response (@abinoam)
|
7
|
+
|
8
|
+
### 2.0.0-develop.12 / 2017-10-19
|
6
9
|
* PR #218 - Ease transition from 1.7.x to 2.0.x (@abinoam)
|
7
10
|
* Copy use_color from HighLine.default_instance
|
8
11
|
* Expose IOConsoleCompatible
|
data/lib/highline.rb
CHANGED
@@ -479,15 +479,6 @@ class HighLine
|
|
479
479
|
|
480
480
|
private
|
481
481
|
|
482
|
-
#
|
483
|
-
# A helper method for sending the output stream and error and repeat
|
484
|
-
# of the question.
|
485
|
-
#
|
486
|
-
def explain_error(error, question)
|
487
|
-
say(question.final_responses[error]) if error
|
488
|
-
say(question.ask_on_error_msg)
|
489
|
-
end
|
490
|
-
|
491
482
|
# Adds a layer of scope (new_scope) to ask a question inside a
|
492
483
|
# question, without destroying instance data
|
493
484
|
def confirm(question)
|
data/lib/highline/question.rb
CHANGED
@@ -289,6 +289,15 @@ class HighLine
|
|
289
289
|
@internal_responses.merge(@user_responses)
|
290
290
|
end
|
291
291
|
|
292
|
+
def final_response(error)
|
293
|
+
response = final_responses[error]
|
294
|
+
if response.respond_to?(:call)
|
295
|
+
response.call(answer)
|
296
|
+
else
|
297
|
+
response
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
292
301
|
#
|
293
302
|
# Returns the provided _answer_string_ after changing character case by
|
294
303
|
# the rules of this Question. Valid settings for whitespace are:
|
@@ -114,8 +114,8 @@ class HighLine
|
|
114
114
|
private
|
115
115
|
|
116
116
|
## Delegate to Highline
|
117
|
-
def explain_error(
|
118
|
-
@highline.say(question.
|
117
|
+
def explain_error(explanation_key) # eg: :not_valid, :not_in_range
|
118
|
+
@highline.say(question.final_response(explanation_key))
|
119
119
|
@highline.say(question.ask_on_error_msg)
|
120
120
|
end
|
121
121
|
|
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.0.pre.develop.
|
4
|
+
version: 2.0.0.pre.develop.13
|
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: 2017-
|
11
|
+
date: 2017-11-05 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: 1.3.1
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.6.
|
148
|
+
rubygems_version: 2.6.14
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: HighLine is a high-level command-line IO library.
|