cl 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cl/ctx.rb +11 -3
  3. data/lib/cl/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95105c27487a964f369771303967d5d2be384e8d
4
- data.tar.gz: 400c2ed33af51c48e0e3375e165e1c4ff2b25e8e
3
+ metadata.gz: 1732005d9554c5a8323194e688843d1a03e24592
4
+ data.tar.gz: e6d7c13203a191445f1b8e4d185f49d7d881d863
5
5
  SHA512:
6
- metadata.gz: 3ab78eec6052ea36c538ba031ff5b386bee83a0155d69435b2f85a1e4ff6c3277a284833dddb93d959e267b0a381c62a5b68686220964487c502caefd0c5971d
7
- data.tar.gz: 2000822998fa8f6d2b1ffccb49cd806b608bed3f73931835b04d47aa3afc08bac4f28c7859dec4a76eeb7ded0f954e29439f3c7c6ce5cdf502cb8fb3a53c2893
6
+ metadata.gz: f53a353ff9f071672235942a05765e8ba82ac4047f6b4d1d81a3ac0fc74ddcb4ba18c2cc8bcb76e56769d81579ab4a63ce890242a7c17d777618c6671fb34bd6
7
+ data.tar.gz: baea034a83e257053b1f51cb49b2c902d5f9be6ecec7a5c5e741f0d48abbce615aa347e978ddc2bb2d4621959870eb3dd4e3019540523d5bb46f09aa870fdb1c
@@ -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, :ui
12
+ attr_accessor :config, :name, :opts
13
13
 
14
14
  def initialize(name, opts = {})
15
15
  @config = Config.new(name).to_h
16
- @ui = opts[:ui] || Ui.new(self, opts)
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?
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs