kanal 0.6.0 → 0.7.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: af8a33084b0e457be1bd9538405b4c885d624d71c67581dc1393474037e9c09b
4
- data.tar.gz: 2ffae451a04fb4cd5c13079b8bbabcf14b2298fe3bbce681710409fc8da74c5f
3
+ metadata.gz: b5be4ebd90337cb14ed84dcb5fec86bf2540997335af7ba27a5f23e17248bbb8
4
+ data.tar.gz: bbf992c6866512b63ced1eff0bb95dc08193defaf789c1e5224305260ea01886
5
5
  SHA512:
6
- metadata.gz: '0844b50cab451ba9eb5fd2632d2cdab50e8b8260e1a120697a637772be613fbc5cb9504e60c42acf131cc9ad9e84b167e768363b53255bd1b9a4ff172616b9d2'
7
- data.tar.gz: 3efa7140827918ebc21c954bec87f57bd7dd57d2b3475d8be8ad065660af73cb7d7651cc0d7715f39a07a66accf8f4671707716c98e744eec50bfef9340396e6
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kanal (0.6.0)
4
+ kanal (0.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanal
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
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.6.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-24 00:00:00.000000000 Z
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