kanal-plugins-batteries_bridge 0.1.0 → 0.1.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd56bdc7f63745bcde175d39f7e5ebd04b77199bba84922579531481227b5417
|
4
|
+
data.tar.gz: fb26860cd234da3ac7dd5115790ee229dc4ccef8fffd6d142e439f72e0ef0a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f59836166c2b7f277f8638172d48a74625b19be641aca20b9a94a15833022ca26609569e32d3a9a15537127baf0b44c82cc6dfca80f255c6f6e95ad982793e17
|
7
|
+
data.tar.gz: 3aa2f4559b18119ccc3782ea0022a88958a511a8c8fec34ff6ce6e78a9086eaa6143cb2e719d381017faad614aa90d2f83bfd8f2f7bdbd3227ba5dfcfa34010c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kanal-plugins-batteries_bridge (0.1.
|
4
|
+
kanal-plugins-batteries_bridge (0.1.1)
|
5
|
+
kanal (>= 0.4.2)
|
6
|
+
kanal-interfaces-telegram (>= 0.3.4)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
@@ -9,15 +11,46 @@ GEM
|
|
9
11
|
ast (2.4.2)
|
10
12
|
backport (1.2.0)
|
11
13
|
benchmark (0.2.1)
|
14
|
+
concurrent-ruby (1.2.2)
|
12
15
|
diff-lcs (1.5.0)
|
16
|
+
dry-core (1.0.0)
|
17
|
+
concurrent-ruby (~> 1.0)
|
18
|
+
zeitwerk (~> 2.6)
|
19
|
+
dry-inflector (1.0.0)
|
20
|
+
dry-logic (1.5.0)
|
21
|
+
concurrent-ruby (~> 1.0)
|
22
|
+
dry-core (~> 1.0, < 2)
|
23
|
+
zeitwerk (~> 2.6)
|
24
|
+
dry-struct (1.6.0)
|
25
|
+
dry-core (~> 1.0, < 2)
|
26
|
+
dry-types (>= 1.7, < 2)
|
27
|
+
ice_nine (~> 0.11)
|
28
|
+
zeitwerk (~> 2.6)
|
29
|
+
dry-types (1.7.1)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
dry-core (~> 1.0)
|
32
|
+
dry-inflector (~> 1.0)
|
33
|
+
dry-logic (~> 1.4)
|
34
|
+
zeitwerk (~> 2.6)
|
13
35
|
e2mmap (0.1.0)
|
36
|
+
faraday (2.7.4)
|
37
|
+
faraday-net_http (>= 2.0, < 3.1)
|
38
|
+
ruby2_keywords (>= 0.0.4)
|
39
|
+
faraday-multipart (1.0.4)
|
40
|
+
multipart-post (~> 2)
|
41
|
+
faraday-net_http (3.0.2)
|
42
|
+
ice_nine (0.11.2)
|
14
43
|
jaro_winkler (1.5.4)
|
15
44
|
json (2.6.3)
|
16
|
-
kanal (0.4.
|
45
|
+
kanal (0.4.3)
|
46
|
+
kanal-interfaces-telegram (0.3.4)
|
47
|
+
kanal (= 0.4.3)
|
48
|
+
telegram-bot-ruby (= 1.0.0)
|
17
49
|
kramdown (2.4.0)
|
18
50
|
rexml
|
19
51
|
kramdown-parser-gfm (1.1.0)
|
20
52
|
kramdown (~> 2.0)
|
53
|
+
multipart-post (2.3.0)
|
21
54
|
nokogiri (1.14.2-x86_64-darwin)
|
22
55
|
racc (~> 1.4)
|
23
56
|
nokogiri (1.14.2-x86_64-linux)
|
@@ -60,6 +93,7 @@ GEM
|
|
60
93
|
ruby-debug-ide (0.7.3)
|
61
94
|
rake (>= 0.8.1)
|
62
95
|
ruby-progressbar (1.13.0)
|
96
|
+
ruby2_keywords (0.0.5)
|
63
97
|
solargraph (0.48.0)
|
64
98
|
backport (~> 1.2)
|
65
99
|
benchmark
|
@@ -75,19 +109,25 @@ GEM
|
|
75
109
|
thor (~> 1.0)
|
76
110
|
tilt (~> 2.0)
|
77
111
|
yard (~> 0.9, >= 0.9.24)
|
112
|
+
telegram-bot-ruby (1.0.0)
|
113
|
+
dry-struct (~> 1.6)
|
114
|
+
faraday (~> 2.0)
|
115
|
+
faraday-multipart (~> 1.0)
|
116
|
+
zeitwerk (~> 2.6)
|
78
117
|
thor (1.2.1)
|
79
118
|
tilt (2.1.0)
|
80
119
|
unicode-display_width (2.4.2)
|
81
120
|
webrick (1.7.0)
|
82
121
|
yard (0.9.28)
|
83
122
|
webrick (~> 1.7.0)
|
123
|
+
zeitwerk (2.6.7)
|
84
124
|
|
85
125
|
PLATFORMS
|
86
126
|
x86_64-darwin-21
|
127
|
+
x86_64-darwin-22
|
87
128
|
x86_64-linux
|
88
129
|
|
89
130
|
DEPENDENCIES
|
90
|
-
kanal (>= 0.4.2)
|
91
131
|
kanal-plugins-batteries_bridge!
|
92
132
|
rake (~> 13.0)
|
93
133
|
rspec (~> 3.0)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "kanal"
|
4
4
|
require "kanal/plugins/batteries/attachments/attachment"
|
5
5
|
require_relative "./bridge"
|
6
|
+
require "telegram/bot"
|
6
7
|
|
7
8
|
module Kanal
|
8
9
|
module Plugins
|
@@ -18,6 +19,10 @@ module Kanal
|
|
18
19
|
val
|
19
20
|
end
|
20
21
|
|
22
|
+
input_convert :tg_username, :username do |val|
|
23
|
+
val
|
24
|
+
end
|
25
|
+
|
21
26
|
input_convert :tg_button_pressed, :button_pressed do |val|
|
22
27
|
val
|
23
28
|
end
|
@@ -58,8 +63,22 @@ module Kanal
|
|
58
63
|
val
|
59
64
|
end
|
60
65
|
|
61
|
-
output_convert :keyboard, :tg_reply_markup do |
|
62
|
-
|
66
|
+
output_convert :keyboard, :tg_reply_markup do |keyboard_object|
|
67
|
+
nil if keyboard_object.nil? || !keyboard_object.to_a.count.positive?
|
68
|
+
|
69
|
+
inline_keyboard = []
|
70
|
+
|
71
|
+
keyboard_object.to_a.each do |row_of_button_names|
|
72
|
+
row_of_buttons = []
|
73
|
+
|
74
|
+
row_of_button_names.each do |button_name|
|
75
|
+
row_of_buttons << Telegram::Bot::Types::InlineKeyboardButton.new(text: button_name, callback_data: button_name)
|
76
|
+
end
|
77
|
+
|
78
|
+
inline_keyboard << row_of_buttons
|
79
|
+
end
|
80
|
+
|
81
|
+
Telegram::Bot::Types::InlineKeyboardMarkup.new inline_keyboard: inline_keyboard
|
63
82
|
end
|
64
83
|
end
|
65
84
|
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanal-plugins-batteries_bridge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- idchlife
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03
|
12
|
-
dependencies:
|
11
|
+
date: 2023-04-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: kanal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.4.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.4.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: kanal-interfaces-telegram
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.4
|
13
41
|
description: This plugin provides transformation between different interface properties
|
14
42
|
(e.g. tg_audio, tg_image) to batteries properties. Input and also output
|
15
43
|
email:
|
@@ -28,7 +56,6 @@ files:
|
|
28
56
|
- LICENSE.txt
|
29
57
|
- README.md
|
30
58
|
- Rakefile
|
31
|
-
- kanal-plugins-batteries_bridge.gemspec
|
32
59
|
- lib/kanal/plugins/batteries_bridge.rb
|
33
60
|
- lib/kanal/plugins/batteries_bridge/batteries_bridge_plugin.rb
|
34
61
|
- lib/kanal/plugins/batteries_bridge/bridges/bridge.rb
|
@@ -43,7 +70,7 @@ metadata:
|
|
43
70
|
homepage_uri: https://github.com/idchlife/kanal-plugins-batteries_bridge
|
44
71
|
source_code_uri: https://github.com/idchlife/kanal-plugins-batteries_bridge
|
45
72
|
changelog_uri: https://github.com/idchlife/kanal-plugins-batteries_bridge/CHANGELOG.md
|
46
|
-
post_install_message:
|
73
|
+
post_install_message:
|
47
74
|
rdoc_options: []
|
48
75
|
require_paths:
|
49
76
|
- lib
|
@@ -59,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
86
|
version: '0'
|
60
87
|
requirements: []
|
61
88
|
rubygems_version: 3.1.6
|
62
|
-
signing_key:
|
89
|
+
signing_key:
|
63
90
|
specification_version: 4
|
64
91
|
summary: Bridge between Kanal Batteries plugin and different interfaces
|
65
92
|
test_files: []
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/kanal/plugins/batteries_bridge/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "kanal-plugins-batteries_bridge"
|
7
|
-
spec.version = Kanal::Plugins::BatteriesBridge::VERSION
|
8
|
-
spec.authors = ["idchlife"]
|
9
|
-
spec.email = ["idchlife@gmail.com"]
|
10
|
-
|
11
|
-
spec.summary = "Bridge between Kanal Batteries plugin and different interfaces"
|
12
|
-
spec.description = "This plugin provides transformation between different interface properties (e.g. tg_audio, tg_image) to batteries properties. Input and also output"
|
13
|
-
spec.homepage = "https://github.com/idchlife/kanal-plugins-batteries_bridge"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.7.6"
|
16
|
-
|
17
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
-
|
19
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
-
spec.metadata["source_code_uri"] = "https://github.com/idchlife/kanal-plugins-batteries_bridge"
|
21
|
-
spec.metadata["changelog_uri"] = "https://github.com/idchlife/kanal-plugins-batteries_bridge/CHANGELOG.md"
|
22
|
-
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
-
spec.files = Dir.chdir(__dir__) do
|
26
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
28
|
-
end
|
29
|
-
end
|
30
|
-
spec.bindir = "exe"
|
31
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
-
spec.require_paths = ["lib"]
|
33
|
-
|
34
|
-
# Uncomment to register a new dependency of your gem
|
35
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
36
|
-
|
37
|
-
# For more information and examples about making a new gem, check out our
|
38
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
39
|
-
end
|