cl 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cl/ctx.rb +11 -3
- data/lib/cl/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: 1732005d9554c5a8323194e688843d1a03e24592
|
4
|
+
data.tar.gz: e6d7c13203a191445f1b8e4d185f49d7d881d863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f53a353ff9f071672235942a05765e8ba82ac4047f6b4d1d81a3ac0fc74ddcb4ba18c2cc8bcb76e56769d81579ab4a63ce890242a7c17d777618c6671fb34bd6
|
7
|
+
data.tar.gz: baea034a83e257053b1f51cb49b2c902d5f9be6ecec7a5c5e741f0d48abbce615aa347e978ddc2bb2d4621959870eb3dd4e3019540523d5bb46f09aa870fdb1c
|
data/lib/cl/ctx.rb
CHANGED
@@ -9,16 +9,24 @@ class Cl
|
|
9
9
|
def_delegators :ui, :puts, :stdout, :announce, :info, :notice, :warn,
|
10
10
|
:error, :success, :cmd
|
11
11
|
|
12
|
-
attr_accessor :config, :name, :
|
12
|
+
attr_accessor :config, :name, :opts
|
13
13
|
|
14
14
|
def initialize(name, opts = {})
|
15
15
|
@config = Config.new(name).to_h
|
16
|
-
@
|
16
|
+
@opts = opts
|
17
17
|
@name = name
|
18
18
|
end
|
19
19
|
|
20
|
+
def ui
|
21
|
+
@ui ||= opts[:ui] || Ui.new(self, opts)
|
22
|
+
end
|
23
|
+
|
20
24
|
def abort(error, *strs)
|
21
|
-
ui.abort(error, *strs)
|
25
|
+
abort? ? ui.abort(error, *strs) : raise(error)
|
26
|
+
end
|
27
|
+
|
28
|
+
def abort?
|
29
|
+
!opts[:abort].is_a?(FalseClass)
|
22
30
|
end
|
23
31
|
|
24
32
|
def test?
|
data/lib/cl/version.rb
CHANGED