@snyk/gemfile 1.1.0 → 1.2.0
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.
- package/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- package/gemfile.js +8 -0
- package/package.json +1 -1
- package/test/Gemfile.json +1 -0
- package/test/Gemfile.lock +3 -0
- package/test/Gemfile2.json +1 -0
- package/test/Gemfile2.lock +3 -0
- package/test/gemfile.test.js +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
- [ ] Tests written and linted [ℹ︎](https://github.com/snyk/general/wiki/Tests)
|
|
2
|
+
- [ ] Documentation written [ℹ︎](https://github.com/snyk/general/wiki/Documentation)
|
|
3
|
+
- [ ] Commit history is tidy [ℹ︎](https://github.com/snyk/general/wiki/Git)
|
|
4
|
+
|
|
5
|
+
### What this does
|
|
6
|
+
|
|
7
|
+
_Explain why this PR exists_
|
|
8
|
+
|
|
9
|
+
### Notes for the reviewer
|
|
10
|
+
|
|
11
|
+
_Instructions on how to run this locally, background context, what to review, questions…_
|
|
12
|
+
|
|
13
|
+
### More information
|
|
14
|
+
|
|
15
|
+
- [Jira ticket XX-0000]()
|
|
16
|
+
- [Link to documentation](https://github.com/Snyk/registry/wiki/)
|
|
17
|
+
|
|
18
|
+
### Screenshots
|
|
19
|
+
|
|
20
|
+
_Visuals that may help the reviewer_
|
package/gemfile.js
CHANGED
|
@@ -8,6 +8,7 @@ const GEMFILE_DEFAULT_LOCATION = path.resolve(process.cwd(), 'Gemfile.lock');
|
|
|
8
8
|
const WHITESPACE = /^(\s*)/;
|
|
9
9
|
const GEMFILE_KEY_VALUE = /^\s*([^:(]*)\s*\:*\s*(.*)/;
|
|
10
10
|
const ORIGINS = ['GEM', 'GIT', 'PATH'];
|
|
11
|
+
const RUBY = /^ruby\s(.*)/;
|
|
11
12
|
|
|
12
13
|
module.exports = {
|
|
13
14
|
interpret,
|
|
@@ -126,8 +127,15 @@ function interpret(string, extractMeta) {
|
|
|
126
127
|
gemfile['BUNDLED WITH'] = Object.keys(gemfile['BUNDLED WITH'])[0];
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
if (gemfile['RUBY VERSION']) {
|
|
131
|
+
const rawVersion= Object.keys(gemfile['RUBY VERSION'])[0];
|
|
132
|
+
const version = RUBY.exec(rawVersion)[1];
|
|
133
|
+
gemfile['RUBY VERSION'] = version;
|
|
134
|
+
}
|
|
135
|
+
|
|
129
136
|
if (extractMeta) {
|
|
130
137
|
gemfileMeta.bundledWith = gemfile['BUNDLED WITH'];
|
|
138
|
+
gemfileMeta.rubyVersion = gemfile['RUBY VERSION'];
|
|
131
139
|
gemfileMeta.platforms = gemfile['PLATFORMS'];
|
|
132
140
|
gemfileMeta.dependencies = gemfile['DEPENDENCIES'];
|
|
133
141
|
gemfileMeta.specs = Object.keys(gemfile)
|
package/package.json
CHANGED
package/test/Gemfile.json
CHANGED
package/test/Gemfile.lock
CHANGED
package/test/Gemfile2.json
CHANGED
package/test/Gemfile2.lock
CHANGED
package/test/gemfile.test.js
CHANGED