kanal 0.6.0 → 0.7.0
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/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/kanal/plugins/batteries/batteries_plugin.rb +10 -0
- data/lib/kanal/plugins/batteries/specifics.rb +34 -0
- data/lib/kanal/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5be4ebd90337cb14ed84dcb5fec86bf2540997335af7ba27a5f23e17248bbb8
|
4
|
+
data.tar.gz: bbf992c6866512b63ced1eff0bb95dc08193defaf789c1e5224305260ea01886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b89fd5d0408dca8af38358825ced60ca32de676097454fb8f818ab914eb459f8176057723aa73338f2ea3765afe20dc18e8076c571ed897e2ad811016d60f192
|
7
|
+
data.tar.gz: b9534af10b6c79218cd7a2c673a95d10e2a5b83336aee2f60de2bb669e98c9c5b75e7ca981e1c58defc4171635f43095b2b89d10d67ee12d6e5fb4f2ba18f421
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.7.0] 2023-04-25
|
4
|
+
- new output property for batteries: specifics. You can now add specific properties for whatever purpose like specifics.add, specifics.get. specifics.has?
|
5
|
+
|
3
6
|
## [0.6.0] 2023-04-24
|
4
7
|
- .composite_logger method for core now gives possibility to take that logger and provide it as ruby logger somewhere in the other library (usually to flow some libraries used in your kanal app logs into the kanal logs to have logs in the same place)
|
5
8
|
- you can now get beautified router info in string format for debug purpose via router.routes_info_string method
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "kanal/core/plugins/plugin"
|
4
4
|
require_relative "keyboard"
|
5
|
+
require_relative "specifics"
|
5
6
|
|
6
7
|
module Kanal
|
7
8
|
module Plugins
|
@@ -23,6 +24,7 @@ module Kanal
|
|
23
24
|
keyboard_batteries core
|
24
25
|
username_batteries core
|
25
26
|
button_batteries core
|
27
|
+
specifics_batteries core
|
26
28
|
end
|
27
29
|
|
28
30
|
def flow_batteries(core)
|
@@ -237,6 +239,14 @@ module Kanal
|
|
237
239
|
end
|
238
240
|
end
|
239
241
|
end
|
242
|
+
|
243
|
+
def specifics_batteries(core)
|
244
|
+
core.register_output_parameter :specifics
|
245
|
+
|
246
|
+
core.hooks.attach :output_just_created do |input, output|
|
247
|
+
output.specifics = Specifics.new
|
248
|
+
end
|
249
|
+
end
|
240
250
|
end
|
241
251
|
end
|
242
252
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "kanal/core/logging/composite_logger"
|
4
|
+
|
5
|
+
module Kanal
|
6
|
+
module Plugins
|
7
|
+
module Batteries
|
8
|
+
#
|
9
|
+
# This class provides possibility to store custom key-value pairs in outputs
|
10
|
+
#
|
11
|
+
class Specifics
|
12
|
+
include Kanal::Core::Logging
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@specifics = {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def add(specific_name, specific_value)
|
19
|
+
@specifics[specific_name] = specific_value
|
20
|
+
end
|
21
|
+
|
22
|
+
def get(specific_name)
|
23
|
+
return nil unless has? specific_name
|
24
|
+
|
25
|
+
@specifics[specific_name]
|
26
|
+
end
|
27
|
+
|
28
|
+
def has?(specific_name)
|
29
|
+
@specifics.key? specific_name
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/kanal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- idchlife
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Thanks to the core library, ecosystem of Kanal tools can be extendted
|
14
14
|
to use with input-output bot-like behaviour, with routing
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/kanal/plugins/batteries/attachments/attachment.rb
|
64
64
|
- lib/kanal/plugins/batteries/batteries_plugin.rb
|
65
65
|
- lib/kanal/plugins/batteries/keyboard.rb
|
66
|
+
- lib/kanal/plugins/batteries/specifics.rb
|
66
67
|
- lib/kanal/version.rb
|
67
68
|
- lib/shortcuts.rb
|
68
69
|
- sig/kanal.rbs
|