rodbot 0.3.4 → 0.4.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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/README.md +10 -1
- data/checksums/rodbot-0.4.0.gem.sha512 +1 -0
- data/lib/rodbot/config.rb +1 -1
- data/lib/rodbot/generator.rb +2 -2
- data/lib/rodbot/memoize.rb +12 -9
- data/lib/rodbot/version.rb +1 -1
- data/lib/rodbot.rb +1 -0
- data/lib/templates/deploy/docker/compose.yaml.gerb +1 -1
- data/lib/templates/deploy/docker-split/compose.yaml.gerb +1 -1
- data/lib/templates/new/config/rodbot.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +14 -15
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 874d1e4e749027338c4711ceaf6daae88eb17ca7895f947345b90a53ff1b98b6
|
4
|
+
data.tar.gz: 2a0fc3868240dd4b53504c66f7d4940228ec48f5a44291865e8c69b54135559d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538cc1141373f4c1a1c459b46c4141fc829e5819308be0ba817b31d4915b4d9287b23fc5ea2d32080cc75a9646de3bb28be2c0e8852eb9b604dacfbf0c0db94c
|
7
|
+
data.tar.gz: 96226c91181525f7afc469b624da4ceb91bc02fb578056244b886c79513028a80e87e717db0f2d00ff256d0c2e7775400493abbdecf2f35ed41816576fac86e8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -60,6 +60,13 @@ bundle config set --local with matrix
|
|
60
60
|
bundle install
|
61
61
|
```
|
62
62
|
|
63
|
+
You can use more than one plugin of course. Please note that you have to list them separated with a space:
|
64
|
+
|
65
|
+
```
|
66
|
+
bundle config set --local with matrix slack
|
67
|
+
bundle install
|
68
|
+
```
|
69
|
+
|
63
70
|
Please refer to the [Matrix plugin README](https://rubydoc.info/github/svoop/rodbot/file/lib/rodbot/plugins/matrix/README.matrix.md) for more on how to configure and authorise this relay service.
|
64
71
|
|
65
72
|
Time to add Git to the mix. Both `gems.locked` and `.bundle` are included in order to use the same gems and versions both for local development and deployment to production:
|
@@ -128,7 +135,7 @@ It loads the following Roda plugins:
|
|
128
135
|
* [run_append_slash](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/RunAppendSlash.html)
|
129
136
|
* [halt](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/Halt.html)
|
130
137
|
* [unescape_path](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/UnescapePath.html)
|
131
|
-
* [render](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/Render.html)
|
138
|
+
* [render](http://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/Render.html)
|
132
139
|
|
133
140
|
It loads the following Roda extensions provided by Rodbot:
|
134
141
|
|
@@ -204,6 +211,8 @@ The **schedule service** is a [Clockwork process](https://github.com/Rykian/cloc
|
|
204
211
|
|
205
212
|
It's a good idea to have the **app service** do the heavy lifting while the schedule simply fires the corresponding HTTP request.
|
206
213
|
|
214
|
+
A word on time zones since they are particularly important for schedules: Automatic discovery of the local time zone and DST status is rather unreliable. Therefore, Rodbot expects you to set the time zone in `config/rodbot.rb` using `time_zone`. See `ls /usr/share/zoneinfo` for valid values. To correctly handle DST, you should use geographical zones like `Europe/Paris` rather than technical zones like `CET`. If `time_zone` is not defined, the environment variable `TZ` is read instead. And if `TZ` isn't set neither, Rodbot falls back to `Etc/UTC`.
|
215
|
+
|
207
216
|
## CLI
|
208
217
|
|
209
218
|
The `rodbot` CLI is the main tool to manage your bot. For a full list of functions:
|
@@ -0,0 +1 @@
|
|
1
|
+
86c927787dfd98933bc894182d2757c8b3667863e989a2b86ea67491dcc712bb294a726e118f619bf02b721e22aff5f879bc7ce700949293e65f21c757915a20
|
data/lib/rodbot/config.rb
CHANGED
data/lib/rodbot/generator.rb
CHANGED
data/lib/rodbot/memoize.rb
CHANGED
@@ -53,12 +53,12 @@ module Rodbot
|
|
53
53
|
if Rodbot::Memoize.suspend? || block
|
54
54
|
send(unmemoized_method, *args, **kargs, &block)
|
55
55
|
else
|
56
|
-
|
57
|
-
|
58
|
-
if !Rodbot::Memoize.revisit? &&
|
59
|
-
|
56
|
+
cache = Rodbot::Memoize.cache
|
57
|
+
id = object_id.hash ^ method.hash ^ args.hash ^ kargs.hash
|
58
|
+
if !Rodbot::Memoize.revisit? && cache.has_key?(id)
|
59
|
+
cache[id]
|
60
60
|
else
|
61
|
-
|
61
|
+
cache[id] = send(unmemoized_method, *args, **kargs)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -67,6 +67,13 @@ module Rodbot
|
|
67
67
|
end
|
68
68
|
|
69
69
|
class << self
|
70
|
+
attr_reader :cache
|
71
|
+
|
72
|
+
def included(base)
|
73
|
+
base.extend(ClassMethods)
|
74
|
+
@cache = {}
|
75
|
+
end
|
76
|
+
|
70
77
|
%i(suspend revisit).each do |switch|
|
71
78
|
ivar = "@#{switch}"
|
72
79
|
define_method switch do |&block|
|
@@ -84,10 +91,6 @@ module Rodbot
|
|
84
91
|
end
|
85
92
|
end
|
86
93
|
end
|
87
|
-
|
88
|
-
def included(base)
|
89
|
-
base.extend(ClassMethods)
|
90
|
-
end
|
91
94
|
end
|
92
95
|
end
|
93
96
|
|
data/lib/rodbot/version.rb
CHANGED
data/lib/rodbot.rb
CHANGED
@@ -51,6 +51,7 @@ module Rodbot
|
|
51
51
|
dir ENV['RODBOT_CREDENTIALS_DIR'] || Rodbot.env.root.join('config', 'credentials')
|
52
52
|
end
|
53
53
|
@config = Rodbot::Config.new(Rodbot.env.root.join('config', 'rodbot.rb'))
|
54
|
+
ENV['TZ'] = @config.config(:time_zone)
|
54
55
|
@plugins = Rodbot::Plugins.new
|
55
56
|
@db = (db = @config.config(:db)) && Rodbot::Db.new(db)
|
56
57
|
@log = Rodbot::Log.new
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
@@ -10,26 +10,24 @@ bindir: exe
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MIIC+jCCAeKgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhydWJ5
|
14
|
+
L0RDPWJpdGNldGVyYS9EQz1jb20wHhcNMjMxMTEwMTgyMzM2WhcNMjQxMTA5MTgy
|
15
|
+
MzM2WjAjMSEwHwYDVQQDDBhydWJ5L0RDPWJpdGNldGVyYS9EQz1jb20wggEiMA0G
|
16
16
|
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDcLg+IHjXYaUlTSU7R235lQKD8ZhEe
|
17
17
|
KMhoGlSUonZ/zo1OT3KXcqTCP1iMX743xYs6upEGALCWWwq+nxvlDdnWRjF3AAv7
|
18
18
|
ikC+Z2BEowjyeCCT/0gvn4ohKcR0JOzzRaIlFUVInlGSAHx2QHZ2N8ntf54lu7nd
|
19
19
|
L8CiDK8rClsY4JBNGOgH9UC81f+m61UUQuTLxyM2CXfAYkj/sGNTvFRJcNX+nfdC
|
20
20
|
hM9r2kH1+7wsa8yG7wJ2IkrzNACD8v84oE6qVusN8OLEMUI/NaEPVPbw2LUM149H
|
21
21
|
PVa0i729A4IhroNnFNmw4wOC93ARNbM1+LW36PLMmKjKudf5Exg8VmDVAgMBAAGj
|
22
|
-
|
23
|
-
yoX/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
kAyiRqgxF4dJviwtqI7mZIomWL63+kXLgjOjMe1SHxfIPo/0ji6+r1p4KYa7o41v
|
30
|
-
fwIwU1MKlFBdsjkd
|
22
|
+
OTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSfK8MtR62mQ6oN
|
23
|
+
yoX/VKJzFjLSVDANBgkqhkiG9w0BAQsFAAOCAQEAXhT/LpMArF3JRcZSRkJDY+dU
|
24
|
+
GKCRqOefi2iydqh1yIqXyTA9PGR1w5O6O+WS1FvF+sHCwh8fFjCuStg2L8V2RSeo
|
25
|
+
aDtfZ5s80sL8wRFxg3kek69cBuI6ozU+rf9DaXlMES4i8+zASsdv9Y4a2BsbhEdE
|
26
|
+
9AtuMcWn5a45TOO0S4Q8OuV0v705V38Ow15J2RDRvkFRySt+//8/Vd57XAJxPXU0
|
27
|
+
k/QvZU05f6HMYBrPogJgIzHC/C5N/yeE4BVEuBDn+10Zb1iu3aDk8sd0uMgukCY8
|
28
|
+
TUmlP5A6NeGdeDJIoLgromAKs+nvI7TWzhQq9ODs51XhxgUFRCvBqUTpjTQigw==
|
31
29
|
-----END CERTIFICATE-----
|
32
|
-
date: 2023-
|
30
|
+
date: 2023-11-12 00:00:00.000000000 Z
|
33
31
|
dependencies:
|
34
32
|
- !ruby/object:Gem::Dependency
|
35
33
|
name: zeitwerk
|
@@ -454,6 +452,7 @@ files:
|
|
454
452
|
- checksums/rodbot-0.3.2.gem.sha512
|
455
453
|
- checksums/rodbot-0.3.3.gem.sha512
|
456
454
|
- checksums/rodbot-0.3.4.gem.sha512
|
455
|
+
- checksums/rodbot-0.4.0.gem.sha512
|
457
456
|
- doc/rodbot.afphoto
|
458
457
|
- doc/rodbot.avif
|
459
458
|
- exe/rodbot
|
@@ -573,7 +572,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
573
572
|
- !ruby/object:Gem::Version
|
574
573
|
version: '0'
|
575
574
|
requirements: []
|
576
|
-
rubygems_version: 3.4.
|
575
|
+
rubygems_version: 3.4.22
|
577
576
|
signing_key:
|
578
577
|
specification_version: 4
|
579
578
|
summary: Minimalistic framework to build chat bots on top of a Roda backend
|
metadata.gz.sig
CHANGED
Binary file
|