legendary 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/legendary/info.rb +1 -1
- data/lib/legendary/rspec.rb +11 -7
- data/lib/legendary/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4ef3c710bcc23409a6f1923e4856a0e43ccb2fb
|
4
|
+
data.tar.gz: 74f4a311903ce7b0e9aa2f0108f826385dede885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f10e069ab71f9f7ff08ebcc855fe01e939b6638440d76ce2fd68a2190ea391db9c571a99447ab81b1cc5d08d790f8e47b136020b0411ccf2a71535850a9e716e
|
7
|
+
data.tar.gz: 4d424aaa1dd54984aef7ede5d76516cf9e4a8ea94bc1347d8d7fe607fa52cbb827d9f38cc001ab0f192c06b0606202776d67e8151b4fca72ebc71f7ac1b1020c
|
data/lib/legendary/info.rb
CHANGED
@@ -37,7 +37,7 @@ module Legendary
|
|
37
37
|
|
38
38
|
def vulnerable?
|
39
39
|
# FIXME: speeds things up, but in theory a
|
40
|
-
# a gem might not have a release, but have
|
40
|
+
# a gem might not have a release, but have vulnerablity
|
41
41
|
# return false unless (outdated? || git_outdated?)
|
42
42
|
vulnerabilities.any?
|
43
43
|
end
|
data/lib/legendary/rspec.rb
CHANGED
@@ -1,23 +1,27 @@
|
|
1
1
|
require 'rspec/matchers'
|
2
2
|
|
3
|
-
|
3
|
+
module GemStore
|
4
|
+
def self.gems
|
5
|
+
@gems ||= Legendary::Gems.new.to_a
|
6
|
+
end
|
7
|
+
end
|
4
8
|
|
5
9
|
RSpec::Matchers.define :be_secure do
|
6
10
|
match do |thing|
|
7
|
-
vulnerable_gems =
|
8
|
-
gem.vulnerable?
|
11
|
+
vulnerable_gems = GemStore.gems.collect do |gem|
|
12
|
+
gem if gem.vulnerable?
|
9
13
|
end
|
10
14
|
|
11
|
-
expect(vulnerable_gems.
|
15
|
+
expect(vulnerable_gems.length).to eql(0)
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
15
19
|
RSpec::Matchers.define :be_updated do
|
16
20
|
match do |thing|
|
17
|
-
outdated =
|
18
|
-
gem.outdated?
|
21
|
+
outdated = GemStore.gems.collect do |gem|
|
22
|
+
gem if gem.outdated?
|
19
23
|
end
|
20
24
|
|
21
|
-
expect(outdated.
|
25
|
+
expect(outdated.length).to eql(0)
|
22
26
|
end
|
23
27
|
end
|
data/lib/legendary/version.rb
CHANGED