waylon-core 0.1.3 → 0.1.6
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/.roxanne.yml +4 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +46 -44
- data/README.md +1 -1
- data/bin/console +6 -1
- data/lib/waylon/base_component.rb +2 -2
- data/lib/waylon/condition.rb +4 -1
- data/lib/waylon/conditions/regex.rb +3 -0
- data/lib/waylon/config.rb +1 -1
- data/lib/waylon/core.rb +2 -0
- data/lib/waylon/logger.rb +13 -6
- data/lib/waylon/message.rb +1 -0
- data/lib/waylon/rspec/test_server.rb +5 -2
- data/lib/waylon/rspec/test_user.rb +2 -2
- data/lib/waylon/rspec.rb +1 -1
- data/lib/waylon/skills/diagnostics.rb +4 -2
- data/lib/waylon/skills/groups.rb +7 -1
- data/lib/waylon/storage.rb +41 -0
- data/lib/waylon/version.rb +1 -1
- data/scripts/release.sh +9 -0
- data/scripts/test.sh +3 -1
- data/waylon-core.gemspec +1 -0
- metadata +22 -7
- data/lib/waylon.rb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57bed2ca4c2e97caf912ff316be213e191605c61d2934a1a2cd590013a28cfa2
|
|
4
|
+
data.tar.gz: 6e32bf09330d75603b7340f18a58bc9a16d373097d91c2a082ff5fea8a4cb5b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05bc6522ee2cda61c80dbabeb52a624d3301e6be562ebc575f4508e7537cfa212ba8f8b0f0d14ce4607852dd30162c93d5494325eac4bffe1c0e6f923492c31f
|
|
7
|
+
data.tar.gz: 8537c32ded411934c548b4aa47ca8a03dcf3ed502a927357f25932166f555d0224948776d1226865bea5b01d94deb300081ede84075a64a073eb535175059817
|
data/.roxanne.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.1.
|
|
1
|
+
3.1.2
|
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
waylon-core (0.1.
|
|
4
|
+
waylon-core (0.1.6)
|
|
5
5
|
addressable (~> 2.8)
|
|
6
6
|
faraday (~> 1.8)
|
|
7
7
|
i18n (~> 1.8)
|
|
8
8
|
json (~> 2.6)
|
|
9
9
|
moneta (~> 1.4)
|
|
10
10
|
puma (~> 5.5)
|
|
11
|
+
rbnacl (~> 7.1)
|
|
11
12
|
resque (~> 2.2)
|
|
12
13
|
|
|
13
14
|
GEM
|
|
@@ -16,10 +17,10 @@ GEM
|
|
|
16
17
|
addressable (2.8.0)
|
|
17
18
|
public_suffix (>= 2.0.2, < 5.0)
|
|
18
19
|
ast (2.4.2)
|
|
19
|
-
concurrent-ruby (1.1.
|
|
20
|
+
concurrent-ruby (1.1.10)
|
|
20
21
|
diff-lcs (1.5.0)
|
|
21
22
|
docile (1.4.0)
|
|
22
|
-
faraday (1.
|
|
23
|
+
faraday (1.10.0)
|
|
23
24
|
faraday-em_http (~> 1.0)
|
|
24
25
|
faraday-em_synchrony (~> 1.0)
|
|
25
26
|
faraday-excon (~> 1.1)
|
|
@@ -35,72 +36,74 @@ GEM
|
|
|
35
36
|
faraday-em_synchrony (1.0.0)
|
|
36
37
|
faraday-excon (1.1.0)
|
|
37
38
|
faraday-httpclient (1.0.1)
|
|
38
|
-
faraday-multipart (1.0.
|
|
39
|
-
multipart-post (
|
|
39
|
+
faraday-multipart (1.0.4)
|
|
40
|
+
multipart-post (~> 2)
|
|
40
41
|
faraday-net_http (1.0.1)
|
|
41
42
|
faraday-net_http_persistent (1.2.0)
|
|
42
43
|
faraday-patron (1.0.0)
|
|
43
44
|
faraday-rack (1.0.0)
|
|
44
45
|
faraday-retry (1.0.3)
|
|
45
|
-
|
|
46
|
+
ffi (1.15.5)
|
|
47
|
+
i18n (1.10.0)
|
|
46
48
|
concurrent-ruby (~> 1.0)
|
|
47
|
-
json (2.6.
|
|
48
|
-
moneta (1.
|
|
49
|
+
json (2.6.2)
|
|
50
|
+
moneta (1.5.1)
|
|
49
51
|
mono_logger (1.1.1)
|
|
50
52
|
multi_json (1.15.0)
|
|
51
|
-
multipart-post (2.
|
|
53
|
+
multipart-post (2.2.0)
|
|
52
54
|
mustermann (1.1.1)
|
|
53
55
|
ruby2_keywords (~> 0.0.1)
|
|
54
56
|
nio4r (2.5.8)
|
|
55
|
-
parallel (1.
|
|
56
|
-
parser (3.1.
|
|
57
|
+
parallel (1.22.1)
|
|
58
|
+
parser (3.1.2.0)
|
|
57
59
|
ast (~> 2.4.1)
|
|
58
|
-
public_suffix (4.0.
|
|
59
|
-
puma (5.6.
|
|
60
|
+
public_suffix (4.0.7)
|
|
61
|
+
puma (5.6.4)
|
|
60
62
|
nio4r (~> 2.0)
|
|
61
|
-
rack (2.2.3)
|
|
62
|
-
rack-protection (2.
|
|
63
|
+
rack (2.2.3.1)
|
|
64
|
+
rack-protection (2.2.0)
|
|
63
65
|
rack
|
|
64
66
|
rainbow (3.1.1)
|
|
65
67
|
rake (13.0.6)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
rbnacl (7.1.1)
|
|
69
|
+
ffi
|
|
70
|
+
redis (4.6.0)
|
|
71
|
+
redis-namespace (1.8.2)
|
|
68
72
|
redis (>= 3.0.4)
|
|
69
|
-
regexp_parser (2.
|
|
70
|
-
resque (2.2.
|
|
73
|
+
regexp_parser (2.5.0)
|
|
74
|
+
resque (2.2.1)
|
|
71
75
|
mono_logger (~> 1.0)
|
|
72
76
|
multi_json (~> 1.0)
|
|
73
77
|
redis-namespace (~> 1.6)
|
|
74
78
|
sinatra (>= 0.9.2)
|
|
75
|
-
vegas (~> 0.1.2)
|
|
76
79
|
rexml (3.2.5)
|
|
77
|
-
rspec (3.
|
|
78
|
-
rspec-core (~> 3.
|
|
79
|
-
rspec-expectations (~> 3.
|
|
80
|
-
rspec-mocks (~> 3.
|
|
81
|
-
rspec-core (3.
|
|
82
|
-
rspec-support (~> 3.
|
|
83
|
-
rspec-expectations (3.
|
|
80
|
+
rspec (3.11.0)
|
|
81
|
+
rspec-core (~> 3.11.0)
|
|
82
|
+
rspec-expectations (~> 3.11.0)
|
|
83
|
+
rspec-mocks (~> 3.11.0)
|
|
84
|
+
rspec-core (3.11.0)
|
|
85
|
+
rspec-support (~> 3.11.0)
|
|
86
|
+
rspec-expectations (3.11.0)
|
|
84
87
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
85
|
-
rspec-support (~> 3.
|
|
86
|
-
rspec-mocks (3.
|
|
88
|
+
rspec-support (~> 3.11.0)
|
|
89
|
+
rspec-mocks (3.11.1)
|
|
87
90
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
88
|
-
rspec-support (~> 3.
|
|
89
|
-
rspec-support (3.
|
|
90
|
-
rubocop (1.
|
|
91
|
+
rspec-support (~> 3.11.0)
|
|
92
|
+
rspec-support (3.11.0)
|
|
93
|
+
rubocop (1.30.1)
|
|
91
94
|
parallel (~> 1.10)
|
|
92
95
|
parser (>= 3.1.0.0)
|
|
93
96
|
rainbow (>= 2.2.2, < 4.0)
|
|
94
97
|
regexp_parser (>= 1.8, < 3.0)
|
|
95
|
-
rexml
|
|
96
|
-
rubocop-ast (>= 1.
|
|
98
|
+
rexml (>= 3.2.5, < 4.0)
|
|
99
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
|
97
100
|
ruby-progressbar (~> 1.7)
|
|
98
101
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
99
|
-
rubocop-ast (1.
|
|
100
|
-
parser (>= 3.
|
|
102
|
+
rubocop-ast (1.18.0)
|
|
103
|
+
parser (>= 3.1.1.0)
|
|
101
104
|
rubocop-rake (0.6.0)
|
|
102
105
|
rubocop (~> 1.0)
|
|
103
|
-
rubocop-rspec (2.
|
|
106
|
+
rubocop-rspec (2.11.1)
|
|
104
107
|
rubocop (~> 1.19)
|
|
105
108
|
ruby-progressbar (1.11.0)
|
|
106
109
|
ruby2_keywords (0.0.5)
|
|
@@ -109,22 +112,21 @@ GEM
|
|
|
109
112
|
simplecov-html (~> 0.11)
|
|
110
113
|
simplecov_json_formatter (~> 0.1)
|
|
111
114
|
simplecov-html (0.12.3)
|
|
112
|
-
simplecov_json_formatter (0.1.
|
|
113
|
-
sinatra (2.
|
|
115
|
+
simplecov_json_formatter (0.1.4)
|
|
116
|
+
sinatra (2.2.0)
|
|
114
117
|
mustermann (~> 1.0)
|
|
115
118
|
rack (~> 2.2)
|
|
116
|
-
rack-protection (= 2.
|
|
119
|
+
rack-protection (= 2.2.0)
|
|
117
120
|
tilt (~> 2.0)
|
|
118
121
|
tilt (2.0.10)
|
|
119
122
|
unicode-display_width (2.1.0)
|
|
120
|
-
vegas (0.1.11)
|
|
121
|
-
rack (>= 1.0.0)
|
|
122
123
|
webrick (1.7.0)
|
|
123
|
-
yard (0.9.
|
|
124
|
+
yard (0.9.28)
|
|
124
125
|
webrick (~> 1.7.0)
|
|
125
126
|
|
|
126
127
|
PLATFORMS
|
|
127
128
|
arm64-darwin-21
|
|
129
|
+
x86_64-linux
|
|
128
130
|
|
|
129
131
|
DEPENDENCIES
|
|
130
132
|
bundler (~> 2.3)
|
|
@@ -138,4 +140,4 @@ DEPENDENCIES
|
|
|
138
140
|
yard (~> 0.9, >= 0.9.27)
|
|
139
141
|
|
|
140
142
|
BUNDLED WITH
|
|
141
|
-
2.3.
|
|
143
|
+
2.3.10
|
data/README.md
CHANGED
|
@@ -44,7 +44,7 @@ Alone, this library isn't super useful for running a bot, but it does include a
|
|
|
44
44
|
|
|
45
45
|
## Development
|
|
46
46
|
|
|
47
|
-
Waylon's development pipeline makes heavy use of [RSpec](https://rspec.info/) for testing (and [SimpleCov](https://github.com/simplecov-ruby/simplecov) for reporting on coverage), [Rubocop](https://rubocop.org/) for linting/format checking, [YARD](https://yardoc.org/) for documentation, and [
|
|
47
|
+
Waylon's development pipeline makes heavy use of [RSpec](https://rspec.info/) for testing (and [SimpleCov](https://github.com/simplecov-ruby/simplecov) for reporting on coverage), [Rubocop](https://rubocop.org/) for linting/format checking, [YARD](https://yardoc.org/) for documentation, and [RoxanneCI](https://github.com/apps/roxanneci) for CI. Most of this is built-in and will work out-of-the-box for GitHub PRs.
|
|
48
48
|
|
|
49
49
|
To get started locally, after checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the tests and linting. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
50
50
|
|
data/bin/console
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "bundler/setup"
|
|
5
|
-
require "waylon"
|
|
5
|
+
require "waylon/core"
|
|
6
|
+
require "waylon/skills/default"
|
|
7
|
+
require "waylon/skills/diagnostics"
|
|
8
|
+
require "waylon/skills/fun"
|
|
9
|
+
require "waylon/skills/groups"
|
|
10
|
+
require "waylon/skills/help"
|
|
6
11
|
|
|
7
12
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
13
|
# with your gem easier. You can also use a different console, if you like.
|
|
@@ -46,7 +46,7 @@ module Waylon
|
|
|
46
46
|
@namespace || name.to_s.split("::").last.downcase
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
# Creates namespaced configuration keys for
|
|
49
|
+
# Creates namespaced configuration keys for BaseComponent subclasses
|
|
50
50
|
# @param (see Config#add_schema)
|
|
51
51
|
def config(key, default: nil, required: false, type: String)
|
|
52
52
|
conf = Config.instance
|
|
@@ -127,7 +127,7 @@ module Waylon
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
# A wrapper for accessing the persistent storage
|
|
130
|
-
# @return [Waylon::Storage] The Storage wrapper
|
|
130
|
+
# @return [Waylon::Storage] The Storage wrapper module
|
|
131
131
|
def storage
|
|
132
132
|
Waylon::Storage
|
|
133
133
|
end
|
data/lib/waylon/condition.rb
CHANGED
|
@@ -66,7 +66,10 @@ module Waylon
|
|
|
66
66
|
# @param message [Waylon::Message] The received message
|
|
67
67
|
# @return [Boolean]
|
|
68
68
|
def properly_mentions?(message)
|
|
69
|
-
|
|
69
|
+
return true unless mention_only?
|
|
70
|
+
|
|
71
|
+
message.to_bot?
|
|
72
|
+
# (mention_only? && message.to_bot?) || (!mention_only? && !message.to_bot?)
|
|
70
73
|
end
|
|
71
74
|
|
|
72
75
|
# Tokens is used to provide details about the message input to the action
|
|
@@ -18,6 +18,9 @@ module Waylon
|
|
|
18
18
|
@mechanism.match(input).to_a[1..]
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
# Provides the _named_ regular expression match groups as a hash
|
|
22
|
+
# @param input [String] The message text
|
|
23
|
+
# @return [Hash<Symbol,String>] The named regular expression match groups
|
|
21
24
|
def named_tokens(input)
|
|
22
25
|
match_data = @mechanism.match(input)
|
|
23
26
|
match_data.names.to_h { |n| [n.to_sym, match_data[n]] }
|
data/lib/waylon/config.rb
CHANGED
|
@@ -41,7 +41,7 @@ module Waylon
|
|
|
41
41
|
ENV.keys.grep(/CONF_/).each do |env_key|
|
|
42
42
|
conf_key = env_key.downcase.split("_")[1..].join(".")
|
|
43
43
|
::Waylon::Logger.log("Attempting to set #{conf_key} from #{env_key}", :debug)
|
|
44
|
-
self[conf_key] = ENV
|
|
44
|
+
self[conf_key] = ENV.fetch(env_key, nil)
|
|
45
45
|
end
|
|
46
46
|
true
|
|
47
47
|
end
|
data/lib/waylon/core.rb
CHANGED
|
@@ -21,6 +21,7 @@ require "faraday"
|
|
|
21
21
|
require "i18n"
|
|
22
22
|
require "json"
|
|
23
23
|
require "moneta"
|
|
24
|
+
require "rbnacl"
|
|
24
25
|
require "resque"
|
|
25
26
|
require "sinatra"
|
|
26
27
|
|
|
@@ -32,6 +33,7 @@ require "waylon/exceptions/not_implemented_error"
|
|
|
32
33
|
require "waylon/exceptions/validation_error"
|
|
33
34
|
require "waylon/group"
|
|
34
35
|
require "waylon/logger"
|
|
36
|
+
require "waylon/storage"
|
|
35
37
|
require "waylon/base_component"
|
|
36
38
|
require "waylon/condition"
|
|
37
39
|
require "waylon/message"
|
data/lib/waylon/logger.rb
CHANGED
|
@@ -19,12 +19,18 @@ module Waylon
|
|
|
19
19
|
# Provides an easy way to access the underlying logger
|
|
20
20
|
# @return [Logger] The Logger instance
|
|
21
21
|
def self.logger
|
|
22
|
-
|
|
22
|
+
@logger ||= json_logger
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.logger=(logger)
|
|
26
|
+
@logger = logger
|
|
27
|
+
end
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
def self.json_logger
|
|
30
|
+
a_logger = ::Logger.new($stderr)
|
|
31
|
+
a_logger.level = level
|
|
32
|
+
a_logger.progname = "Waylon"
|
|
33
|
+
a_logger.formatter = proc do |severity, datetime, progname, msg|
|
|
28
34
|
json_data = JSON.dump(
|
|
29
35
|
ts: datetime,
|
|
30
36
|
severity: severity.ljust(5).to_s,
|
|
@@ -35,7 +41,8 @@ module Waylon
|
|
|
35
41
|
)
|
|
36
42
|
"#{json_data}\n"
|
|
37
43
|
end
|
|
38
|
-
|
|
44
|
+
|
|
45
|
+
a_logger
|
|
39
46
|
end
|
|
40
47
|
end
|
|
41
48
|
end
|
data/lib/waylon/message.rb
CHANGED
|
@@ -20,7 +20,7 @@ config = Waylon::Config.instance
|
|
|
20
20
|
config.load_env
|
|
21
21
|
|
|
22
22
|
Waylon::Cache = Moneta.new(:Cookie)
|
|
23
|
-
Waylon::Storage
|
|
23
|
+
p Waylon::Storage
|
|
24
24
|
Waylon::Logger.log("Found Global Admins: #{config.admins}")
|
|
25
25
|
|
|
26
26
|
Waylon::RSpec::TestUser.find_or_create(
|
|
@@ -41,7 +41,10 @@ end
|
|
|
41
41
|
Waylon::RSpec::TestChannel.find_or_create("random")
|
|
42
42
|
|
|
43
43
|
# Load demo skills here
|
|
44
|
+
require "waylon/skills/diagnostics"
|
|
44
45
|
require "waylon/skills/fun"
|
|
46
|
+
require "waylon/skills/groups"
|
|
47
|
+
require "waylon/skills/help"
|
|
45
48
|
|
|
46
49
|
# Handle demo chat REPL
|
|
47
50
|
def adminuser
|
|
@@ -101,7 +104,7 @@ def handle_input(body, from: this_user, privately: true)
|
|
|
101
104
|
else
|
|
102
105
|
message_count = Waylon::RSpec::TestSense.sent_messages.size
|
|
103
106
|
|
|
104
|
-
Waylon::RSpec::TestSense.
|
|
107
|
+
Waylon::RSpec::TestSense.perform(msg_details(body, from, privately))
|
|
105
108
|
Waylon::RSpec::TestWorker.handle(Waylon::RSpec::TestSense.fake_queue)
|
|
106
109
|
result = Waylon::RSpec::TestSense.sent_messages[message_count..].join("\n")
|
|
107
110
|
puts("(@#{Waylon::RSpec::TestUser.whoami.handle}) >> #{result}")
|
|
@@ -147,8 +147,8 @@ module Waylon
|
|
|
147
147
|
# @api private
|
|
148
148
|
# @return [String] A generated email address
|
|
149
149
|
def self.email_from_name(name)
|
|
150
|
-
if ENV
|
|
151
|
-
ENV
|
|
150
|
+
if ENV.fetch("USER_EMAIL", nil) && name == "homer.simpson"
|
|
151
|
+
ENV.fetch("USER_EMAIL", nil)
|
|
152
152
|
else
|
|
153
153
|
"#{name.downcase.gsub(/[\s_-]/, ".")}@example.com"
|
|
154
154
|
end
|
data/lib/waylon/rspec.rb
CHANGED
|
@@ -27,8 +27,10 @@ module Waylon
|
|
|
27
27
|
response << " - *Test Result:* #{state ? "Success" : "Error"}"
|
|
28
28
|
response << " - *Read time:* #{read_time}s"
|
|
29
29
|
response << " - *Write time:* #{write_time}s"
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if Resque.redis.connected?
|
|
31
|
+
response << "*Queue Monitoring:*"
|
|
32
|
+
response << " - Failed jobs: #{Resque::Failure.count}"
|
|
33
|
+
end
|
|
32
34
|
|
|
33
35
|
reply response.join("\n")
|
|
34
36
|
end
|
data/lib/waylon/skills/groups.rb
CHANGED
|
@@ -146,7 +146,13 @@ module Waylon
|
|
|
146
146
|
private
|
|
147
147
|
|
|
148
148
|
def all_group_keys
|
|
149
|
-
db.adapter.
|
|
149
|
+
if db.adapter.instance_of?(Moneta::Adapters::Redis)
|
|
150
|
+
db.adapter.backend.keys("groups.*")
|
|
151
|
+
else
|
|
152
|
+
groups = []
|
|
153
|
+
db.each_key { |key| groups << key if key.start_with?("groups.") }
|
|
154
|
+
groups
|
|
155
|
+
end
|
|
150
156
|
end
|
|
151
157
|
|
|
152
158
|
def found_user(user_string)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Waylon
|
|
4
|
+
# Used for working with the Moneta store
|
|
5
|
+
module Storage
|
|
6
|
+
Store = Moneta.new(
|
|
7
|
+
:Redis,
|
|
8
|
+
url: "redis://#{ENV.fetch("REDIS", "localhost:6379")}/1"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
def self.cipher
|
|
12
|
+
key_bytes = RbNaCl::Hash.sha256(ENV.fetch("ENCRYPTION_KEY", "thisisVeryUnsafe4U"))[0..31]
|
|
13
|
+
RbNaCl::SimpleBox.from_secret_key(key_bytes)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.clear
|
|
17
|
+
Store.clear
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.key?(name)
|
|
21
|
+
Store.key?(name)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.load(key)
|
|
25
|
+
this_cipher = cipher
|
|
26
|
+
raw = Store.load(key)
|
|
27
|
+
return nil unless raw
|
|
28
|
+
|
|
29
|
+
decoded = Base64.decode64(raw)
|
|
30
|
+
plain = this_cipher.decrypt(decoded)
|
|
31
|
+
JSON.parse(plain)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.store(key, value)
|
|
35
|
+
this_cipher = cipher
|
|
36
|
+
encrypted = this_cipher.encrypt(value.to_json)
|
|
37
|
+
encoded = Base64.encode64(encrypted)
|
|
38
|
+
Store.store(key, encoded)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
data/lib/waylon/version.rb
CHANGED
data/scripts/release.sh
ADDED
data/scripts/test.sh
CHANGED
data/waylon-core.gemspec
CHANGED
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_dependency "json", "~> 2.6"
|
|
34
34
|
spec.add_dependency "moneta", "~> 1.4"
|
|
35
35
|
spec.add_dependency "puma", "~> 5.5"
|
|
36
|
+
spec.add_dependency "rbnacl", "~> 7.1"
|
|
36
37
|
spec.add_dependency "resque", "~> 2.2"
|
|
37
38
|
|
|
38
39
|
spec.add_development_dependency "bundler", "~> 2.3"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: waylon-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Gnagy
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
@@ -94,6 +94,20 @@ dependencies:
|
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '5.5'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rbnacl
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '7.1'
|
|
104
|
+
type: :runtime
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '7.1'
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: resque
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -246,7 +260,6 @@ files:
|
|
|
246
260
|
- Rakefile
|
|
247
261
|
- bin/console
|
|
248
262
|
- bin/setup
|
|
249
|
-
- lib/waylon.rb
|
|
250
263
|
- lib/waylon/base_component.rb
|
|
251
264
|
- lib/waylon/condition.rb
|
|
252
265
|
- lib/waylon/conditions/black_hole.rb
|
|
@@ -284,10 +297,12 @@ files:
|
|
|
284
297
|
- lib/waylon/skills/fun.rb
|
|
285
298
|
- lib/waylon/skills/groups.rb
|
|
286
299
|
- lib/waylon/skills/help.rb
|
|
300
|
+
- lib/waylon/storage.rb
|
|
287
301
|
- lib/waylon/user.rb
|
|
288
302
|
- lib/waylon/version.rb
|
|
289
303
|
- lib/waylon/webhook.rb
|
|
290
304
|
- lib/waylon/webhook_registry.rb
|
|
305
|
+
- scripts/release.sh
|
|
291
306
|
- scripts/test.sh
|
|
292
307
|
- waylon-core.gemspec
|
|
293
308
|
homepage: https://github.com/jgnagy/waylon-core
|
|
@@ -297,7 +312,7 @@ metadata:
|
|
|
297
312
|
homepage_uri: https://github.com/jgnagy/waylon-core
|
|
298
313
|
source_code_uri: https://github.com/jgnagy/waylon-core
|
|
299
314
|
changelog_uri: https://github.com/jgnagy/waylon-core/blob/main/CHANGELOG.md
|
|
300
|
-
post_install_message:
|
|
315
|
+
post_install_message:
|
|
301
316
|
rdoc_options: []
|
|
302
317
|
require_paths:
|
|
303
318
|
- lib
|
|
@@ -312,8 +327,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
312
327
|
- !ruby/object:Gem::Version
|
|
313
328
|
version: '0'
|
|
314
329
|
requirements: []
|
|
315
|
-
rubygems_version: 3.3.
|
|
316
|
-
signing_key:
|
|
330
|
+
rubygems_version: 3.3.7
|
|
331
|
+
signing_key:
|
|
317
332
|
specification_version: 4
|
|
318
333
|
summary: Core library for the Waylon bot framework
|
|
319
334
|
test_files: []
|