perennial 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/perennial.rb +1 -1
- data/lib/perennial/application.rb +5 -2
- metadata +2 -2
data/lib/perennial.rb
CHANGED
@@ -20,8 +20,11 @@ module Perennial
|
|
20
20
|
result.downcase[0] == ?y
|
21
21
|
end
|
22
22
|
|
23
|
-
def ask(question, default)
|
24
|
-
|
23
|
+
def ask(question, default = nil)
|
24
|
+
question_text = question.to_s.strip
|
25
|
+
question_text << " "
|
26
|
+
question_text << "(default: #{default}) " unless default.nil?
|
27
|
+
result = Readline.readline(question_text)
|
25
28
|
result.blank? ? default : result
|
26
29
|
end
|
27
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perennial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darcy Laycock
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-14 00:00:00 +08:00
|
13
13
|
default_executable: perennial
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|