pronto-brakeman 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/pronto/brakeman/version.rb +1 -1
- data/lib/pronto/brakeman.rb +16 -21
- data/pronto-brakeman.gemspec +2 -2
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2671f9897b66aa34b11db36114386c2d1023b04
|
4
|
+
data.tar.gz: f1d0369f39adbfe1ce3eded82589d15296ee3d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73fa6c38b8da1d48d2b68f4f31396f072cad5a42cff7a445f39ae4d0d95f1229189fe1a7ceda6cb8fd1197b16f33cc69571be639dccb74c569ec7c0fd911909c
|
7
|
+
data.tar.gz: 4861ae69b9249b7530f65517cf3427187827593680872d3cc04595c4816f0aeb558431c2d29978b2bc28173a26f3db1a14b3e403f19413ff5aafaf4f46ede36b
|
data/LICENSE
CHANGED
data/lib/pronto/brakeman.rb
CHANGED
@@ -3,22 +3,17 @@ require 'brakeman'
|
|
3
3
|
|
4
4
|
module Pronto
|
5
5
|
class Brakeman < Runner
|
6
|
-
def run
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
.select { |patch| ruby_file?(patch.new_file_full_path) }
|
6
|
+
def run
|
7
|
+
files = ruby_patches.map do |patch|
|
8
|
+
patch.new_file_full_path.relative_path_from(repo_path).to_s
|
9
|
+
end
|
11
10
|
|
12
|
-
|
11
|
+
return [] unless files.any?
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
messages_for(ruby_patches, output).compact
|
19
|
-
else
|
20
|
-
[]
|
21
|
-
end
|
13
|
+
output = ::Brakeman.run(app_path: repo_path,
|
14
|
+
output_formats: [:to_s],
|
15
|
+
only_files: files)
|
16
|
+
messages_for(ruby_patches, output).compact
|
22
17
|
rescue ::Brakeman::NoApplication
|
23
18
|
[]
|
24
19
|
end
|
@@ -27,19 +22,19 @@ module Pronto
|
|
27
22
|
output.filtered_warnings.map do |warning|
|
28
23
|
patch = patch_for_warning(ruby_patches, warning)
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
new_message(line, warning) if line
|
25
|
+
next unless patch
|
26
|
+
line = patch.added_lines.find do |added_line|
|
27
|
+
added_line.new_lineno == warning.line
|
36
28
|
end
|
29
|
+
|
30
|
+
new_message(line, warning) if line
|
37
31
|
end
|
38
32
|
end
|
39
33
|
|
40
34
|
def new_message(line, warning)
|
41
35
|
Message.new(line.patch.delta.new_file[:path], line, :warning,
|
42
|
-
"Possible security vulnerability: #{warning.message}"
|
36
|
+
"Possible security vulnerability: #{warning.message}",
|
37
|
+
nil, self.class)
|
43
38
|
end
|
44
39
|
|
45
40
|
def patch_for_warning(ruby_patches, warning)
|
data/pronto-brakeman.gemspec
CHANGED
@@ -32,8 +32,8 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.extra_rdoc_files = ['LICENSE', 'README.md']
|
33
33
|
s.require_paths = ['lib']
|
34
34
|
|
35
|
-
s.add_runtime_dependency('pronto', '~> 0.
|
36
|
-
s.add_runtime_dependency('brakeman', '~> 3.
|
35
|
+
s.add_runtime_dependency('pronto', '~> 0.6.0')
|
36
|
+
s.add_runtime_dependency('brakeman', '~> 3.2', '>= 3.2.0')
|
37
37
|
s.add_development_dependency('rake', '~> 10.4')
|
38
38
|
s.add_development_dependency('rspec', '~> 3.3')
|
39
39
|
s.add_development_dependency('rspec-its', '~> 1.2')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-brakeman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -16,28 +16,34 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: brakeman
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: '3.2'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 3.2.0
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
43
|
+
version: '3.2'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.2.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|