kybus-core 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b529750655edb3e735cdb5e3faa8a271b4f17eb5bb87aedbbf6b597fa5455c07
4
- data.tar.gz: 73c8d3cdd8b32e064bd89301245b1a7bceb86d641b25d50fe6b48e8ff5c4ba09
3
+ metadata.gz: cd55b83dbc2c6e862925f961aa4fec0cb29203e259e272594bd88d1ec3d7c129
4
+ data.tar.gz: f534b7e922576f5aa7441cf8e9936a47aa0c5b8b0de660e9735dbca1d846449f
5
5
  SHA512:
6
- metadata.gz: 166f6bbd1a7328400eb4a8fec8dd3e0d9b69e7f7f2688cdca44a4aed7e9da52113c6a139b7e074994e83007b784a0f241b7ae7b89e6791a3bb3356de1284aca9
7
- data.tar.gz: bcf6ce87492aedc4f44e9d41213d52059519a4d93f83ee424efd3804819ff55e1f880d67e078b07d3bb7058fa73a84fde5e2035ce567d91a3be10d6f11917e7c
6
+ metadata.gz: 4647c134aae920e83eba384e3404a9820ee2a604875591e157f69a8ba4328039ef4894a23b869df6d01da876935ca896962ade60e9cdc5f5ceeb5b5e770a0cf3
7
+ data.tar.gz: 43a844b37b6479368c0ebbc67a9b027c4e33d595bb0bdcc7007e7182a6dfbeb227cc34e60367a851147222b386f7f053271d691b9dc0dcad3a6dd499716081d2
@@ -13,8 +13,8 @@ module Kybus
13
13
  class Daemon
14
14
  include Kybus::Logger
15
15
 
16
- def initialize(wait_time, attach, retry_on_failure = false)
17
- @proc = -> { yield }
16
+ def initialize(wait_time, attach, retry_on_failure = false, &block)
17
+ @proc = block
18
18
  @wait_time = wait_time
19
19
  @attach = attach
20
20
  @retry_on_failure = retry_on_failure
@@ -61,6 +61,14 @@ module Kybus
61
61
 
62
62
  res
63
63
  end
64
+
65
+ def unsafe_resource(key, subkey = nil)
66
+ if subkey.nil?
67
+ subkey = key
68
+ key = :root
69
+ end
70
+ resources(key)[subkey]
71
+ end
64
72
  end
65
73
  end
66
74
  end
@@ -17,10 +17,12 @@ module Kybus
17
17
  # @param data. Contains additional data to detail the error.
18
18
  class AntBaseException < StandardError
19
19
  attr_reader :message, :code, :data
20
+
20
21
  def initialize(message, code, data)
21
22
  @message = message
22
23
  @code = code
23
24
  @data = data
25
+ super(message)
24
26
  end
25
27
 
26
28
  def to_log_format
@@ -29,10 +31,10 @@ module Kybus
29
31
 
30
32
  def to_h
31
33
  {
32
- message: message,
33
- code: code,
34
- data: data,
35
- backtrace: backtrace
34
+ message:,
35
+ code:,
36
+ data:,
37
+ backtrace:
36
38
  }
37
39
  end
38
40
  end
data/lib/kybus/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kybus
4
4
  module Core
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kybus-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilberto Vargas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-15 00:00:00.000000000 Z
11
+ date: 2022-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kybus-logger
@@ -155,7 +155,8 @@ files:
155
155
  homepage: https://github.com/tachomex/kybus
156
156
  licenses:
157
157
  - MIT
158
- metadata: {}
158
+ metadata:
159
+ rubygems_mfa_required: 'true'
159
160
  post_install_message:
160
161
  rdoc_options: []
161
162
  require_paths:
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
172
  - !ruby/object:Gem::Version
172
173
  version: '0'
173
174
  requirements: []
174
- rubygems_version: 3.1.4
175
+ rubygems_version: 3.3.7
175
176
  signing_key:
176
177
  specification_version: 4
177
178
  summary: Kybus framework core functionality