rails-audit 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/rails-audit +1 -1
- data/lib/rails-audit/audit.rb +0 -2
- data/lib/rails-audit/runner.rb +42 -38
- data/lib/rails-audit/version.rb +1 -1
- data/rails-audit.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce161897640c1b85ccf195cbe50a7ba9161838bf
|
4
|
+
data.tar.gz: baa9a8d48250e0f74dbd7edf6e27de5bd8b36e88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d98c3f941b471a3d3b4fdb75b035e93d84cebcd466e654d1818f7f0015199c48a2a0c498e3b62f5b367b6132810013bee67b40e6fbe87f089f00dcf7f18cef
|
7
|
+
data.tar.gz: 6759d164a1f578f6ab4f42f504398bb03bfbf8e177d9e2b49fb3651c6555f3fe6801c43c21b3a5c907d4de23ea51aa6419a4adcf74bef26aac6726beb31fe636
|
data/CHANGELOG.md
CHANGED
data/bin/rails-audit
CHANGED
data/lib/rails-audit/audit.rb
CHANGED
data/lib/rails-audit/runner.rb
CHANGED
@@ -1,58 +1,62 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
|
3
3
|
module RailsAudit
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
class Runner
|
5
|
+
def initialize
|
6
|
+
@config = { 'Concurrency' => true, 'Rails' => true }
|
7
|
+
if File.exist? 'config/audit.yml'
|
8
|
+
@config = @config.merge YAML.load_file('config/audit.yml')
|
9
|
+
end
|
10
|
+
end
|
7
11
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def get_config(name)
|
13
|
+
defaults = { 'Parameters' => '', 'Enabled' => true }
|
14
|
+
config = defaults.merge(@config[name] || {})
|
15
|
+
{
|
16
|
+
rails: @config['Rails'],
|
17
|
+
params: config['Parameters'],
|
18
|
+
enabled: config['Enabled']
|
19
|
+
}
|
20
|
+
end
|
16
21
|
|
17
|
-
|
18
|
-
|
22
|
+
def run
|
23
|
+
concurrency = @config['Concurrency']
|
19
24
|
|
20
|
-
|
25
|
+
failures = concurrency && run_threads || run_sequence
|
21
26
|
|
22
|
-
|
27
|
+
if failures.any?
|
28
|
+
puts 'Failed tests:'
|
29
|
+
failures.each { |f| puts f }
|
30
|
+
end
|
23
31
|
|
24
|
-
|
25
|
-
puts 'Failed tests:'
|
26
|
-
failures.each { |f| puts f }
|
32
|
+
failures.none?
|
27
33
|
end
|
28
34
|
|
29
|
-
|
30
|
-
|
35
|
+
def run_sequence
|
36
|
+
failures = []
|
31
37
|
|
32
|
-
|
33
|
-
|
38
|
+
Audits::ALL.each do |audit|
|
39
|
+
success = audit.run get_config(audit.get_name)
|
40
|
+
failures << audit.get_name unless success
|
41
|
+
end
|
34
42
|
|
35
|
-
|
36
|
-
success = audit.run get_config(config, audit.get_name)
|
37
|
-
failures << audit.get_name unless success
|
43
|
+
failures
|
38
44
|
end
|
39
45
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
def self.run_threads(config)
|
44
|
-
failures = []
|
45
|
-
mutex = Mutex.new
|
46
|
+
def run_threads
|
47
|
+
failures = []
|
48
|
+
mutex = Mutex.new
|
46
49
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
threads = Audits::ALL.map do |audit|
|
51
|
+
Thread.new do
|
52
|
+
success = audit.run get_config(audit.get_name)
|
53
|
+
mutex.synchronize { failures << audit.get_name unless success }
|
54
|
+
end
|
51
55
|
end
|
52
|
-
end
|
53
56
|
|
54
|
-
|
57
|
+
threads.each { |t| t.join }
|
55
58
|
|
56
|
-
|
59
|
+
failures
|
60
|
+
end
|
57
61
|
end
|
58
62
|
end
|
data/lib/rails-audit/version.rb
CHANGED
data/rails-audit.gemspec
CHANGED
@@ -33,5 +33,5 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_runtime_dependency 'consistency_fail'
|
34
34
|
s.add_runtime_dependency 'license_finder'
|
35
35
|
s.add_runtime_dependency 'rails_best_practices', '~> 1.14.0'
|
36
|
-
s.add_runtime_dependency 'rubocop', '0.
|
36
|
+
s.add_runtime_dependency 'rubocop', '0.15.0'
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Schramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.15.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.15.0
|
139
139
|
description: "\n Runs multiple audit and review tools to ensure quality and security
|
140
140
|
of\n Rails projects\n "
|
141
141
|
email: cschramm@shakaweb.org
|