schoolmaster 0.0.1 → 0.0.2

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: a043a75aa06e9f71ded6c47b316097a1873d909a
4
- data.tar.gz: d31f34e033cf8d6b150ab678070028849ba91351
3
+ metadata.gz: 20c8c3c1b0ecb67f8bc7ea55c33b76654c239a29
4
+ data.tar.gz: 74b0c8386a18647975d280932c4698a9af10710f
5
5
  SHA512:
6
- metadata.gz: 22aead6a0807d70be8b204e62cacf5de11f71b497cb328df23c42527f93d9cb97819bc62cf5df7917358b460af6c8f2ca135966da29d02683d68fd6eef38714e
7
- data.tar.gz: 0bb6c6151cda7338ecee8c8e7e2f95dace60e2bfe339705cc0a9c4931731b749b8d7529e31129e929a74937b4d2258f3172c940764a3a23c7791ae429059fa6b
6
+ metadata.gz: ec65deb77e474c5e209a89bc6406b3a1cc161d4bd88e213e47ada73af90ce5ae39c84664edc84d9e1df65f4908428235c488315c77304d5703104fc28651085d
7
+ data.tar.gz: 5b3ccff1010ec36302ca7f2e342fa90841b845582228498b70022b3e96d70d1cf7db0c1713aed9977b298b58fa8165b639597b58ca0421538dfa08ea380c7d5b
@@ -0,0 +1,3 @@
1
+ ## 0.0.2
2
+
3
+ - #3 Adds bundler-audit to the suite.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Schoolmaster
2
2
 
