kojo 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kojo +3 -0
- data/lib/kojo/exceptions.rb +1 -0
- data/lib/kojo/extensions/string.rb +10 -5
- data/lib/kojo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a6675eb6aa7317e160722d8070a9fca5d772f49a18e6d3fd29687dd294116a
|
4
|
+
data.tar.gz: 6c3289e8c830dacb8aefc87fc4fbbc4efec17c000aabd3a10743fa6f083d59db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3dbed142076b6a0f5d3603cd033f8ef7b7e720c5fc1cfdb59b833c35856560193d40b3a061c1ab4087a8a5175ed2a1d4553d251011a2044f396e6338c50c43
|
7
|
+
data.tar.gz: d918c15cdf9cb1b07841b6c19a2bc9fd789155a796d5ad490780397111f4735c34f0fe7097d5e5cc0cc02cba0d198a23d8687b136e37ff304d0c9d9d4484c0d7
|
data/bin/kojo
CHANGED
data/lib/kojo/exceptions.rb
CHANGED
@@ -21,12 +21,17 @@ class String
|
|
21
21
|
|
22
22
|
rescue KeyError => e
|
23
23
|
print "> #{e.key}: "
|
24
|
-
|
25
|
-
|
26
|
-
raise Kojo::TemplateError, e.message unless response
|
27
|
-
|
28
|
-
vars[e.key] = response.chomp
|
24
|
+
vars[e.key] = get_user_input
|
29
25
|
retry
|
30
26
|
end
|
31
27
|
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_user_input
|
31
|
+
response = $stdin.gets
|
32
|
+
raise Kojo::Interrupt unless response # Ctrl+D
|
33
|
+
response.chomp
|
34
|
+
rescue Interrupt # Ctrl+C
|
35
|
+
raise Kojo::Interrupt
|
36
|
+
end
|
32
37
|
end
|
data/lib/kojo/version.rb
CHANGED