[Pkg-javascript-commits] [node-coveralls] 136/332: Swap out yaml with js-yaml for Win compat

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit a62635d49b7eb864e64258c5d65b47ad03195fa2
Author: Gerard Escalante <gerard at saygo.ca>
Date:   Tue Feb 11 11:27:46 2014 +0900

    Swap out yaml with js-yaml for Win compat
---
 lib/getOptions.js  | 5 ++---
 package.json       | 2 +-
 test/getOptions.js | 5 ++---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/lib/getOptions.js b/lib/getOptions.js
index abd2f2e..53b50b4 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -1,6 +1,6 @@
 var fs = require('fs');
 var path = require('path');
-var yaml = require('yaml');
+var yaml = require('js-yaml');
 var logger = require('./logger')();
 var fetchGitData = require('./fetchGitData');
 
@@ -59,8 +59,7 @@ var getBaseOptions = function(cb){
     var yml = path.join(process.cwd(), '.coveralls.yml');
     try {
       if (fs.statSync(yml).isFile()) {
-				var evaluate = 'eval';  // hack for jshint
-        options.repo_token = yaml[evaluate](fs.readFileSync(yml, 'utf8')).repo_token;
+        options.repo_token = yaml.safeLoad(fs.readFileSync(yml, 'utf8')).repo_token;
       }
     } catch(ex){
       logger.warn("Repo token could not be determined.  Continuing without it.");
diff --git a/package.json b/package.json
index 16aa2e9..fbdd304 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
     "Arpad Borsos <arpad.borsos at googlemail.com> (http://swatinem.de/)"
   ],
   "dependencies": {
-    "yaml": "0.2.3",
+    "js-yaml": "3.0.1",
     "request": "2.16.2",
     "lcov-parse": "0.0.6",
     "log-driver": "1.2.1"
diff --git a/test/getOptions.js b/test/getOptions.js
index 9e844ec..2fc7be0 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -199,9 +199,8 @@ var testRepoTokenDetection = function(sut, done) {
 
   var file = path.join(process.cwd(), '.coveralls.yml'), token, synthetic = false;
   if (fs.exists(file)) {
-    var yaml = require('yaml');
-    /* jshint evil:true */
-    token = yaml.eval(fs.readFileSync(yml, 'utf8')).repo_token;
+    var yaml = require('js-yaml');
+    token = yaml.saveLoad(fs.readFileSync(yml, 'utf8')).repo_token;
   } else {
     token = 'REPO_TOKEN';
     fs.writeFileSync(file, 'repo_token: ' + token);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list