rails-audit 0.50.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d71eab8b6dfab712a4ba30ffb41118d581b263a2
4
- data.tar.gz: e7e56460e21c550f7de7182173fc96907e70afca
2
+ SHA256:
3
+ metadata.gz: f856bc65b7f671c5681a4fb9cf3bf718306aa6408273fda61fc4fb79d134b117
4
+ data.tar.gz: ed497fe67f7edbd65ebb7b26891d603b693901416165bb351f5ce59dae201420
5
5
  SHA512:
6
- metadata.gz: b064fe0df32db16934909957aef448475b5e58d364c18f65e10f76660ce7f26578bbc6cfc6c0b7d633e34dce33fc2b10602448a40ceb18e3a7fa2741de0f8bad
7
- data.tar.gz: 806c6dae84ed66ab60922663d74a205bbdb01e40e6b93952fa19f3a0a3428878d29b8408968f09618231759bc2338fd37fc9582674b73cf5388a30095cbef4ae
6
+ metadata.gz: 7fb4fee037f03a005e72e5cbd5d799a0dc395f961165dd81882b168c97185d19b2e60d56fbc0dac62fb136279867fc6c215a40f7420b6b726b4e9494a00b0bba
7
+ data.tar.gz: 0c7d36d3afe8f4b832074d3daef4c9bc5c2ed4963d8f7bf4d6e01f04de4b182da95146192c6666f8a0ffb94dab4027a8ec2ad2a65973393833e398605c595f66
@@ -1,2 +1,4 @@
1
1
  Documentation:
2
2
  Enabled: false
3
+ Style/FrozenStringLiteralComment:
4
+ EnforcedStyle: never
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/rails-audit.png)](http://badge.fury.io/rb/rails-audit)
2
- [![Dependency Status](https://gemnasium.com/cschramm/rails-audit.png)](https://gemnasium.com/cschramm/rails-audit)
3
2
  [![Code Climate](https://codeclimate.com/github/cschramm/rails-audit.png)](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 an .audit.yml
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: This hase obvious security implications!) Suppressing the
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:
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rails-audit'
3
+ require 'rails_audit'
4
4
 
5
5
  exit(1) unless RailsAudit::Runner.new.run
@@ -2,3 +2,6 @@ Rails: false
2
2
 
3
3
  Cane:
4
4
  Parameters: --no-doc
5
+
6
+ LicenseFinder:
7
+ Enabled: false
@@ -1,16 +1,17 @@
1
1
  module RailsAudit
2
2
  class Audit
3
- def self.command(rails)
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
- system "bundle exec #{command config[:rails]} #{config[:params]}"
9
+
10
+ system "#{command config[:rails]} #{config[:params]}"
10
11
  end
11
12
 
12
- def self.get_name
13
- name.split('::')[-1]
13
+ def self.name
14
+ super.split('::')[-1]
14
15
  end
15
16
  end
16
17
  end
@@ -8,6 +8,6 @@ module RailsAudit
8
8
  LicenseFinder,
9
9
  RailsBestPractices,
10
10
  Rubocop
11
- ]
11
+ ].freeze
12
12
  end
13
13
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class Brakeman < RailsAudit::Audit
4
- COMMAND = 'brakeman -z'
4
+ COMMAND = 'brakeman -z'.freeze
5
5
  RAILS = true
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class BundlerAudit < RailsAudit::Audit
4
- COMMAND = 'bundle-audit'
4
+ COMMAND = 'bundle-audit'.freeze
5
5
  RAILS = false
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class Cane < RailsAudit::Audit
4
- COMMAND = 'cane'
4
+ COMMAND = 'cane'.freeze
5
5
  RAILS = false
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class ConsistencyFail < RailsAudit::Audit
4
- COMMAND = 'consistency_fail'
4
+ COMMAND = 'consistency_fail'.freeze
5
5
  RAILS = true
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class LicenseFinder < RailsAudit::Audit
4
- COMMAND = 'license_finder'
4
+ COMMAND = 'license_finder'.freeze
5
5
  RAILS = false
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  module Audits
3
3
  class RailsBestPractices < RailsAudit::Audit
4
- COMMAND = 'rails_best_practices'
4
+ COMMAND = 'rails_best_practices'.freeze
5
5
  RAILS = true
6
6
  end
7
7
  end
@@ -4,9 +4,9 @@ module RailsAudit
4
4
  class Runner
5
5
  def initialize
6
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
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.get_name)
40
- failures << audit.get_name unless success
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.get_name)
53
- mutex.synchronize { failures << audit.get_name unless success }
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 { |t| t.join }
57
+ threads.each(&:join)
58
58
 
59
59
  failures
60
60
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  class Version
3
- MAJOR = 0
4
- MINOR = 50
3
+ MAJOR = 1
4
+ MINOR = 3
5
5
  PATCH = 0
6
6
 
7
7
  def self.to_s
File without changes
@@ -1,37 +1,35 @@
1
- # -*- encoding: utf-8 -*-
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@shakaweb.org'
8
+ s.email = 'rails-audit@cschramm.eu'
10
9
  s.homepage = 'https://github.com/cschramm/rails-audit'
11
- s.description = %q{
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 = %q{
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{ |f| File.basename(f) }
23
- s.require_paths = %w(lib)
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', '~> 3.4.0'
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.15.0'
36
- s.add_runtime_dependency 'rubocop', '~> 0.44.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: 0.50.0
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: 2016-10-30 00:00:00.000000000 Z
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: 3.4.0
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: 3.4.0
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.15.0
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.15.0
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.44.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.44.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@shakaweb.org
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
- rubyforge_project:
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: