Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix Ruby SDK
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Olofsson
Matrix Ruby SDK
Commits
06a7a8cb
Verified
Commit
06a7a8cb
authored
1 year ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Support configuring bot DSL with env variables
parent
db8534da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/matrix_sdk/bot/main.rb
+5
-0
5 additions, 0 deletions
lib/matrix_sdk/bot/main.rb
with
5 additions
and
0 deletions
lib/matrix_sdk/bot/main.rb
+
5
−
0
View file @
06a7a8cb
...
...
@@ -3,6 +3,11 @@
module
MatrixSdk::Bot
PARAMS_CONFIG
=
{}
# rubocop:disable Style/MutableConstant Intended
PARAMS_CONFIG
[
:homeserver
]
=
ENV
[
'MATRIX_HS'
]
if
ENV
.
key?
'MATRIX_HS'
PARAMS_CONFIG
[
:access_token
]
=
ENV
[
'MATRIX_TOKEN'
]
if
ENV
.
key?
'MATRIX_TOKEN'
PARAMS_CONFIG
[
:username
]
=
ENV
[
'MATRIX_USERNAME'
]
if
ENV
.
key?
'MATRIX_USERNAME'
PARAMS_CONFIG
[
:password
]
=
ENV
[
'MATRIX_PASSWORD'
]
if
ENV
.
key?
'MATRIX_PASSWORD'
require
'optparse'
parser
=
OptionParser
.
new
do
|
op
|
op
.
on
(
'-s homeserver'
,
'Specify homeserver'
)
{
|
val
|
PARAMS_CONFIG
[
:homeserver
]
=
val
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment