pronto-brakeman 0.5.0 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 018b0353555cc3a3fd612185378ce1bc46b8358b
4
- data.tar.gz: 874373a73280a5f722603e6f39e804f374875efb
3
+ metadata.gz: d2671f9897b66aa34b11db36114386c2d1023b04
4
+ data.tar.gz: f1d0369f39adbfe1ce3eded82589d15296ee3d37
5
5
  SHA512:
6
- metadata.gz: 6b4bd15abfeccf7b0e35e70145414cc54079da5071ece51abea3ab8192a7c5b88440b86de8f2fd79a35c2aaeb781f84d29baf32dc91f685afe3dfbb90cc2edbc
7
- data.tar.gz: 722ebdd397081555324e72397bb683dcb127b350eb1fdcff2fdf81a34b329976bd41ca11f44594aa4d0d2678bf205637318fab2e934ef1e8fda757e98084e628
6
+ metadata.gz: 73fa6c38b8da1d48d2b68f4f31396f072cad5a42cff7a445f39ae4d0d95f1229189fe1a7ceda6cb8fd1197b16f33cc69571be639dccb74c569ec7c0fd911909c
7
+ data.tar.gz: 4861ae69b9249b7530f65517cf3427187827593680872d3cc04595c4816f0aeb558431c2d29978b2bc28173a26f3db1a14b3e403f19413ff5aafaf4f46ede36b
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2015 Mindaugas Mozūras
3
+ Copyright (c) 2016 Mindaugas Mozūras
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module BrakemanVersion
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'.freeze
4
4
  end
5
5
  end
@@ -3,22 +3,17 @@ require 'brakeman'
3
3
 
4
4
  module Pronto
5
5
  class Brakeman < Runner
6
- def run(patches, _)
7
- return [] unless patches
8
-
9
- ruby_patches = patches.select { |patch| patch.additions > 0 }
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
- files = ruby_patches.map { |patch| patch.new_file_full_path.to_s }
11
+ return [] unless files.any?
13
12
 
14
- if files.any?
15
- output = ::Brakeman.run(app_path: ruby_patches.first.repo.path,
16
- output_formats: [:to_s],
17
- only_files: files)
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
- if patch
31
- line = patch.added_lines.find do |added_line|
32
- added_line.new_lineno == warning.line
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)
@@ -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.5.0')
36
- s.add_runtime_dependency('brakeman', '~> 3.1.0')
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.5.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: 2015-11-10 00:00:00.000000000 Z
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.5.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.5.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.1.0
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.1.0
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