bundler-leak 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +59 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +47 -0
- data/.github/workflows/test.yml +27 -0
- data/.gitignore +1 -2
- data/ChangeLog.md +6 -121
- data/Gemfile +1 -1
- data/README.md +20 -11
- data/Rakefile +2 -15
- data/bin/setup +4 -0
- data/bundler-leak.gemspec +2 -1
- data/code-of-conduct.md +77 -0
- data/data/ruby-mem-advisory-db.ts +1 -1
- data/{bin → exe}/bundle-leak +0 -0
- data/{bin → exe}/bundler-leak +0 -0
- data/fastruby-logo.png +0 -0
- data/gemspec.yml +4 -1
- data/lib/bundler/plumber/advisory.rb +22 -12
- data/lib/bundler/plumber/cli.rb +9 -8
- data/lib/bundler/plumber/database.rb +7 -6
- data/lib/bundler/plumber/scanner.rb +2 -9
- data/lib/bundler/plumber/version.rb +1 -1
- data/pull_request_template.md +7 -0
- data/spec/advisory_spec.rb +6 -6
- data/spec/bundle/unpatched_gems/Gemfile +0 -35
- data/spec/bundle/unpatched_gems/Gemfile.lock +60 -0
- data/spec/cli_spec.rb +49 -33
- data/spec/database_spec.rb +25 -15
- data/spec/integration_spec.rb +16 -12
- data/spec/scanner_spec.rb +4 -16
- data/spec/spec_helper.rb +23 -5
- metadata +38 -37
- data/.travis.yml +0 -13
- data/data/ruby-mem-advisory-db/.gitignore +0 -1
- data/data/ruby-mem-advisory-db/.rspec +0 -1
- data/data/ruby-mem-advisory-db/.travis.yml +0 -12
- data/data/ruby-mem-advisory-db/CONTRIBUTING.md +0 -69
- data/data/ruby-mem-advisory-db/CONTRIBUTORS.md +0 -40
- data/data/ruby-mem-advisory-db/Gemfile +0 -9
- data/data/ruby-mem-advisory-db/Gemfile.lock +0 -38
- data/data/ruby-mem-advisory-db/LICENSE.txt +0 -5
- data/data/ruby-mem-advisory-db/README.md +0 -72
- data/data/ruby-mem-advisory-db/Rakefile +0 -26
- data/data/ruby-mem-advisory-db/gems/celluloid/670.yml +0 -10
- data/data/ruby-mem-advisory-db/gems/grape/301.yml +0 -9
- data/data/ruby-mem-advisory-db/gems/oj/229.yml +0 -9
- data/data/ruby-mem-advisory-db/gems/redcarpet/516.yml +0 -12
- data/data/ruby-mem-advisory-db/gems/redis/612.yml +0 -9
- data/data/ruby-mem-advisory-db/gems/sidekiq/2598.yml +0 -9
- data/data/ruby-mem-advisory-db/gems/sidekiq-statistic/73.yml +0 -9
- data/data/ruby-mem-advisory-db/gems/therubyracer/336.yml +0 -13
- data/data/ruby-mem-advisory-db/gems/zipruby/PRE-SA-2012-02.yml +0 -9
- data/data/ruby-mem-advisory-db/scripts/post-advisories.sh +0 -18
- data/data/ruby-mem-advisory-db/spec/advisories_spec.rb +0 -23
- data/data/ruby-mem-advisory-db/spec/advisory_example.rb +0 -209
- data/data/ruby-mem-advisory-db/spec/gem_example.rb +0 -37
- data/data/ruby-mem-advisory-db/spec/library_example.rb +0 -21
- data/data/ruby-mem-advisory-db/spec/ruby_example.rb +0 -22
- data/data/ruby-mem-advisory-db/spec/spec_helper.rb +0 -1
- data/spec/bundle/insecure_sources/Gemfile +0 -39
- data/spec/bundle/secure/Gemfile +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3d27fec7acee6b26df26e77f7efdb5d4d5c4783bab50a5ffee8c70344c9791
|
4
|
+
data.tar.gz: 16104345f72340b3b14d5106a08c24a3b4627ead89aa4bc48423346c255f483f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2556087c7303334229b4957a28915795b8bc2df3ea05834cac8c3d81f67fee5a17bf454493590131f3a9950e8dc7f26f5c7b8bca0ab06e437c766feed360dda3
|
7
|
+
data.tar.gz: 64f11cfcedce51dafa622b0453f0ce0e77d8a0e48ce0bb3b5d437f0648fba1a775b3116b28d05814ef4b860fa6c7958ff74355fb6ed236cd5cba10dc04114117
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: "[BUG]"
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
|
11
|
+
|
12
|
+
**Before we start...:**
|
13
|
+
|
14
|
+
- [ ] I checked the documentation and found no answer
|
15
|
+
- [ ] I checked to make sure that this issue has not already been filed
|
16
|
+
- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
|
17
|
+
|
18
|
+
|
19
|
+
**Branch/Commit:**
|
20
|
+
|
21
|
+
Inform what branch/commit of bundler-leak you are using.
|
22
|
+
|
23
|
+
**Expected behavior:**
|
24
|
+
|
25
|
+
Please include a detailed description of the behavior you were expecting when you encountered this issue.
|
26
|
+
|
27
|
+
**Actual behavior:**
|
28
|
+
|
29
|
+
Please include a detailed description of the actual behavior of the application.
|
30
|
+
|
31
|
+
**Steps to reproduce:**
|
32
|
+
|
33
|
+
How do I achieve this behavior? Use the following format to provide a step-by-step guide:
|
34
|
+
|
35
|
+
1. Step 1: ...
|
36
|
+
2. Step 2: ...
|
37
|
+
|
38
|
+
**Context and environment:**
|
39
|
+
|
40
|
+
Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)
|
41
|
+
|
42
|
+
1. Version of the software the issue is being opened for.
|
43
|
+
2. Operating System
|
44
|
+
3. Operating System version
|
45
|
+
4. Ruby version
|
46
|
+
|
47
|
+
_Delete any information that is not relevant._
|
48
|
+
|
49
|
+
If you are unable to reproduce the bug, add the **Non-Reproducible** tag and describe the steps you followed leading to the bug to the best of your recollection.
|
50
|
+
|
51
|
+
**Screenshots and Videos**
|
52
|
+
|
53
|
+
If the issue has an effect in the frontend, include any relevant screenshots and videos here.
|
54
|
+
|
55
|
+
**Logs**
|
56
|
+
|
57
|
+
Include relevant log snippets or files here.
|
58
|
+
|
59
|
+
**I will abide by the [code of conduct] (code_of_conduct.md)**
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Request a new feature
|
4
|
+
title: "[REQUEST]"
|
5
|
+
labels: 'enhancement'
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
|
11
|
+
|
12
|
+
**Before we start...:**
|
13
|
+
|
14
|
+
- [ ] I checked the documentation and didn't find this feature
|
15
|
+
- [ ] I checked to make sure that this feature has not already been requested
|
16
|
+
|
17
|
+
|
18
|
+
**Branch/Commit:**
|
19
|
+
|
20
|
+
Inform what branch/commit/version of bundler-leak you are using.
|
21
|
+
|
22
|
+
**Describe the feature:**
|
23
|
+
|
24
|
+
Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.
|
25
|
+
|
26
|
+
> **As a \<role name\>**
|
27
|
+
> **I do \<something\>**
|
28
|
+
> **And then I do \<another action\>**
|
29
|
+
> **And I see \<some result\>**
|
30
|
+
|
31
|
+
**Problem:**
|
32
|
+
|
33
|
+
Please include a detailed description of the problem this feature would solve.
|
34
|
+
|
35
|
+
> **As a \<role name\>**
|
36
|
+
> **I want to \<do something\>**
|
37
|
+
> **So that I can achieve a \<goal\>**
|
38
|
+
|
39
|
+
**Mockups:**
|
40
|
+
|
41
|
+
Include any mockup idea related to the requested feature if it applies.
|
42
|
+
|
43
|
+
**Resources:**
|
44
|
+
|
45
|
+
If you have resources related to the implementation or research for this feature, add them here.
|
46
|
+
|
47
|
+
**I will abide by the [code of conduct] (code_of_conduct.md)**
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- main
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
os: [ubuntu-latest]
|
17
|
+
ruby: ['2.6', '2.7', '3.0', '3.1']
|
18
|
+
runs-on: ${{ matrix.os }}
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
- name: Run tests
|
25
|
+
run: |
|
26
|
+
./bin/setup
|
27
|
+
bundle exec rspec spec
|
data/.gitignore
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,125 +1,10 @@
|
|
1
|
-
### 0.
|
1
|
+
### 0.1.0 / 2019-08-28
|
2
2
|
|
3
|
-
*
|
4
|
-
* Added `bin/bundler-audit` which will be executed when `bundle audit` is ran
|
5
|
-
(@vassilevsky).
|
3
|
+
* Improve database update logic
|
6
4
|
|
7
|
-
### 0.
|
5
|
+
### 0.0.0 / 2019-08-26
|
8
6
|
|
9
|
-
*
|
10
|
-
* Added {Bundler::Audit::Advisory#date}.
|
11
|
-
* Added {Bundler::Audit::Advisory#cve_id}.
|
12
|
-
* Added {Bundler::Audit::Advisory#osvdb_id}.
|
13
|
-
* Allow insecure gem sources (`http://` and `git://`), if they are hosted on a
|
14
|
-
private network.
|
7
|
+
* Initial release
|
15
8
|
|
16
|
-
|
17
|
-
|
18
|
-
* Added the `--update` option to `bundle-audit check`.
|
19
|
-
* `bundle-audit update` now returns a non-zero exit status on error.
|
20
|
-
* `bundle-audit update` only updates `~/.local/share/ruby-advisory-db`, if it is a git
|
21
|
-
repository.
|
22
|
-
|
23
|
-
### 0.4.0 / 2015-06-30
|
24
|
-
|
25
|
-
* Require ruby >= 1.9.3 due to i18n gem deprecating < 1.9.3.
|
26
|
-
* Added {Bundler::Audit::Advisory#osvdb}.
|
27
|
-
* Resolve the IP addresses of gem sources and ignore intranet gem sources.
|
28
|
-
(PR #90)
|
29
|
-
* Use ISO8601 date format when querying the git timestamp of ruby-advisory-db.
|
30
|
-
(PR #92)
|
31
|
-
|
32
|
-
#### CLI
|
33
|
-
|
34
|
-
* Print the CVE or OSVDB id.
|
35
|
-
* No longer print "Unpatched versions found!" when an insecure gem source
|
36
|
-
is detected. (PR #84)
|
37
|
-
|
38
|
-
### 0.3.1 / 2014-04-20
|
39
|
-
|
40
|
-
* Added thor ~> 0.18 as a dependency.
|
41
|
-
* No longer rely on the vendored version of thor within bundler.
|
42
|
-
* Store the timestamp of when `data/ruby-advisory-db` was last updated in
|
43
|
-
`data/ruby-advisory-db.ts`.
|
44
|
-
* Use `data/ruby-advisory-db.ts` instead of the creation time of the
|
45
|
-
`dataruby-advisory-db` directory, which is always the install time
|
46
|
-
of the rubygem.
|
47
|
-
|
48
|
-
### 0.3.0 / 2013-10-31
|
49
|
-
|
50
|
-
* Added {Bundler::Audit::Database.update!} which uses `git` to download
|
51
|
-
[ruby-advisory-db] to `~/.local/share/ruby-advisory-db`.
|
52
|
-
* {Bundler::Audit::Database.path} now returns the path to either
|
53
|
-
`~/.local/share/ruby-advisory-db` or the vendored copy, depending on which
|
54
|
-
is more recent.
|
55
|
-
|
56
|
-
#### CLI
|
57
|
-
|
58
|
-
* Added the `bundle-audit update` sub-command.
|
59
|
-
|
60
|
-
### 0.2.0 / 2013-03-05
|
61
|
-
|
62
|
-
* Require RubyGems >= 1.8.0. Prior versions of RubyGems could not correctly
|
63
|
-
parse approximate version requirements (`~> 1.2.3`).
|
64
|
-
* Updated the [ruby-advisory-db].
|
65
|
-
* Added {Bundler::Audit::Advisory#unaffected_versions}.
|
66
|
-
* Added {Bundler::Audit::Advisory#unaffected?}.
|
67
|
-
* Added {Bundler::Audit::Advisory#patched?}.
|
68
|
-
* Renamed `Advisory#cve` to {Bundler::Audit::Advisory#id}.
|
69
|
-
|
70
|
-
### 0.1.2 / 2013-02-17
|
71
|
-
|
72
|
-
* Require [bundler] ~> 1.2.
|
73
|
-
* Vendor a full copy of the [ruby-advisory-db].
|
74
|
-
* Added {Bundler::Audit::Advisory#path} for debugging purposes.
|
75
|
-
* Added {Bundler::Audit::Advisory#to_s} for debugging purposes.
|
76
|
-
|
77
|
-
#### CLI
|
78
|
-
|
79
|
-
* Simply parse the `Gemfile.lock` instead of loading the bundle (@grosser).
|
80
|
-
* Exit with non-zero status on failure (@grosser).
|
81
|
-
|
82
|
-
### 0.1.1 / 2013-02-12
|
83
|
-
|
84
|
-
* Fixed a Ruby 1.8 syntax error.
|
85
|
-
|
86
|
-
### Advisories
|
87
|
-
|
88
|
-
* Imported advisories from the [Ruby Advisory DB][ruby-advisory-db].
|
89
|
-
* [CVE-2011-0739](http://www.osvdb.org/show/osvdb/70667)
|
90
|
-
* [CVE-2012-2139](http://www.osvdb.org/show/osvdb/81631)
|
91
|
-
* [CVE-2012-2140](http://www.osvdb.org/show/osvdb/81632)
|
92
|
-
* [CVE-2012-267](http://osvdb.org/83077)
|
93
|
-
* [CVE-2012-1098](http://osvdb.org/79726)
|
94
|
-
* [CVE-2012-1099](http://www.osvdb.org/show/osvdb/79727)
|
95
|
-
* [CVE-2012-2660](http://www.osvdb.org/show/osvdb/82610)
|
96
|
-
* [CVE-2012-2661](http://www.osvdb.org/show/osvdb/82403)
|
97
|
-
* [CVE-2012-3424](http://www.osvdb.org/show/osvdb/84243)
|
98
|
-
* [CVE-2012-3463](http://osvdb.org/84515)
|
99
|
-
* [CVE-2012-3464](http://www.osvdb.org/show/osvdb/84516)
|
100
|
-
* [CVE-2012-3465](http://www.osvdb.org/show/osvdb/84513)
|
101
|
-
|
102
|
-
### CLI
|
103
|
-
|
104
|
-
* If the advisory has no `patched_versions`, recommend removing or disabling
|
105
|
-
the gem until a patch is made available.
|
106
|
-
|
107
|
-
### 0.1.0 / 2013-02-11
|
108
|
-
|
109
|
-
* Initial release:
|
110
|
-
* Checks for vulnerable versions of gems in `Gemfile.lock`.
|
111
|
-
* Prints advisory information.
|
112
|
-
* Does not require a network connection.
|
113
|
-
|
114
|
-
#### Advisories
|
115
|
-
|
116
|
-
* [CVE-2013-0269](http://direct.osvdb.org/show/osvdb/90074)
|
117
|
-
* [CVE-2013-0263](http://osvdb.org/show/osvdb/89939)
|
118
|
-
* [CVE-2013-0155](http://osvdb.org/show/osvdb/89025)
|
119
|
-
* [CVE-2013-0156](http://osvdb.org/show/osvdb/89026)
|
120
|
-
* [CVE-2013-0276](http://direct.osvdb.org/show/osvdb/90072)
|
121
|
-
* [CVE-2013-0277](http://direct.osvdb.org/show/osvdb/90073)
|
122
|
-
* [CVE-2013-0333](http://osvdb.org/show/osvdb/89594)
|
123
|
-
|
124
|
-
[bundler]: http://gembundler.com/
|
125
|
-
[ruby-advisory-db]: https://github.com/rubysec/ruby-advisory-db#readme
|
9
|
+
[bundler]: http://bundler.io/
|
10
|
+
[ruby-mem-advisory-db]: https://github.com/rubymem/ruby-mem-advisory-db#readme
|
data/Gemfile
CHANGED
@@ -9,7 +9,7 @@ group :development do
|
|
9
9
|
gem 'rubygems-tasks', '~> 0.2'
|
10
10
|
gem 'rspec', '~> 3.0'
|
11
11
|
gem 'yard', '~> 0.9'
|
12
|
-
gem 'simplecov', '~> 0.
|
12
|
+
gem 'simplecov', '~> 0.21.2', :require => false
|
13
13
|
end
|
14
14
|
|
15
15
|
gem "byebug", "~> 11.0", :groups => [:development, :test]
|
data/README.md
CHANGED
@@ -3,19 +3,19 @@
|
|
3
3
|
* [Homepage](https://github.com/rubymem/bundler-leak#readme)
|
4
4
|
* [Issues](https://github.com/rubymem/bundler-leak/issues)
|
5
5
|
* [Documentation](http://rubydoc.info/gems/bundler-leak/frames)
|
6
|
-
* [Email](mailto:
|
7
|
-
* [![Build Status](https://travis-ci.org/rubymem/bundler-leak.svg?branch=
|
6
|
+
* [Email](mailto:oss at ombulabs.com)
|
7
|
+
* [![Build Status](https://travis-ci.org/rubymem/bundler-leak.svg?branch=main)](https://travis-ci.org/rubymem/bundler-leak)
|
8
8
|
* [![Code Climate](https://codeclimate.com/github/rubymem/bundler-leak.svg)](https://codeclimate.com/github/rubymem/bundler-leak)
|
9
9
|
|
10
10
|
## Description
|
11
11
|
|
12
|
-
|
12
|
+
The best tool to find leaky gems in your dependencies. Make sure memory leaks
|
13
|
+
are not in your gem dependencies.
|
13
14
|
|
14
15
|
## Features
|
15
16
|
|
16
|
-
* Checks for memory leaks of gems in `Gemfile.lock
|
17
|
-
* Prints memory leak information
|
18
|
-
* Does not require a network connection.
|
17
|
+
* Checks for memory leaks of gems in `Gemfile.lock`
|
18
|
+
* Prints memory leak information
|
19
19
|
|
20
20
|
## Synopsis
|
21
21
|
|
@@ -45,15 +45,15 @@ Update the [ruby-mem-advisory-db] that `bundle leak` uses:
|
|
45
45
|
$ bundle leak update
|
46
46
|
|
47
47
|
cd data/ruby-mem-advisory-db
|
48
|
-
git pull origin
|
48
|
+
git pull origin main
|
49
49
|
remote: Enumerating objects: 14, done.
|
50
50
|
remote: Counting objects: 100% (14/14), done.
|
51
51
|
remote: Compressing objects: 100% (4/4), done.
|
52
52
|
remote: Total 9 (delta 5), reused 7 (delta 4), pack-reused 0
|
53
53
|
Unpacking objects: 100% (9/9), done.
|
54
54
|
From github.com:rubymem/ruby-mem-advisory-db
|
55
|
-
* branch
|
56
|
-
3254525..c4fc78e
|
55
|
+
* branch main -> FETCH_HEAD
|
56
|
+
3254525..c4fc78e main -> origin/main
|
57
57
|
Updating 3254525..c4fc78e
|
58
58
|
Fast-forward
|
59
59
|
README.md | 68 ++++++++++++++++++++------------------------------------------------
|
@@ -88,12 +88,12 @@ task default: 'bundle:leak'
|
|
88
88
|
## Contributing
|
89
89
|
|
90
90
|
1. Clone the repo
|
91
|
-
1. `
|
91
|
+
1. `./bin/setup` # To populate data dir.
|
92
92
|
1. `bundle exec rake`
|
93
93
|
|
94
94
|
## License
|
95
95
|
|
96
|
-
Copyright (c) 2019
|
96
|
+
Copyright (c) 2019 OmbuLabs (hello at ombulabs.com)
|
97
97
|
|
98
98
|
Copyright (c) 2013-2016 Hal Brodigan (postmodern.mod3 at gmail.com)
|
99
99
|
|
@@ -116,3 +116,12 @@ along with bundler-leak. If not, see <http://www.gnu.org/licenses/>.
|
|
116
116
|
[bundler]: https://github.com/carlhuda/bundler#readme
|
117
117
|
|
118
118
|
[ruby-mem-advisory-db]: https://github.com/rubymem/ruby-mem-advisory-db
|
119
|
+
|
120
|
+
## Code of Conduct
|
121
|
+
|
122
|
+
Everyone interacting in the bundler-leak project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rubymem/bundler-leak/code-of-conduct.md).
|
123
|
+
|
124
|
+
## FastRuby.io
|
125
|
+
![fastruby](https://github.com/rubymem/bundler-leak/raw/main/fastruby-logo.png)
|
126
|
+
|
127
|
+
`bundler-leak` is maintained and funded by FastRuby.io, inc. The names and logos for FastRuby.io are trademarks of FastRuby.io, inc.
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ namespace :db do
|
|
20
20
|
timestamp = nil
|
21
21
|
|
22
22
|
chdir 'data/ruby-mem-advisory-db' do
|
23
|
-
sh 'git', 'pull', 'origin', '
|
23
|
+
sh 'git', 'pull', 'origin', 'main'
|
24
24
|
|
25
25
|
File.open('../ruby-mem-advisory-db.ts','w') do |file|
|
26
26
|
file.write Time.parse(`git log --pretty="%cd" -1`).utc
|
@@ -36,22 +36,9 @@ end
|
|
36
36
|
require 'rspec/core/rake_task'
|
37
37
|
RSpec::Core::RakeTask.new
|
38
38
|
|
39
|
-
namespace :spec do
|
40
|
-
task :bundle do
|
41
|
-
root = 'spec/bundle'
|
42
|
-
|
43
|
-
%w[secure unpatched_gems insecure_sources].each do |bundle|
|
44
|
-
chdir(File.join(root,bundle)) do
|
45
|
-
sh 'unset BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT && bundle install --path ../../../vendor/bundle'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
task :spec => 'spec:bundle'
|
51
|
-
|
52
39
|
task :test => :spec
|
53
40
|
task :default => :spec
|
54
41
|
|
55
42
|
require 'yard'
|
56
|
-
YARD::Rake::YardocTask.new
|
43
|
+
YARD::Rake::YardocTask.new
|
57
44
|
task :doc => :yard
|
data/bin/setup
ADDED
data/bundler-leak.gemspec
CHANGED
@@ -33,8 +33,9 @@ Gem::Specification.new do |gem|
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
gem.bindir = "exe"
|
36
37
|
gem.executables = gemspec.fetch('executables') do
|
37
|
-
glob['
|
38
|
+
glob['exe/*'].map { |path| File.basename(path) }
|
38
39
|
end
|
39
40
|
gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
|
40
41
|
|
data/code-of-conduct.md
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to make participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies within all project spaces, and it also applies when
|
49
|
+
an individual is representing the project or its community in public spaces.
|
50
|
+
Examples of representing a project or community include using an official
|
51
|
+
project e-mail address, posting via an official social media account, or acting
|
52
|
+
as an appointed representative at an online or offline event. Representation of
|
53
|
+
a project may be further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at [oss@ombulabs.com]. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
74
|
+
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
77
|
+
|
@@ -1 +1 @@
|
|
1
|
-
2019-08-
|
1
|
+
2019-08-28 18:09:52 UTC
|
data/{bin → exe}/bundle-leak
RENAMED
File without changes
|
data/{bin → exe}/bundler-leak
RENAMED
File without changes
|
data/fastruby-logo.png
ADDED
Binary file
|
data/gemspec.yml
CHANGED
@@ -20,14 +20,17 @@ require 'yaml'
|
|
20
20
|
|
21
21
|
module Bundler
|
22
22
|
module Plumber
|
23
|
-
class Advisory < Struct.new(
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
class Advisory < Struct.new(
|
24
|
+
:gem,
|
25
|
+
:path,
|
26
|
+
:id,
|
27
|
+
:url,
|
28
|
+
:title,
|
29
|
+
:date,
|
30
|
+
:description,
|
31
|
+
:unaffected_versions,
|
32
|
+
:patched_versions
|
33
|
+
)
|
31
34
|
|
32
35
|
#
|
33
36
|
# Loads the advisory from a YAML file.
|
@@ -41,7 +44,7 @@ module Bundler
|
|
41
44
|
#
|
42
45
|
def self.load(path)
|
43
46
|
id = File.basename(path).chomp('.yml')
|
44
|
-
data =
|
47
|
+
data = load_advisory_from_yaml(path)
|
45
48
|
|
46
49
|
unless data.kind_of?(Hash)
|
47
50
|
raise("advisory data in #{path.dump} was not a Hash")
|
@@ -54,6 +57,7 @@ module Bundler
|
|
54
57
|
}
|
55
58
|
|
56
59
|
return new(
|
60
|
+
data['gem'],
|
57
61
|
path,
|
58
62
|
id,
|
59
63
|
data['url'],
|
@@ -65,6 +69,12 @@ module Bundler
|
|
65
69
|
)
|
66
70
|
end
|
67
71
|
|
72
|
+
def self.load_advisory_from_yaml(path)
|
73
|
+
return YAML.load_file(path, permitted_classes: [Date]) if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('4')
|
74
|
+
|
75
|
+
YAML.load_file(path)
|
76
|
+
end
|
77
|
+
|
68
78
|
#
|
69
79
|
# Checks whether the version is not affected by the advisory.
|
70
80
|
#
|
@@ -100,15 +110,15 @@ module Bundler
|
|
100
110
|
end
|
101
111
|
|
102
112
|
#
|
103
|
-
# Checks whether the version is
|
113
|
+
# Checks whether the version is leaky to the advisory.
|
104
114
|
#
|
105
115
|
# @param [Gem::Version] version
|
106
116
|
# The version to compare against {#patched_versions}.
|
107
117
|
#
|
108
118
|
# @return [Boolean]
|
109
|
-
# Specifies whether the version is
|
119
|
+
# Specifies whether the version is leaky to the advisory or not.
|
110
120
|
#
|
111
|
-
def
|
121
|
+
def leaky?(version)
|
112
122
|
!patched?(version) && !unaffected?(version)
|
113
123
|
end
|
114
124
|
|
data/lib/bundler/plumber/cli.rb
CHANGED
@@ -30,19 +30,20 @@ module Bundler
|
|
30
30
|
default_task :check
|
31
31
|
map '--version' => :version
|
32
32
|
|
33
|
-
desc 'check', 'Checks the Gemfile.lock for
|
33
|
+
desc 'check', 'Checks the Gemfile.lock for known memory leaks'
|
34
34
|
method_option :quiet, :type => :boolean, :aliases => '-q'
|
35
35
|
method_option :verbose, :type => :boolean, :aliases => '-v'
|
36
|
+
method_option :ignore, :type => :array, :aliases => '-i'
|
36
37
|
method_option :update, :type => :boolean, :aliases => '-u'
|
37
38
|
|
38
39
|
def check
|
39
40
|
update if options[:update]
|
40
41
|
|
41
42
|
scanner = Scanner.new
|
42
|
-
|
43
|
+
leaky = false
|
43
44
|
|
44
|
-
scanner.scan do |result|
|
45
|
-
|
45
|
+
scanner.scan(ignore: options.ignore) do |result|
|
46
|
+
leaky = true
|
46
47
|
|
47
48
|
case result
|
48
49
|
when Scanner::UnpatchedGem
|
@@ -50,11 +51,11 @@ module Bundler
|
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
53
|
-
if
|
54
|
-
say "
|
54
|
+
if leaky
|
55
|
+
say "Leaks found!", :red
|
55
56
|
exit 1
|
56
57
|
else
|
57
|
-
say("No
|
58
|
+
say("No leaks found", :green) unless options.quiet?
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
@@ -75,7 +76,7 @@ module Bundler
|
|
75
76
|
end
|
76
77
|
|
77
78
|
unless options.quiet?
|
78
|
-
|
79
|
+
say("ruby-mem-advisory-db: #{Database.new.size} advisories", :green)
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|