rails-audit 0.50.0 → 1.3.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 +5 -5
- data/.rubocop.yml +2 -0
- data/README.md +3 -4
- data/bin/rails-audit +1 -1
- data/config/audit.yml +3 -0
- data/lib/rails-audit/audit.rb +5 -4
- data/lib/rails-audit/audits.rb +1 -1
- data/lib/rails-audit/audits/brakeman.rb +1 -1
- data/lib/rails-audit/audits/bundler_audit.rb +1 -1
- data/lib/rails-audit/audits/cane.rb +1 -1
- data/lib/rails-audit/audits/consistency_fail.rb +1 -1
- data/lib/rails-audit/audits/license_finder.rb +1 -1
- data/lib/rails-audit/audits/rails_best_practices.rb +1 -1
- data/lib/rails-audit/runner.rb +8 -8
- data/lib/rails-audit/version.rb +2 -2
- data/lib/{rails-audit.rb → rails_audit.rb} +0 -0
- data/rails-audit.gemspec +12 -14
- metadata +11 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f856bc65b7f671c5681a4fb9cf3bf718306aa6408273fda61fc4fb79d134b117
|
4
|
+
data.tar.gz: ed497fe67f7edbd65ebb7b26891d603b693901416165bb351f5ce59dae201420
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb4fee037f03a005e72e5cbd5d799a0dc395f961165dd81882b168c97185d19b2e60d56fbc0dac62fb136279867fc6c215a40f7420b6b726b4e9494a00b0bba
|
7
|
+
data.tar.gz: 0c7d36d3afe8f4b832074d3daef4c9bc5c2ed4963d8f7bf4d6e01f04de4b182da95146192c6666f8a0ffb94dab4027a8ec2ad2a65973393833e398605c595f66
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[](http://badge.fury.io/rb/rails-audit)
|
2
|
-
[](https://gemnasium.com/cschramm/rails-audit)
|
3
2
|
[](https://codeclimate.com/github/cschramm/rails-audit)
|
4
3
|
|
5
4
|
# Rails Audit
|
@@ -18,14 +17,14 @@ vary if a specific version of this gem is included in a project's bundle.
|
|
18
17
|
|
19
18
|
## Configuration
|
20
19
|
|
21
|
-
Additional parameters can be passed to any audit's binary by using
|
22
|
-
file. A configuration for cane could look like the following:
|
20
|
+
Additional parameters can be passed to any audit's binary by using a
|
21
|
+
config/audit.yml file. A configuration for cane could look like the following:
|
23
22
|
|
24
23
|
Cane:
|
25
24
|
Parameters: '--style-measure 120 --no-doc'
|
26
25
|
|
27
26
|
This can also be used to extend the command and e.g. redirect the output.
|
28
|
-
(WARNING:
|
27
|
+
(WARNING: Thi hase obvious security implications!) Suppressing the
|
29
28
|
license_finder spinner, which is a good idea in CI, would work like this:
|
30
29
|
|
31
30
|
LicenseFinder:
|
data/bin/rails-audit
CHANGED
data/config/audit.yml
CHANGED
data/lib/rails-audit/audit.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
module RailsAudit
|
2
2
|
class Audit
|
3
|
-
def self.command(
|
3
|
+
def self.command(_rails)
|
4
4
|
self::COMMAND
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.run(config)
|
8
8
|
return true unless config[:enabled] && (config[:rails] || !self::RAILS)
|
9
|
-
|
9
|
+
|
10
|
+
system "#{command config[:rails]} #{config[:params]}"
|
10
11
|
end
|
11
12
|
|
12
|
-
def self.
|
13
|
-
|
13
|
+
def self.name
|
14
|
+
super.split('::')[-1]
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/rails-audit/audits.rb
CHANGED
data/lib/rails-audit/runner.rb
CHANGED
@@ -4,9 +4,9 @@ module RailsAudit
|
|
4
4
|
class Runner
|
5
5
|
def initialize
|
6
6
|
@config = { 'Concurrency' => true, 'Rails' => true }
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
return unless File.exist? 'config/audit.yml'
|
8
|
+
|
9
|
+
@config = @config.merge YAML.load_file('config/audit.yml')
|
10
10
|
end
|
11
11
|
|
12
12
|
def get_config(name)
|
@@ -36,8 +36,8 @@ module RailsAudit
|
|
36
36
|
failures = []
|
37
37
|
|
38
38
|
Audits::ALL.each do |audit|
|
39
|
-
success = audit.run get_config(audit.
|
40
|
-
failures << audit.
|
39
|
+
success = audit.run get_config(audit.name)
|
40
|
+
failures << audit.name unless success
|
41
41
|
end
|
42
42
|
|
43
43
|
failures
|
@@ -49,12 +49,12 @@ module RailsAudit
|
|
49
49
|
|
50
50
|
threads = Audits::ALL.map do |audit|
|
51
51
|
Thread.new do
|
52
|
-
success = audit.run get_config(audit.
|
53
|
-
mutex.synchronize { failures << audit.
|
52
|
+
success = audit.run get_config(audit.name)
|
53
|
+
mutex.synchronize { failures << audit.name unless success }
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
threads.each
|
57
|
+
threads.each(&:join)
|
58
58
|
|
59
59
|
failures
|
60
60
|
end
|
data/lib/rails-audit/version.rb
CHANGED
File without changes
|
data/rails-audit.gemspec
CHANGED
@@ -1,37 +1,35 @@
|
|
1
|
-
|
2
|
-
require File.expand_path('../lib/rails-audit/version', __FILE__)
|
1
|
+
require File.expand_path('lib/rails-audit/version', __dir__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |s|
|
5
4
|
s.name = 'rails-audit'
|
6
5
|
s.version = RailsAudit::Version.to_s
|
7
6
|
s.platform = Gem::Platform::RUBY
|
8
7
|
s.author = 'Christopher Schramm'
|
9
|
-
s.email = 'cschramm
|
8
|
+
s.email = 'rails-audit@cschramm.eu'
|
10
9
|
s.homepage = 'https://github.com/cschramm/rails-audit'
|
11
|
-
s.description = %
|
10
|
+
s.description = %(
|
12
11
|
Runs multiple audit and review tools to ensure quality and security of
|
13
12
|
Rails projects
|
14
|
-
|
15
|
-
s.summary =
|
16
|
-
Runs multiple audit and review tools to ensure quality and security of
|
17
|
-
Rails projects
|
18
|
-
}
|
13
|
+
)
|
14
|
+
s.summary = s.description
|
19
15
|
s.licenses = ['MIT']
|
20
16
|
s.files = `git ls-files`.split("\n")
|
21
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map
|
23
|
-
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
|
19
|
+
File.basename(f)
|
20
|
+
end
|
21
|
+
s.require_paths = %w[lib]
|
24
22
|
s.extra_rdoc_files = ['README.md']
|
25
23
|
|
26
24
|
s.add_development_dependency 'rake'
|
27
25
|
|
28
26
|
s.add_dependency 'bundler'
|
29
27
|
|
30
|
-
s.add_runtime_dependency 'brakeman', '~>
|
28
|
+
s.add_runtime_dependency 'brakeman', '~> 4.8.2'
|
31
29
|
s.add_runtime_dependency 'bundler-audit'
|
32
30
|
s.add_runtime_dependency 'cane', '~> 3.0.0'
|
33
31
|
s.add_runtime_dependency 'consistency_fail'
|
34
32
|
s.add_runtime_dependency 'license_finder'
|
35
|
-
s.add_runtime_dependency 'rails_best_practices', '~> 1.
|
36
|
-
s.add_runtime_dependency 'rubocop', '~> 0.
|
33
|
+
s.add_runtime_dependency 'rails_best_practices', '~> 1.20.0'
|
34
|
+
s.add_runtime_dependency 'rubocop', '~> 0.86.0'
|
37
35
|
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:
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2020-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 4.8.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 4.8.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler-audit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,31 +114,31 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.20.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.20.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.86.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.86.0
|
139
139
|
description: "\n Runs multiple audit and review tools to ensure quality and security
|
140
140
|
of\n Rails projects\n "
|
141
|
-
email: cschramm
|
141
|
+
email: rails-audit@cschramm.eu
|
142
142
|
executables:
|
143
143
|
- rails-audit
|
144
144
|
extensions: []
|
@@ -154,7 +154,6 @@ files:
|
|
154
154
|
- bin/rails-audit
|
155
155
|
- config/audit.yml
|
156
156
|
- config/license_finder.yml
|
157
|
-
- lib/rails-audit.rb
|
158
157
|
- lib/rails-audit/audit.rb
|
159
158
|
- lib/rails-audit/audits.rb
|
160
159
|
- lib/rails-audit/audits/brakeman.rb
|
@@ -166,6 +165,7 @@ files:
|
|
166
165
|
- lib/rails-audit/audits/rubocop.rb
|
167
166
|
- lib/rails-audit/runner.rb
|
168
167
|
- lib/rails-audit/version.rb
|
168
|
+
- lib/rails_audit.rb
|
169
169
|
- rails-audit.gemspec
|
170
170
|
homepage: https://github.com/cschramm/rails-audit
|
171
171
|
licenses:
|
@@ -186,11 +186,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
|
-
|
190
|
-
rubygems_version: 2.5.1
|
189
|
+
rubygems_version: 3.0.8
|
191
190
|
signing_key:
|
192
191
|
specification_version: 4
|
193
192
|
summary: Runs multiple audit and review tools to ensure quality and security of Rails
|
194
193
|
projects
|
195
194
|
test_files: []
|
196
|
-
has_rdoc:
|