jenkins-bot has submitted this change and it was merged.
Change subject: Update js-yaml and replace require()s with read file and
yaml.safeLoad
......................................................................
Update js-yaml and replace require()s with read file and yaml.safeLoad
The newer js-yaml version does not support the older require() approach.
Bug: T114024
Change-Id: I9bfbb8d1c7f777b4d6ac3312699bb2e86281e38a
---
M package.json
M src/relay.js
2 files changed, 8 insertions(+), 5 deletions(-)
Approvals:
Yuvipanda: Looks good to me, approved
jenkins-bot: Verified
diff --git a/package.json b/package.json
index 52f1571..aeb7438 100644
--- a/package.json
+++ b/package.json
@@ -4,13 +4,13 @@
"description": "Gerrit IRC bot",
"main": "src/relay.js",
"dependencies": {
- "js-yaml": "~2.1.0",
"irc": "~0.3.6",
"irc-colors": "~1.0.3",
+ "js-yaml": "^3.4.2",
+ "ssh2": "~0.4.4",
"swig": "~0.14.0",
"underscore": "~1.5.1",
- "winston": "~0.7.2",
- "ssh2": "~0.4.4"
+ "winston": "~0.7.2"
},
"devDependencies": {
"grunt": "^0.4.5",
diff --git a/src/relay.js b/src/relay.js
index 1f0842a..cbbe76a 100644
--- a/src/relay.js
+++ b/src/relay.js
@@ -2,10 +2,10 @@
irc = require('irc'),
swig = require('swig'),
processors = require('./preprocess.js'),
+ fs = require('fs'),
+ path = require('path'),
yaml = require('js-yaml'),
logging = require('winston'),
- config = require('../config.yaml'),
- conns = require('../connections.yaml'),
ssh2 = require('ssh2'),
// Sane? defaults
config_defaults = {
@@ -13,6 +13,9 @@
server: 'chat.freenode.net'
};
+var config = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname,
'../config.yaml'), 'utf8'));
+var conns = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname,
'../connections.yaml'), 'utf8'));
+
_.defaults(config, config_defaults);
function errorLog(message) {
--
To view, visit https://gerrit.wikimedia.org/r/241871
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9bfbb8d1c7f777b4d6ac3312699bb2e86281e38a
Gerrit-PatchSet: 3
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: Polybuildr <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Polybuildr <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits