excadg 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/bin/excadg +1 -3
- data/lib/excadg/log.rb +18 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1081c1531553e5ca9113aab9d0f8dfaa7982438438f646df74fded7a17ec0e99
|
4
|
+
data.tar.gz: 88d4ecf74086eddcea280c44844c47097aeca252b6f9170f585f0516368928f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a086d015c957d0b86ecf3ec8de789aa4f151ea1687c6ddde4f5454b28ea1f4737bafc1f81ccac9dd0a1fed45603c6fae8dfc71649dcbe383f8cb9baf3f887e70
|
7
|
+
data.tar.gz: 394abc39d249922bd7eec046e748673e0ad7eb294f3c91db5a15bbea26a99486f159a55411f1baed09c80f6e3e919654bce87eb97a441461c9b97e464ee97b96
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Another feature is that the graph is dynamic and any vertex could produce anothe
|
|
8
8
|
|
9
9
|
## Tool
|
10
10
|
|
11
|
-
There is a tool script in
|
11
|
+
There is a tool script in `bin` folder called `excadg`. Run `./bin/excadg --help` for available options.
|
12
12
|
It allows to make and run basic payload graphs specified by a YAML config. See [config/](config/) folder for sample configs.
|
13
13
|
|
14
14
|
## Framework
|
@@ -132,6 +132,10 @@ Second way is built-in. Vertex invokes payload with {ExcADG::Array} of dependenc
|
|
132
132
|
> Be mindful about data your payload receives (args) and returns (state data). It could appear incompatible with ractors and cause vertice to fail.
|
133
133
|
> Although these failures are hard to tell beforehand, [state machine](#statemachine) processes them gracefully.
|
134
134
|
|
135
|
+
## {ExcADG::Log}
|
136
|
+
|
137
|
+
The library has its own logger based on Ractors. You could call {ExcADG::Log#unmute} to enable these logs.
|
138
|
+
|
135
139
|
# Development
|
136
140
|
|
137
141
|
The project is based on RVM => there is a .ruby-gemset file.
|
@@ -159,9 +163,7 @@ Commands to run tests:
|
|
159
163
|
> there is no consistent set of suites, tags are used to exclude mutually incompatible tests or e.g. perfomance tests
|
160
164
|
> search for `config.filter_run_excluding` in [spec/spec_helper.rb](spec/spec_helper.rb) to see what tests are disabled by default
|
161
165
|
|
162
|
-
|
163
|
-
|
164
|
-
Most of the tests have loggin stubbed to avoid noize. Comment out either `stub_loogging` or `Log.mute` in the respective spec file to enable logging for it.
|
166
|
+
Logging is disabled by default, but it could be useful to debug tests. Add `ExcADG::Log.unmute` to `spec/spec_helper.rb` to enable logs.
|
165
167
|
|
166
168
|
# Docs
|
167
169
|
|
@@ -182,7 +184,6 @@ Most of the tests have loggin stubbed to avoid noize. Comment out either `stub_l
|
|
182
184
|
- problem: can't find what to suspend
|
183
185
|
- make a loop payload template
|
184
186
|
- provide a mechanism to control # of children
|
185
|
-
- avoid initializing Log on require
|
186
187
|
|
187
188
|
## Graph checks
|
188
189
|
|
data/bin/excadg
CHANGED
data/lib/excadg/log.rb
CHANGED
@@ -7,11 +7,10 @@ require_relative 'assertions'
|
|
7
7
|
module ExcADG
|
8
8
|
# logging support
|
9
9
|
module Log
|
10
|
-
# ractor-based logger
|
11
|
-
# this ractor logger receives messages from other ractors and log them
|
12
|
-
#
|
13
|
-
# @param
|
14
|
-
# @param level - one of the Logger's log levels
|
10
|
+
# ractor-based logger,
|
11
|
+
# this ractor logger receives messages from other ractors and log them,
|
12
|
+
# @param dest what to write logs to, $stdout by default, gets interpret as filename unless IO
|
13
|
+
# @param level one of the Logger's log levels
|
15
14
|
class RLogger < Ractor
|
16
15
|
def self.new dest: $stdout, level: Logger::INFO
|
17
16
|
super(dest, level) { |dest, level|
|
@@ -29,6 +28,12 @@ module ExcADG
|
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
31
|
+
# default logger
|
32
|
+
@main = RLogger.new
|
33
|
+
|
34
|
+
# logging is muted by default
|
35
|
+
@muted = true
|
36
|
+
|
32
37
|
def self.method_missing(method, *args, &_block)
|
33
38
|
return if @muted
|
34
39
|
|
@@ -43,19 +48,22 @@ module ExcADG
|
|
43
48
|
true
|
44
49
|
end
|
45
50
|
|
46
|
-
# default logger
|
47
|
-
|
48
|
-
@muted = false
|
49
|
-
|
50
|
-
# replaces default logger with a custom logger
|
51
|
+
# replaces default logger with a custom one
|
52
|
+
# and unmutes logging
|
51
53
|
def self.logger new_logger
|
52
54
|
Assertions.is_a? new_logger, RLogger
|
53
55
|
@main = new_logger
|
56
|
+
unmute
|
54
57
|
end
|
55
58
|
|
56
59
|
# mute logging by ignoring all incoming log requests
|
57
60
|
def self.mute
|
58
61
|
@muted = true
|
59
62
|
end
|
63
|
+
|
64
|
+
# unmute logging for new messages
|
65
|
+
def self.unmute
|
66
|
+
@muted = false
|
67
|
+
end
|
60
68
|
end
|
61
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excadg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- skorobogatydmitry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rgl
|