rails-audit 0.50.0 → 0.51.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
- SHA1:
3
- metadata.gz: d71eab8b6dfab712a4ba30ffb41118d581b263a2
4
- data.tar.gz: e7e56460e21c550f7de7182173fc96907e70afca
2
+ SHA256:
3
+ metadata.gz: 73ff27c392af426d534b8d827b7b4df84a507f2279e717f0b0d32831e85248c0
4
+ data.tar.gz: 004b65dfb37c7338412d989e31b236469bbf2b120838498ecb939896d95a3e5a
5
5
  SHA512:
6
- metadata.gz: b064fe0df32db16934909957aef448475b5e58d364c18f65e10f76660ce7f26578bbc6cfc6c0b7d633e34dce33fc2b10602448a40ceb18e3a7fa2741de0f8bad
7
- data.tar.gz: 806c6dae84ed66ab60922663d74a205bbdb01e40e6b93952fa19f3a0a3428878d29b8408968f09618231759bc2338fd37fc9582674b73cf5388a30095cbef4ae
6
+ metadata.gz: 0efc5536d2ee514628fdf3a66f495c423164a7382c46ebd66aa3256d2374e5ad958d4afec44acde644b1539773a1b3673f225157ddfc8615e4feebe35082e11f
7
+ data.tar.gz: 6b9ff375beed429b368c9cda41447d44a04e016615edaeb83eb10d9e2852efce59a9db42801d952a820bc6684f38839e66835c327bfc21476462b78eb0de4841
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:
@@ -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,16 @@
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
+ system "#{command config[:rails]} #{config[:params]}"
10
10
  end
11
11
 
12
- def self.get_name
13
- name.split('::')[-1]
12
+ def self.name
13
+ super.split('::')[-1]
14
14
  end
15
15
  end
16
16
  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,8 @@ 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
+ @config = @config.merge YAML.load_file('config/audit.yml')
10
9
  end
11
10
 
12
11
  def get_config(name)
@@ -36,8 +35,8 @@ module RailsAudit
36
35
  failures = []
37
36
 
38
37
  Audits::ALL.each do |audit|
39
- success = audit.run get_config(audit.get_name)
40
- failures << audit.get_name unless success
38
+ success = audit.run get_config(audit.name)
39
+ failures << audit.name unless success
41
40
  end
42
41
 
43
42
  failures
@@ -49,12 +48,12 @@ module RailsAudit
49
48
 
50
49
  threads = Audits::ALL.map do |audit|
51
50
  Thread.new do
52
- success = audit.run get_config(audit.get_name)
53
- mutex.synchronize { failures << audit.get_name unless success }
51
+ success = audit.run get_config(audit.name)
52
+ mutex.synchronize { failures << audit.name unless success }
54
53
  end
55
54
  end
56
55
 
57
- threads.each { |t| t.join }
56
+ threads.each(&:join)
58
57
 
59
58
  failures
60
59
  end
@@ -1,7 +1,7 @@
1
1
  module RailsAudit
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 50
4
+ MINOR = 51
5
5
  PATCH = 0
6
6
 
7
7
  def self.to_s
@@ -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
- Gem::Specification.new do |s|
3
+ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
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.3.0'
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.19.2'
34
+ s.add_runtime_dependency 'rubocop', '~> 0.56.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: 0.51.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: 2018-05-16 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.3.0
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.3.0
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.19.2
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.19.2
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.56.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.56.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: []
@@ -187,10 +187,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  requirements: []
189
189
  rubyforge_project:
190
- rubygems_version: 2.5.1
190
+ rubygems_version: 2.7.6
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Runs multiple audit and review tools to ensure quality and security of Rails
194
194
  projects
195
195
  test_files: []
196
- has_rdoc: