power-rake 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/power-rake/common.rb +2 -15
- data/lib/power-rake/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39dc079dd672e08a45cc21168c164a1eb16551cd
|
4
|
+
data.tar.gz: 58a173ccf76be578abf8f33b6213b45a45cebc03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c113ea7d6f754dff558e5415f8fd3a8aade99bff0a5cba90665e368ed8e92a7a79dddb140d4fec0995ea713a48b422de2d314d23ee6d32208a6127446379d1b0
|
7
|
+
data.tar.gz: c5c6d0513ea3e50d9ddbf143f538d988f141a04170af38902ada61559ab3a074d1a9eb5ff79baadb15a9f24618266f3c557cacbbdbac6adc68b240f619d352b3
|
data/lib/power-rake/common.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
# Prompt with control flow
|
4
4
|
# @param [String]
|
5
|
-
def continue?(message = 'Continue? (y|n)')
|
6
|
-
abort 'Aborted!' unless prompt(message)
|
5
|
+
def continue?(message = 'Continue? (y|n)', expectation = 'y')
|
6
|
+
abort 'Aborted!' unless prompt(message) == 'y'
|
7
7
|
end
|
8
8
|
|
9
9
|
# Inline message prompt
|
@@ -12,16 +12,3 @@ def prompt(*args)
|
|
12
12
|
value = STDIN.gets.strip
|
13
13
|
value unless value.empty?
|
14
14
|
end
|
15
|
-
|
16
|
-
# Try a system command
|
17
|
-
# @param [string]
|
18
|
-
def try(command)
|
19
|
-
system(command) || abort("Aborted! `#{command}`")
|
20
|
-
end
|
21
|
-
|
22
|
-
# Prompt before trying a system command
|
23
|
-
# @param [string]
|
24
|
-
def try?(command)
|
25
|
-
continue? "#{command}\nContinue? (y|n)"
|
26
|
-
try(command)
|
27
|
-
end
|
data/lib/power-rake/version.rb
CHANGED