rake-n-bake 1.4.3 → 2.0.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 +4 -4
- data/.semver +3 -3
- data/README.md +8 -26
- data/Rakefile +0 -1
- data/history.rdoc +4 -0
- data/lib/version.rb +1 -1
- data/tasks/code_quality.rake +16 -63
- data/tasks/rubocop.rake +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d7cf1122d6f3c6e074e72dc9f982177aeaad669
|
4
|
+
data.tar.gz: 35deb0087deb8f23f31ec4b07a05460cc2262bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e83e1e44c433652d321e5e78a0ac948e31ad27ab0a4918d1ec229e448f213e0c739bfb5968ac52f25593b3d85929dee182400b33db94aed2aeab4851ab8cb3e9
|
7
|
+
data.tar.gz: 2e472ccc2b81879a66afb5001e5866697d814ae98b79f4acaf09cb1f728a0e928bff9628ac7dc78fa7d877f0b52b9f424f0fa1e8679b8d34c8b0fa043132990a
|
data/.semver
CHANGED
data/README.md
CHANGED
@@ -34,15 +34,14 @@ Usage
|
|
34
34
|
```ruby
|
35
35
|
require "rake-n-bake"
|
36
36
|
|
37
|
-
task :default => [
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
:"bake:ok_rainbow",
|
37
|
+
task :default => %i[
|
38
|
+
clean
|
39
|
+
bake:rubocop
|
40
|
+
bake:rspec
|
41
|
+
bake:coverage:check_specs
|
42
|
+
bake:bundle-audit
|
43
|
+
bake:rubycritic
|
44
|
+
bake:ok_rainbow
|
46
45
|
]
|
47
46
|
|
48
47
|
```
|
@@ -71,23 +70,6 @@ For example:
|
|
71
70
|
```
|
72
71
|
You can also use the underlying checker object by creating an instance of `RakeNBake::DependencyChecker` with your array of dependencies and calling `#check` or `#missing` on it.
|
73
72
|
|
74
|
-
### :code_quality
|
75
|
-
#### :all
|
76
|
-
Runs `[:trailing_spaces, :shoulds, :debugger, :pry, :console_log]` tasks. It does not run `:time_check`
|
77
|
-
##### :trailing_spaces
|
78
|
-
Check for trailing spaces in `[spec, features, lib, app, factories, db]`.
|
79
|
-
##### :shoulds
|
80
|
-
Check for legacy 'it "should blah"' style specs
|
81
|
-
##### :debugger
|
82
|
-
Check for debugger statements in `[lib, app, spec, features]`.
|
83
|
-
##### :pry
|
84
|
-
Check for binding.pry statements in `[lib, app, spec, features]`.
|
85
|
-
##### :console_log
|
86
|
-
Check for console.log statements in `app/assets/javascripys`.
|
87
|
-
##### :time_check
|
88
|
-
Check for `Time.now` statements in `[lib, app]` (Time.zone.now is more reliable for servers wanting to use UTC).
|
89
|
-
This check is NOT part of :all as `Time.zone.now` is an ActiveSupport method.
|
90
|
-
|
91
73
|
### :coverage
|
92
74
|
#### :check_specs
|
93
75
|
Look at SimpleCov results for spec coverage in `log/coverage/spec` and fail the build if not 100%
|
data/Rakefile
CHANGED
data/history.rdoc
CHANGED
data/lib/version.rb
CHANGED
data/tasks/code_quality.rake
CHANGED
@@ -1,85 +1,38 @@
|
|
1
1
|
namespace :bake do
|
2
2
|
namespace :code_quality do
|
3
|
-
desc 'Runs all code quality checks'
|
4
|
-
task :all
|
3
|
+
desc 'Deprecated - Runs all code quality checks'
|
4
|
+
task :all do
|
5
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
6
|
+
end
|
5
7
|
|
6
|
-
desc 'check for trailing spaces'
|
8
|
+
desc 'Deprecated - check for trailing spaces'
|
7
9
|
task :trailing_spaces do
|
8
|
-
|
10
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
9
11
|
end
|
10
12
|
|
11
|
-
desc %(check for legacy 'it "should blah"' style specs)
|
13
|
+
desc %(Deprecated - check for legacy 'it "should blah"' style specs)
|
12
14
|
task :shoulds do
|
13
|
-
|
15
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
14
16
|
end
|
15
17
|
|
16
|
-
desc 'check for debugger statements'
|
18
|
+
desc 'Deprecated - check for debugger statements'
|
17
19
|
task :debugger do
|
18
|
-
|
20
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
19
21
|
end
|
20
22
|
|
21
|
-
desc 'check for binding.pry statements'
|
23
|
+
desc 'Deprecated - check for binding.pry statements'
|
22
24
|
task :pry do
|
23
|
-
|
25
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
24
26
|
end
|
25
27
|
|
26
|
-
desc 'check for console.log'
|
28
|
+
desc 'Deprecated - check for console.log'
|
27
29
|
task :console_log do
|
28
|
-
|
30
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
29
31
|
end
|
30
32
|
|
31
|
-
desc 'check for Time.now; should use Time.now.utc or Time.current'
|
33
|
+
desc 'Deprecated - check for Time.now; should use Time.now.utc or Time.current'
|
32
34
|
task :time_check do
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
def grep_for_trailing_space *file_patterns
|
37
|
-
grep '^.*[[:space:]]+$', file_patterns, 'trailing spaces', ['*.yml', '*.csv']
|
38
|
-
end
|
39
|
-
|
40
|
-
def grep_for_shoulds *file_patterns
|
41
|
-
grep '^[[:space:]]*it "should.*$',
|
42
|
-
file_patterns,
|
43
|
-
'it block description starting with should'
|
44
|
-
end
|
45
|
-
|
46
|
-
def grep_for_pry *file_patterns
|
47
|
-
grep 'binding.pry',
|
48
|
-
file_patterns,
|
49
|
-
'binding.pry statement found',
|
50
|
-
%w[common_spec_helper.rb code_quality.rake]
|
51
|
-
end
|
52
|
-
|
53
|
-
def grep_for_debugger *file_patterns
|
54
|
-
grep 'debugger',
|
55
|
-
file_patterns,
|
56
|
-
'debugger statement found',
|
57
|
-
%w[common_spec_helper.rb code_quality.rake angular.js]
|
58
|
-
end
|
59
|
-
|
60
|
-
def grep_for_console_log *file_patterns
|
61
|
-
grep 'console.log',
|
62
|
-
file_patterns,
|
63
|
-
'console.log statement found',
|
64
|
-
%w[angular.js jquery.flot-0.8.1.js]
|
65
|
-
end
|
66
|
-
|
67
|
-
def grep_for_time_now *file_patterns
|
68
|
-
grep "Time.now",
|
69
|
-
file_patterns,
|
70
|
-
"Time.now found, use Time.zone.now to prevent timezone conflicts",
|
71
|
-
%w{*.rake}
|
72
|
-
end
|
73
|
-
|
74
|
-
def grep regex, file_patterns, error_message, exclude_patterns=[], perl_regex=false
|
75
|
-
files_found = ""
|
76
|
-
command = "grep -r -n -s --binary-files=without-match '#{regex}' #{file_patterns.join(' ')}"
|
77
|
-
exclude_patterns.each do |exclude_pattern|
|
78
|
-
command << " --exclude '#{exclude_pattern}'"
|
79
|
-
end
|
80
|
-
command << (perl_regex ? ' -P' : ' -E')
|
81
|
-
files_found << `#{command}`
|
82
|
-
abort("#{error_message} found:\n#{files_found}") unless files_found.empty?
|
35
|
+
RakeNBake::Baker.log_warn "This has been deprecated, use the rubocop task instead"
|
83
36
|
end
|
84
37
|
end
|
85
38
|
end
|
data/tasks/rubocop.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-n-bake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Vickerstaff
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.4.
|
128
|
+
rubygems_version: 2.4.8
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Common rake tasks, baked to perfection and ready to serve!
|