3
- I built schoolmaster as a rake task originally to run a few of my favourite code metrix gems.
3
+ [![Code Climate](https://codeclimate.com/github/alex-handley/schoolmaster/badges/gpa.svg)](https://codeclimate.com/github/alex-handley/schoolmaster)
4
+
5
+ I built schoolmaster as a rake task originally to run a few of my favourite code metric gems.
4
6
  The rake task helped my apprentices check their work before submitting a pullrequest for QA.
5
7
 
6
8
  The gem currently runs the following checks:
@@ -8,6 +10,7 @@ The gem currently runs the following checks:
8
10
  - https://github.com/presidentbeef/brakeman
9
11
  - https://github.com/railsbp/rails_best_practices
10
12
  - https://github.com/square/cane
13
+ - https://github.com/rubysec/bundler-audit
11
14
  - Schoolmaster currently runs Rspec, this is going to be configurable in the next release.
12
15
 
13
16
  ## Installation
@@ -42,6 +45,7 @@ Available configuration options:
42
45
  | test_custom_args | Add additional params for rspec | [] |
43
46
  | best_practices_custom_args | Add additional params to Rails Best Practice | [] |
44
47
  | brakeman_custom_args | Add additional params to Brakeman | [] |
48
+ | bundler_audit_custom_args | Add additional params to Bundler Audit | [] |
45
49
 
46
50
  ### Example configuration block
47
51
 
@@ -55,6 +59,7 @@ To customize schoolmaster add an initializer:
55
59
  c.test_custom_args = ["-f doc"]
56
60
  c.best_practices_custom_args = ["--with-git"]
57
61
  c.brakeman_custom_args = ["--skip-files app/controllers/application_controller.rb"]
62
+ c.bundler_audit_custom_args = ["--ignore OSVDB-108664"]
58
63
  end
59
64
  end
60
65
 
@@ -66,3 +71,4 @@ To customize schoolmaster add an initializer:
66
71
  4. Ensure the tests pass
67
72
  5. Push to the branch (`git push origin my-new-feature`)
68
73
  6. Create new Pull Request
74
+
@@ -0,0 +1,10 @@
1
+ module Schoolmaster
2
+ class BundlerAuditAnalyser < BaseAnalyser
3
+
4
+ def initialize(params = {})
5
+ super
6
+ @command = "bundle-audit check" if command.empty?
7
+ end
8
+ end
9
+ end
10
+
@@ -2,7 +2,7 @@ module Schoolmaster
2
2
  class Configuration
3
3
  attr_accessor :require_file_comments, :debug, :git_logger, :characters_per_line,
4
4
  :cane_custom_args, :best_practices_custom_args, :test_custom_args,
5
- :brakeman_custom_args
5
+ :brakeman_custom_args, :bundler_audit_custom_args
6
6
 
7
7
  def initialize
8
8
  @require_file_comments = false
@@ -14,6 +14,7 @@ module Schoolmaster
14
14
  @best_practices_custom_args = []
15
15
  @test_custom_args = []
16
16
  @brakeman_custom_args = []
17
+ @bundler_audit_custom_args = [""]
17
18
  end
18
19
  end
19
20
  end
@@ -14,6 +14,9 @@ module Schoolmaster
14
14
 
15
15
  Schoolmaster::TestAnalyser.new(
16
16
  args: Schoolmaster.configuration.test_custom_args).run
17
+
18
+ Schoolmaster::BundlerAuditAnalyser.new(
19
+ args: Schoolmaster.configuration.bundler_audit_custom_args).run
17
20
  end
18
21
  end
19
22
  end
@@ -1,3 +1,3 @@
1
1
  module Schoolmaster
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "cane", "~> 2.6.0"
27
27
  spec.add_dependency "brakeman", "~> 3.0.1"
28
28
  spec.add_dependency "rails_best_practices", "~> 1.15.0"
29
+ spec.add_dependency "bundler-audit", "~> 0.3.1"
29
30
  end
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe Schoolmaster::BundlerAuditAnalyser do
4
+ context "the command param" do
5
+ it "should have the default system command" do
6
+ analyser = Schoolmaster::BundlerAuditAnalyser.new
7
+ expected_command = "bundle-audit check "
8
+ expect(analyser).to receive(:system).with expected_command
9
+ analyser.run
10
+ end
11
+
12
+ it "should be able to be overridden" do
13
+ analyser = Schoolmaster::BundlerAuditAnalyser.new(command: "check app")
14
+ expected_command = "check app "
15
+ expect(analyser).to receive(:system).with expected_command
16
+ analyser.run
17
+ end
18
+ end
19
+
20
+ context "the debug param" do
21
+ it "should allow debug to be turned on" do
22
+ allow(Schoolmaster.configuration).to receive(:debug).and_return(10)
23
+ analyser = Schoolmaster::BundlerAuditAnalyser.new
24
+ expected_command = "bundle-audit check "
25
+ expect(analyser).to receive(:system).with expected_command
26
+ analyser.run
27
+ end
28
+ end
29
+ end
30
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schoolmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Handley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.15.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: bundler-audit
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.3.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.3.1
111
125
  description:
112
126
  email:
113
127
  - alex@seriousfox.co.uk
@@ -117,6 +131,7 @@ extensions: []
117
131
  extra_rdoc_files: []
118
132
  files:
119
133
  - ".gitignore"
134
+ - CHANGELOG.md
120
135
  - Gemfile
121
136
  - LICENSE
122
137
  - README.md
@@ -126,6 +141,7 @@ files:
126
141
  - lib/schoolmaster/analysers/base_analyser.rb
127
142
  - lib/schoolmaster/analysers/best_practices_analyser.rb
128
143
  - lib/schoolmaster/analysers/brakeman_analyser.rb
144
+ - lib/schoolmaster/analysers/bundler_audit_analyser.rb
129
145
  - lib/schoolmaster/analysers/cane_analyser.rb
130
146
  - lib/schoolmaster/analysers/test_analyser.rb
131
147
  - lib/schoolmaster/configuration.rb
@@ -135,6 +151,7 @@ files:
135
151
  - spec/analysers/base_analyser_spec.rb
136
152
  - spec/analysers/best_practices_analyser_spec.rb
137
153
  - spec/analysers/brakeman_analyser_spec.rb
154
+ - spec/analysers/bundler_audit_analyser_spec.rb
138
155
  - spec/analysers/cane_analyser_spec.rb
139
156
  - spec/analysers/test_analyser_spec.rb
140
157
  - spec/spec_helper.rb
@@ -167,6 +184,7 @@ test_files:
167
184
  - spec/analysers/base_analyser_spec.rb
168
185
  - spec/analysers/best_practices_analyser_spec.rb
169
186
  - spec/analysers/brakeman_analyser_spec.rb
187
+ - spec/analysers/bundler_audit_analyser_spec.rb
170
188
  - spec/analysers/cane_analyser_spec.rb
171
189
  - spec/analysers/test_analyser_spec.rb
172
190
  - spec/spec_helper.rb