rubydium 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +72 -48
- data/example/example_bot.rb +7 -9
- data/lib/rubydium/bot.rb +2 -2
- data/lib/rubydium/version.rb +1 -1
- data/rubydium.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c1427ca9d17164a93ec242c30d21dcf6466ee5281e0ae5e3051b1870a649392
|
4
|
+
data.tar.gz: '049b14d607f9e8e899af406321e5c6bef2cc65720eda7bfd048f0eecb2de6a15'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 165a40f2b32eb13ac2c3d393e57f8158d0d4b8c80760fa0956c3c77a600b8b7f372fa9109326d903230f89930b825b9214375a1ddee09ae0acc1b3060406ec1c
|
7
|
+
data.tar.gz: 96d436a66ccedfbff6e32c1c5a1806fde6e6b2b7468a11ef460a2ade3f818837c655686fdd1cde6c3e2b4f29214219b2c47b66ece052607a2890861c31004693
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.3.2
|
data/Gemfile.lock
CHANGED
@@ -2,16 +2,19 @@ GEM
|
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
ast (2.4.2)
|
5
|
-
async (2.
|
6
|
-
console (~> 1.
|
7
|
-
|
5
|
+
async (2.11.0)
|
6
|
+
console (~> 1.25, >= 1.25.2)
|
7
|
+
fiber-annotation
|
8
|
+
io-event (~> 1.5, >= 1.5.1)
|
8
9
|
timers (~> 4.1)
|
9
|
-
|
10
|
+
bigdecimal (3.1.8)
|
10
11
|
coderay (1.1.3)
|
11
|
-
concurrent-ruby (1.
|
12
|
-
console (1.
|
13
|
-
fiber-
|
14
|
-
|
12
|
+
concurrent-ruby (1.3.1)
|
13
|
+
console (1.25.2)
|
14
|
+
fiber-annotation
|
15
|
+
fiber-local (~> 1.1)
|
16
|
+
json
|
17
|
+
diff-lcs (1.5.1)
|
15
18
|
dry-core (1.0.1)
|
16
19
|
concurrent-ruby (~> 1.0)
|
17
20
|
zeitwerk (~> 2.6)
|
@@ -25,73 +28,94 @@ GEM
|
|
25
28
|
dry-types (>= 1.7, < 2)
|
26
29
|
ice_nine (~> 0.11)
|
27
30
|
zeitwerk (~> 2.6)
|
28
|
-
dry-types (1.7.
|
31
|
+
dry-types (1.7.2)
|
32
|
+
bigdecimal (~> 3.0)
|
29
33
|
concurrent-ruby (~> 1.0)
|
30
34
|
dry-core (~> 1.0)
|
31
35
|
dry-inflector (~> 1.0)
|
32
36
|
dry-logic (~> 1.4)
|
33
37
|
zeitwerk (~> 2.6)
|
34
|
-
faraday (2.
|
35
|
-
|
36
|
-
faraday-net_http (>= 2.0, < 3.1)
|
37
|
-
ruby2_keywords (>= 0.0.4)
|
38
|
+
faraday (2.9.0)
|
39
|
+
faraday-net_http (>= 2.0, < 3.2)
|
38
40
|
faraday-multipart (1.0.4)
|
39
41
|
multipart-post (~> 2)
|
40
|
-
faraday-net_http (3.0
|
41
|
-
|
42
|
+
faraday-net_http (3.1.0)
|
43
|
+
net-http
|
44
|
+
fiber-annotation (0.2.0)
|
45
|
+
fiber-local (1.1.0)
|
46
|
+
fiber-storage
|
47
|
+
fiber-storage (0.1.1)
|
42
48
|
ice_nine (0.11.2)
|
43
|
-
io-event (1.
|
44
|
-
json (2.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
io-event (1.6.0)
|
50
|
+
json (2.7.2)
|
51
|
+
language_server-protocol (3.17.0.3)
|
52
|
+
method_source (1.1.0)
|
53
|
+
multipart-post (2.4.1)
|
54
|
+
net-http (0.4.1)
|
55
|
+
uri
|
56
|
+
parallel (1.24.0)
|
57
|
+
parser (3.3.2.0)
|
49
58
|
ast (~> 2.4.1)
|
50
|
-
|
59
|
+
racc
|
60
|
+
pry (0.14.2)
|
51
61
|
coderay (~> 1.1)
|
52
62
|
method_source (~> 1.0)
|
63
|
+
racc (1.8.0)
|
53
64
|
rainbow (3.1.1)
|
54
|
-
regexp_parser (2.
|
55
|
-
rexml (3.2.
|
56
|
-
|
57
|
-
|
58
|
-
rspec-
|
59
|
-
rspec-
|
60
|
-
|
61
|
-
|
62
|
-
|
65
|
+
regexp_parser (2.9.2)
|
66
|
+
rexml (3.2.8)
|
67
|
+
strscan (>= 3.0.9)
|
68
|
+
rspec (3.13.0)
|
69
|
+
rspec-core (~> 3.13.0)
|
70
|
+
rspec-expectations (~> 3.13.0)
|
71
|
+
rspec-mocks (~> 3.13.0)
|
72
|
+
rspec-core (3.13.0)
|
73
|
+
rspec-support (~> 3.13.0)
|
74
|
+
rspec-expectations (3.13.0)
|
63
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.
|
65
|
-
rspec-mocks (3.
|
76
|
+
rspec-support (~> 3.13.0)
|
77
|
+
rspec-mocks (3.13.1)
|
66
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.
|
68
|
-
rspec-support (3.
|
69
|
-
rubocop (1.
|
79
|
+
rspec-support (~> 3.13.0)
|
80
|
+
rspec-support (3.13.1)
|
81
|
+
rubocop (1.64.1)
|
70
82
|
json (~> 2.3)
|
83
|
+
language_server-protocol (>= 3.17.0)
|
71
84
|
parallel (~> 1.10)
|
72
|
-
parser (>= 3.
|
85
|
+
parser (>= 3.3.0.2)
|
73
86
|
rainbow (>= 2.2.2, < 4.0)
|
74
87
|
regexp_parser (>= 1.8, < 3.0)
|
75
88
|
rexml (>= 3.2.5, < 4.0)
|
76
|
-
rubocop-ast (>= 1.
|
89
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
77
90
|
ruby-progressbar (~> 1.7)
|
78
|
-
unicode-display_width (>=
|
79
|
-
rubocop-ast (1.
|
80
|
-
parser (>= 3.
|
81
|
-
rubocop-
|
82
|
-
rubocop (~> 1.
|
83
|
-
|
84
|
-
|
91
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
92
|
+
rubocop-ast (1.31.3)
|
93
|
+
parser (>= 3.3.1.0)
|
94
|
+
rubocop-capybara (2.20.0)
|
95
|
+
rubocop (~> 1.41)
|
96
|
+
rubocop-factory_bot (2.25.1)
|
97
|
+
rubocop (~> 1.41)
|
98
|
+
rubocop-rspec (2.30.0)
|
99
|
+
rubocop (~> 1.40)
|
100
|
+
rubocop-capybara (~> 2.17)
|
101
|
+
rubocop-factory_bot (~> 2.22)
|
102
|
+
rubocop-rspec_rails (~> 2.28)
|
103
|
+
rubocop-rspec_rails (2.28.3)
|
104
|
+
rubocop (~> 1.40)
|
105
|
+
ruby-progressbar (1.13.0)
|
106
|
+
strscan (3.1.0)
|
85
107
|
telegram-bot-ruby (1.0.0)
|
86
108
|
dry-struct (~> 1.6)
|
87
109
|
faraday (~> 2.0)
|
88
110
|
faraday-multipart (~> 1.0)
|
89
111
|
zeitwerk (~> 2.6)
|
90
112
|
timers (4.3.5)
|
91
|
-
unicode-display_width (2.
|
92
|
-
|
113
|
+
unicode-display_width (2.5.0)
|
114
|
+
uri (0.13.0)
|
115
|
+
zeitwerk (2.6.15)
|
93
116
|
|
94
117
|
PLATFORMS
|
118
|
+
ruby
|
95
119
|
x86_64-linux
|
96
120
|
|
97
121
|
DEPENDENCIES
|
@@ -103,4 +127,4 @@ DEPENDENCIES
|
|
103
127
|
telegram-bot-ruby (~> 1.0.0)
|
104
128
|
|
105
129
|
BUNDLED WITH
|
106
|
-
2.3
|
130
|
+
2.5.3
|
data/example/example_bot.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require_relative "../lib/rubydium"
|
3
|
+
require "rubydium"
|
5
4
|
require "pry"
|
6
5
|
|
7
6
|
# Your actual logic of handling the updates goes here.
|
@@ -29,13 +28,12 @@ class ExampleBot < Rubydium::Bot
|
|
29
28
|
end
|
30
29
|
|
31
30
|
ExampleBot.configure do |config|
|
32
|
-
config.token = "
|
33
|
-
config.bot_username = "
|
34
|
-
config.owner_username = "
|
35
|
-
config.privileged_usernames = [
|
36
|
-
|
37
|
-
|
38
|
-
# ]
|
31
|
+
config.token = "1234567890:long_alphanumeric_string_goes_here"
|
32
|
+
config.bot_username = "ends_with_bot"
|
33
|
+
config.owner_username = "thats_you"
|
34
|
+
config.privileged_usernames = %w[
|
35
|
+
your_friend your_chat_moderator
|
36
|
+
]
|
39
37
|
end
|
40
38
|
|
41
39
|
ExampleBot.run
|
data/lib/rubydium/bot.rb
CHANGED
@@ -45,9 +45,9 @@ module Rubydium
|
|
45
45
|
@topic_id = @msg.message_thread_id if @chat.is_forum
|
46
46
|
@replies_to = @msg.reply_to_message unless @msg.reply_to_message&.message_id == @topic_id
|
47
47
|
@target = @replies_to&.from
|
48
|
-
@text = @msg.text.to_s
|
48
|
+
@text = (@msg.text || @msg.caption).to_s
|
49
49
|
@message_id = @msg.message_id
|
50
|
-
@command = get_command(@msg.text)
|
50
|
+
@command = get_command(@msg.text || @msg.caption)
|
51
51
|
@text_without_command = @text.gsub(@command.to_s, "").gsub(/@#{config.bot_username}\b/,
|
52
52
|
"").strip
|
53
53
|
@text_without_bot_mentions = @text.gsub(/@#{config.bot_username}\b/, "")
|
data/lib/rubydium/version.rb
CHANGED
data/rubydium.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "rubydium"
|
7
7
|
spec.version = Rubydium::VERSION
|
8
8
|
spec.authors = ["bulgakke"]
|
9
|
-
spec.email = ["
|
9
|
+
spec.email = ["be.evgeniy.bulavin@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "An OO framework for building Telegram bots. That's the plan, at least."
|
12
12
|
# spec.description = "TODO: Write a longer description or delete this line."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bulgakke
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: telegram-bot-ruby
|
@@ -38,9 +38,9 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.3'
|
41
|
-
description:
|
41
|
+
description:
|
42
42
|
email:
|
43
|
-
-
|
43
|
+
- be.evgeniy.bulavin@gmail.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
@@ -79,7 +79,7 @@ metadata:
|
|
79
79
|
homepage_uri: https://github.com/bulgakke/rubydium
|
80
80
|
source_code_uri: https://github.com/bulgakke/rubydium
|
81
81
|
rubygems_mfa_required: 'true'
|
82
|
-
post_install_message:
|
82
|
+
post_install_message:
|
83
83
|
rdoc_options: []
|
84
84
|
require_paths:
|
85
85
|
- lib
|
@@ -94,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
98
|
-
signing_key:
|
97
|
+
rubygems_version: 3.5.9
|
98
|
+
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: An OO framework for building Telegram bots. That's the plan, at least.
|
101
101
|
test_files: []
|