pullrequest 0.1.1 → 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/exe/pullrequest +1 -1
- data/lib/pullrequest/thor.rb +11 -0
- data/lib/pullrequest/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: f3671b03126b5e77bc0db16929de50cb9f23a167
|
4
|
+
data.tar.gz: 385b1058c05ca40ed0764614b7a2649cbd3482a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d72ebb849eadcb248acfd2c1383727b331d1bde14d2a7129af4bdc04123b05eb5b5cbd3eff4694db89abc6238b1a18fb716b16a5ca6988cbe09da79980d587f
|
7
|
+
data.tar.gz: 1f516570f4608a6b5a374e3437d155b7bfc26a3da31e4e6a097d8724aca7ff169bca66c3abb3303371fe02ed592719a050f5a73657506ad65588c5eafb075140
|
data/exe/pullrequest
CHANGED
data/lib/pullrequest/thor.rb
CHANGED
@@ -13,6 +13,8 @@ Thor::Shell::Basic.class_eval do
|
|
13
13
|
raise Thor::RequiredArgumentMissingError
|
14
14
|
end
|
15
15
|
response
|
16
|
+
rescue Interrupt
|
17
|
+
exit_gracefully
|
16
18
|
rescue Thor::RequiredArgumentMissingError
|
17
19
|
say "Error: required", :red
|
18
20
|
retry
|
@@ -21,10 +23,14 @@ Thor::Shell::Basic.class_eval do
|
|
21
23
|
|
22
24
|
def no?(statement, color = nil)
|
23
25
|
ask_bool('n', statement, color)
|
26
|
+
rescue Interrupt
|
27
|
+
exit_gracefully
|
24
28
|
end
|
25
29
|
|
26
30
|
def yes?(statement, color = nil)
|
27
31
|
ask_bool('y', statement, color)
|
32
|
+
rescue Interrupt
|
33
|
+
exit_gracefully
|
28
34
|
end
|
29
35
|
|
30
36
|
private
|
@@ -32,4 +38,9 @@ Thor::Shell::Basic.class_eval do
|
|
32
38
|
def ask_bool(y_or_n, statement, color)
|
33
39
|
ask_original(statement, color, add_to_history: false, limited_to: %w[yes no y n])[0] == y_or_n
|
34
40
|
end
|
41
|
+
|
42
|
+
def exit_gracefully
|
43
|
+
say "[cancelled]", :red
|
44
|
+
exit 0
|
45
|
+
end
|
35
46
|
end
|
data/lib/pullrequest/version.rb
CHANGED