Socket
Socket
Sign inDemoInstall

@snyk/gemfile

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snyk/gemfile - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

test/Gemfile.json

30

gemfile.js

@@ -6,3 +6,2 @@ 'use strict';

const assert = require('assert');
const util = require('util');

@@ -20,15 +19,2 @@ const GEMFILE_DEFAULT_LOCATION = path.resolve(process.cwd(), 'Gemfile.lock');

const dupKeyMap = () => {
let counter = 0;
return new Proxy({}, {
set(target, key, value) {
if (target[key]) {
target[key + (counter++)] = target[key];
}
target[key] = value;
return true;
}
});
};
function interpret(string, extractMeta) {

@@ -43,6 +29,6 @@ assert(

let line;
let level;
let index = 0;
let previousWhitespace = -1;
let gemfile = level = dupKeyMap();
let keyCount = {};
let gemfile = {};
let lines = string.split('\n');

@@ -109,2 +95,12 @@ let stack = [];

// Do not throw away additional top-level key entries
// e.g. multiple GIT/GEM blocks
if (level[key]) {
if (keyCount[key] === undefined) {
keyCount[key] = 0;
} else {
keyCount[key]++;
}
level[key + keyCount[key]] = level[key];
}
level[key] = data;

@@ -153,3 +149,3 @@

return specs;
}, {});
}, {});
return gemfileMeta;

@@ -156,0 +152,0 @@ }

@@ -6,4 +6,3 @@ {

"scripts": {
"test": "./node_modules/.bin/mocha --harmony",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"test": "./node_modules/.bin/mocha"
},

@@ -26,11 +25,10 @@ "repository": {

"devDependencies": {
"chai": "^3.4.1",
"mocha": "^2.3.4",
"sinon": "^1.17.2",
"semantic-release": "^6.3.6"
"chai": "^4.2.0",
"mocha": "^5.2.0",
"sinon": "^7.1.1"
},
"publishConfig": {
"access": "restricted"
"engines": {
"node": ">= 4.2.4"
},
"version": "1.0.0"
}
"version": "1.1.0"
}

@@ -1,2 +0,2 @@

## gemfile [![Build Status](https://travis-ci.org/treycordova/gemfile.svg?branch=master)](https://travis-ci.org/treycordova/gemfile) [![Version Status](https://img.shields.io/npm/v/gemfile.svg)](https://www.npmjs.org/package/gemfile)
## gemfile
### A Gemfile.lock parser for Node.js represented with JSON.

@@ -3,0 +3,0 @@ #### Installation

@@ -157,3 +157,13 @@ 'use strict';

});
['Gemfile', 'Gemfile2'].forEach(function(filename) {
it('returns exactly what we expect for ' + filename, function() {
let file = fs.readFileSync('test/' + filename + '.lock', 'utf8');
let expected = JSON.parse(
fs.readFileSync('test/' + filename + '.json', 'utf8'));
let output = gemfile.interpret(file, true);
assert.deepEqual(output, expected, 'deep equals');
});
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc