polishgeeks-dev-tools 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -3
- data/CHANGELOG.md +13 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +53 -55
- data/config/rubocop_rspec.yml +6 -0
- data/lib/polish_geeks/dev_tools/commands/base.rb +4 -4
- data/lib/polish_geeks/dev_tools/commands/brakeman.rb +1 -1
- data/lib/polish_geeks/dev_tools/commands/empty_methods/file_parser.rb +1 -1
- data/lib/polish_geeks/dev_tools/commands/final_blank_line.rb +3 -1
- data/lib/polish_geeks/dev_tools/commands/rubocop.rb +1 -1
- data/lib/polish_geeks/dev_tools/version.rb +1 -1
- data/lib/polishgeeks-dev-tools.rb +0 -1
- data/polishgeeks_dev_tools.gemspec +0 -1
- data/spec/lib/polish_geeks/dev_tools/commands/allowed_extensions_spec.rb +10 -10
- data/spec/lib/polish_geeks/dev_tools/commands/base_spec.rb +9 -9
- data/spec/lib/polish_geeks/dev_tools/commands/brakeman_spec.rb +15 -21
- data/spec/lib/polish_geeks/dev_tools/commands/bundler_audit_spec.rb +6 -6
- data/spec/lib/polish_geeks/dev_tools/commands/empty_methods/file_parser_spec.rb +18 -18
- data/spec/lib/polish_geeks/dev_tools/commands/empty_methods_spec.rb +29 -35
- data/spec/lib/polish_geeks/dev_tools/commands/examples_comparator_spec.rb +22 -24
- data/spec/lib/polish_geeks/dev_tools/commands/expires_in_spec.rb +9 -11
- data/spec/lib/polish_geeks/dev_tools/commands/final_blank_line_spec.rb +31 -35
- data/spec/lib/polish_geeks/dev_tools/commands/gemfile_spec.rb +17 -17
- data/spec/lib/polish_geeks/dev_tools/commands/haml_lint_spec.rb +7 -15
- data/spec/lib/polish_geeks/dev_tools/commands/required_files_spec.rb +8 -8
- data/spec/lib/polish_geeks/dev_tools/commands/rspec_files_names_spec.rb +19 -15
- data/spec/lib/polish_geeks/dev_tools/commands/rspec_files_structure_spec.rb +40 -44
- data/spec/lib/polish_geeks/dev_tools/commands/rspec_spec.rb +22 -22
- data/spec/lib/polish_geeks/dev_tools/commands/rubocop_spec.rb +21 -29
- data/spec/lib/polish_geeks/dev_tools/commands/rubycritic_spec.rb +2 -4
- data/spec/lib/polish_geeks/dev_tools/commands/simplecov_spec.rb +18 -28
- data/spec/lib/polish_geeks/dev_tools/commands/tasks_files_names_spec.rb +24 -25
- data/spec/lib/polish_geeks/dev_tools/commands/yard_spec.rb +10 -24
- data/spec/lib/polish_geeks/dev_tools/commands/yml_parser_spec.rb +15 -19
- data/spec/lib/polish_geeks/dev_tools/config_manager_spec.rb +33 -33
- data/spec/lib/polish_geeks/dev_tools/config_spec.rb +10 -10
- data/spec/lib/polish_geeks/dev_tools/errors_spec.rb +4 -4
- data/spec/lib/polish_geeks/dev_tools/hash_spec.rb +5 -5
- data/spec/lib/polish_geeks/dev_tools/logger_spec.rb +13 -13
- data/spec/lib/polish_geeks/dev_tools/output_storer_spec.rb +2 -2
- data/spec/lib/polish_geeks/dev_tools/runner_spec.rb +2 -2
- data/spec/lib/polish_geeks/dev_tools/shell_spec.rb +2 -2
- data/spec/lib/polish_geeks/dev_tools/validators/base_spec.rb +7 -7
- data/spec/lib/polish_geeks/dev_tools/validators/rails_spec.rb +3 -3
- data/spec/lib/polish_geeks/dev_tools/validators/rubocop_spec.rb +3 -3
- data/spec/lib/polish_geeks/dev_tools/validators/simplecov_spec.rb +12 -11
- data/spec/lib/polish_geeks/dev_tools/version_spec.rb +1 -3
- data/spec/lib/polish_geeks/dev_tools_spec.rb +7 -13
- metadata +3 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77dfaf8b2a1c6aded4c745df325b75f3837e12c8
|
4
|
+
data.tar.gz: bbfe2c3b28c160a3d25a543f7884166c6c687240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03bdc56af329edef9639d8dc7bc514fe10520afbd6a5dfe7b882c6480fc52abac3df3cc560a05aaf4bd3e75309f179d688c849659405d88f6f841ba0a312c154
|
7
|
+
data.tar.gz: b0b42078437d4b16e123982d0fb7efddd462be091879aa8b8c1a95059ae795deea5e7d86e7088f3971b9377b425e78ed8a71d31c3e8649c0d638a03e4426e77b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.3.
|
1
|
+
ruby-2.3.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 1.4.0 (26/11/2016)
|
6
|
+
|
7
|
+
- bump to ruby 2.3.3
|
8
|
+
- drop support for ruby 2.1.x
|
9
|
+
- haml_lint 0.18.4
|
10
|
+
- yard 0.9.5
|
11
|
+
- rubycritic 3.1.0
|
12
|
+
- brakeman 3.4.1
|
13
|
+
- rubocop 0.45.0
|
14
|
+
- rubocop-rspec 1.8.0
|
15
|
+
- replace pry with byebug
|
16
|
+
- [#63](https://github.com/polishgeeks/polishgeeks-dev-tools/issues/63) ignore vim swap files in FinalBlankLine validator
|
17
|
+
|
5
18
|
## 1.3.2 (27/06/2016)
|
6
19
|
|
7
20
|
- Bump rubycritic dependency to 2.9.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
polishgeeks-dev-tools (1.
|
4
|
+
polishgeeks-dev-tools (1.4.0)
|
5
5
|
brakeman
|
6
6
|
bundler-audit
|
7
7
|
faker
|
8
8
|
haml_lint
|
9
|
-
pry
|
10
9
|
rspec
|
11
10
|
rubocop
|
12
11
|
rubocop-rspec
|
@@ -19,116 +18,114 @@ PATH
|
|
19
18
|
GEM
|
20
19
|
remote: https://rubygems.org/
|
21
20
|
specs:
|
22
|
-
activesupport (
|
21
|
+
activesupport (5.0.0.1)
|
22
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
23
23
|
i18n (~> 0.7)
|
24
|
-
json (~> 1.7, >= 1.7.7)
|
25
24
|
minitest (~> 5.1)
|
26
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
27
25
|
tzinfo (~> 1.1)
|
28
|
-
addressable (2.
|
26
|
+
addressable (2.5.0)
|
27
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
29
28
|
ast (2.3.0)
|
30
29
|
axiom-types (0.1.1)
|
31
30
|
descendants_tracker (~> 0.0.4)
|
32
31
|
ice_nine (~> 0.11.0)
|
33
32
|
thread_safe (~> 0.3, >= 0.3.1)
|
34
|
-
brakeman (3.
|
33
|
+
brakeman (3.4.1)
|
35
34
|
bundler-audit (0.5.0)
|
36
35
|
bundler (~> 1.2)
|
37
36
|
thor (~> 0.18)
|
38
|
-
|
37
|
+
byebug (9.0.6)
|
38
|
+
codeclimate-engine-rb (0.4.0)
|
39
39
|
virtus (~> 1.0)
|
40
|
-
coderay (1.1.1)
|
41
40
|
coercible (1.0.0)
|
42
41
|
descendants_tracker (~> 0.0.1)
|
43
|
-
|
42
|
+
concurrent-ruby (1.0.2)
|
44
43
|
descendants_tracker (0.0.4)
|
45
44
|
thread_safe (~> 0.3, >= 0.3.1)
|
46
45
|
diff-lcs (1.2.5)
|
47
46
|
docile (1.1.5)
|
48
47
|
equalizer (0.0.11)
|
49
48
|
erubis (2.7.0)
|
50
|
-
faker (1.6.
|
49
|
+
faker (1.6.6)
|
51
50
|
i18n (~> 0.5)
|
52
|
-
flay (2.
|
51
|
+
flay (2.8.1)
|
53
52
|
erubis (~> 2.7.0)
|
53
|
+
path_expander (~> 1.0)
|
54
54
|
ruby_parser (~> 3.0)
|
55
55
|
sexp_processor (~> 4.0)
|
56
|
-
flog (4.
|
56
|
+
flog (4.4.0)
|
57
|
+
path_expander (~> 1.0)
|
57
58
|
ruby_parser (~> 3.1, > 3.1.0)
|
58
59
|
sexp_processor (~> 4.4)
|
59
60
|
haml (4.0.7)
|
60
61
|
tilt
|
61
|
-
haml_lint (0.
|
62
|
+
haml_lint (0.18.4)
|
62
63
|
haml (~> 4.0)
|
63
64
|
rake (>= 10, < 12)
|
64
65
|
rubocop (>= 0.36.0)
|
65
66
|
sysexits (~> 1.1)
|
66
67
|
i18n (0.7.0)
|
67
68
|
ice_nine (0.11.2)
|
68
|
-
json (
|
69
|
+
json (2.0.2)
|
69
70
|
launchy (2.4.3)
|
70
71
|
addressable (~> 2.3)
|
71
|
-
|
72
|
-
|
73
|
-
parser (2.3.1.0)
|
72
|
+
minitest (5.9.1)
|
73
|
+
parser (2.3.1.4)
|
74
74
|
ast (~> 2.2)
|
75
|
+
path_expander (1.0.0)
|
75
76
|
powerpack (0.1.1)
|
76
|
-
|
77
|
-
coderay (~> 1.1.0)
|
78
|
-
method_source (~> 0.8.1)
|
79
|
-
slop (~> 3.4)
|
77
|
+
public_suffix (2.0.4)
|
80
78
|
rainbow (2.1.0)
|
81
|
-
rake (11.
|
82
|
-
reek (4.
|
83
|
-
codeclimate-engine-rb (~> 0.
|
84
|
-
parser (~> 2.3, >= 2.3.
|
79
|
+
rake (11.3.0)
|
80
|
+
reek (4.5.2)
|
81
|
+
codeclimate-engine-rb (~> 0.4.0)
|
82
|
+
parser (~> 2.3.1, >= 2.3.1.2)
|
85
83
|
rainbow (~> 2.0)
|
86
|
-
rspec (3.
|
87
|
-
rspec-core (~> 3.
|
88
|
-
rspec-expectations (~> 3.
|
89
|
-
rspec-mocks (~> 3.
|
90
|
-
rspec-core (3.
|
91
|
-
rspec-support (~> 3.
|
92
|
-
rspec-expectations (3.
|
84
|
+
rspec (3.5.0)
|
85
|
+
rspec-core (~> 3.5.0)
|
86
|
+
rspec-expectations (~> 3.5.0)
|
87
|
+
rspec-mocks (~> 3.5.0)
|
88
|
+
rspec-core (3.5.4)
|
89
|
+
rspec-support (~> 3.5.0)
|
90
|
+
rspec-expectations (3.5.0)
|
93
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
94
|
-
rspec-support (~> 3.
|
95
|
-
rspec-mocks (3.
|
92
|
+
rspec-support (~> 3.5.0)
|
93
|
+
rspec-mocks (3.5.0)
|
96
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
97
|
-
rspec-support (~> 3.
|
98
|
-
rspec-support (3.
|
99
|
-
rubocop (0.
|
100
|
-
parser (>= 2.3.1.
|
95
|
+
rspec-support (~> 3.5.0)
|
96
|
+
rspec-support (3.5.0)
|
97
|
+
rubocop (0.45.0)
|
98
|
+
parser (>= 2.3.1.1, < 3.0)
|
101
99
|
powerpack (~> 0.1)
|
102
100
|
rainbow (>= 1.99.1, < 3.0)
|
103
101
|
ruby-progressbar (~> 1.7)
|
104
102
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
105
|
-
rubocop-rspec (1.
|
106
|
-
rubocop (>= 0.
|
103
|
+
rubocop-rspec (1.8.0)
|
104
|
+
rubocop (>= 0.42.0)
|
107
105
|
ruby-progressbar (1.8.1)
|
108
|
-
ruby_parser (3.8.
|
106
|
+
ruby_parser (3.8.3)
|
109
107
|
sexp_processor (~> 4.1)
|
110
|
-
rubycritic (
|
111
|
-
|
112
|
-
|
113
|
-
flog (= 4.3.2)
|
108
|
+
rubycritic (3.1.0)
|
109
|
+
flay (~> 2.8)
|
110
|
+
flog (~> 4.4)
|
114
111
|
launchy (= 2.4.3)
|
115
|
-
parser (= 2.3.1.
|
116
|
-
|
112
|
+
parser (= 2.3.1.4)
|
113
|
+
rainbow
|
114
|
+
reek (~> 4.4)
|
117
115
|
ruby_parser (~> 3.8)
|
118
116
|
virtus (~> 1.0)
|
119
117
|
sexp_processor (4.7.0)
|
120
118
|
shoulda (3.5.0)
|
121
119
|
shoulda-context (~> 1.0, >= 1.0.1)
|
122
120
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
123
|
-
shoulda-context (1.2.
|
121
|
+
shoulda-context (1.2.2)
|
124
122
|
shoulda-matchers (2.8.0)
|
125
123
|
activesupport (>= 3.0.0)
|
126
|
-
simplecov (0.
|
124
|
+
simplecov (0.12.0)
|
127
125
|
docile (~> 1.1.0)
|
128
|
-
json (
|
126
|
+
json (>= 1.8, < 3)
|
129
127
|
simplecov-html (~> 0.10.0)
|
130
128
|
simplecov-html (0.10.0)
|
131
|
-
slop (3.6.0)
|
132
129
|
sysexits (1.2.0)
|
133
130
|
thor (0.19.1)
|
134
131
|
thread_safe (0.3.5)
|
@@ -136,21 +133,22 @@ GEM
|
|
136
133
|
timecop (0.8.1)
|
137
134
|
tzinfo (1.2.2)
|
138
135
|
thread_safe (~> 0.1)
|
139
|
-
unicode-display_width (1.1.
|
136
|
+
unicode-display_width (1.1.1)
|
140
137
|
virtus (1.0.5)
|
141
138
|
axiom-types (~> 0.1)
|
142
139
|
coercible (~> 1.0)
|
143
140
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
144
141
|
equalizer (~> 0.0, >= 0.0.9)
|
145
|
-
yard (0.
|
142
|
+
yard (0.9.5)
|
146
143
|
|
147
144
|
PLATFORMS
|
148
145
|
ruby
|
149
146
|
|
150
147
|
DEPENDENCIES
|
151
148
|
bundler
|
149
|
+
byebug
|
152
150
|
polishgeeks-dev-tools!
|
153
151
|
rake
|
154
152
|
|
155
153
|
BUNDLED WITH
|
156
|
-
1.
|
154
|
+
1.13.6
|
data/config/rubocop_rspec.yml
CHANGED
@@ -14,7 +14,7 @@ module PolishGeeks
|
|
14
14
|
# Available command types. We have validators that check something
|
15
15
|
# and that should have a 'valid?' method and that check for errors, etc
|
16
16
|
# and generators that are executed to generate some stats, docs, etc
|
17
|
-
TYPES = %i(
|
17
|
+
TYPES = %i(validator generator).freeze
|
18
18
|
|
19
19
|
class << self
|
20
20
|
# ConfigManager instance can be provided, which allows us to find a
|
@@ -23,10 +23,10 @@ module PolishGeeks
|
|
23
23
|
attr_accessor :type
|
24
24
|
attr_accessor :validators
|
25
25
|
|
26
|
-
TYPES.each do |
|
26
|
+
TYPES.each do |command_type|
|
27
27
|
# @return [Boolean] if it is a given type command
|
28
|
-
define_method :"#{
|
29
|
-
|
28
|
+
define_method :"#{command_type}?" do
|
29
|
+
type == command_type
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -55,7 +55,7 @@ module PolishGeeks
|
|
55
55
|
# @param [Array<String>] method_body
|
56
56
|
# @return [Boolean] whether method is empty or not
|
57
57
|
def method_is_empty?(method_body)
|
58
|
-
!method_body.inject(false) { |
|
58
|
+
!method_body.inject(false) { |acc, elem| acc || elem.not_commented_or_empty? }
|
59
59
|
end
|
60
60
|
|
61
61
|
# Adds line number of empty method to empty_methods.
|
@@ -19,6 +19,8 @@ module PolishGeeks
|
|
19
19
|
app/assets/fonts
|
20
20
|
.DS_Store
|
21
21
|
.gem
|
22
|
+
.swp
|
23
|
+
.swo
|
22
24
|
).freeze
|
23
25
|
|
24
26
|
# Executes this command and set output and counter variables
|
@@ -94,7 +96,7 @@ module PolishGeeks
|
|
94
96
|
# @return [Boolean] true if file is empty or has final blank line.
|
95
97
|
# Otherwise return false.
|
96
98
|
def file_valid?(file)
|
97
|
-
File.size(file)
|
99
|
+
File.size(file).zero? || IO.readlines(file).last[-1] == "\n"
|
98
100
|
end
|
99
101
|
end
|
100
102
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe PolishGeeks::DevTools::Commands::AllowedExtensions do
|
4
|
-
subject { described_class.new }
|
4
|
+
subject(:allowed_extensions) { described_class.new }
|
5
5
|
|
6
6
|
describe '#execute' do
|
7
7
|
let(:file_name) { 'file.rb' }
|
@@ -9,22 +9,22 @@ RSpec.describe PolishGeeks::DevTools::Commands::AllowedExtensions do
|
|
9
9
|
|
10
10
|
before do
|
11
11
|
expect(Dir).to receive(:[]) { files }
|
12
|
-
|
12
|
+
allowed_extensions.execute
|
13
13
|
end
|
14
14
|
|
15
15
|
context 'when we dont have invalid files' do
|
16
|
-
it { expect(
|
16
|
+
it { expect(allowed_extensions.output).to eq [] }
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'when we have invalid files' do
|
20
20
|
let(:file_name) { 'file.py' }
|
21
|
-
it { expect(
|
21
|
+
it { expect(allowed_extensions.output).to eq [file_name] }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#label' do
|
26
26
|
let(:expected) { 'Allowed Extensions' }
|
27
|
-
it { expect(
|
27
|
+
it { expect(allowed_extensions.label).to eq expected }
|
28
28
|
end
|
29
29
|
|
30
30
|
describe '#error_message' do
|
@@ -34,21 +34,21 @@ RSpec.describe PolishGeeks::DevTools::Commands::AllowedExtensions do
|
|
34
34
|
"\n\n#{output.join("\n")}\n"
|
35
35
|
end
|
36
36
|
|
37
|
-
before {
|
38
|
-
it { expect(
|
37
|
+
before { allowed_extensions.instance_variable_set('@output', output) }
|
38
|
+
it { expect(allowed_extensions.error_message).to eq expected }
|
39
39
|
end
|
40
40
|
|
41
41
|
describe do
|
42
|
-
before {
|
42
|
+
before { allowed_extensions.instance_variable_set('@output', output) }
|
43
43
|
|
44
44
|
context 'when output is empty' do
|
45
45
|
let(:output) { '' }
|
46
|
-
it { expect(
|
46
|
+
it { expect(allowed_extensions.valid?).to eq true }
|
47
47
|
end
|
48
48
|
|
49
49
|
context 'when output is empty' do
|
50
50
|
let(:output) { rand.to_s }
|
51
|
-
it { expect(
|
51
|
+
it { expect(allowed_extensions.valid?).to eq false }
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -1,27 +1,27 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe PolishGeeks::DevTools::Commands::Base do
|
4
|
-
subject { described_class.new }
|
4
|
+
subject(:base) { described_class.new }
|
5
5
|
|
6
6
|
describe '#execute' do
|
7
7
|
let(:error) { PolishGeeks::DevTools::Errors::NotImplementedError }
|
8
|
-
it { expect {
|
8
|
+
it { expect { base.execute }. to raise_error(error) }
|
9
9
|
end
|
10
10
|
|
11
11
|
describe '#valid?' do
|
12
12
|
let(:error) { PolishGeeks::DevTools::Errors::NotImplementedError }
|
13
|
-
it { expect {
|
13
|
+
it { expect { base.valid? }. to raise_error(error) }
|
14
14
|
end
|
15
15
|
|
16
16
|
describe '#error_message' do
|
17
17
|
let(:output) { rand.to_s }
|
18
18
|
|
19
19
|
before do
|
20
|
-
|
20
|
+
base.instance_variable_set('@output', output)
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'by default should equal raw output' do
|
24
|
-
expect(
|
24
|
+
expect(base.error_message).to eq output
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -36,12 +36,12 @@ RSpec.describe PolishGeeks::DevTools::Commands::Base do
|
|
36
36
|
expect(instance).to receive(:validate!) { true }
|
37
37
|
end
|
38
38
|
|
39
|
-
it { expect {
|
39
|
+
it { expect { base.ensure_executable! }.not_to raise_error }
|
40
40
|
end
|
41
41
|
|
42
42
|
context 'when we dont require any validators' do
|
43
43
|
before { expect(described_class).to receive(:validators) { [] } }
|
44
|
-
it { expect {
|
44
|
+
it { expect { base.ensure_executable! }.not_to raise_error }
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -73,7 +73,7 @@ RSpec.describe PolishGeeks::DevTools::Commands::Base do
|
|
73
73
|
.with(dir_in_path)
|
74
74
|
.and_return(false)
|
75
75
|
end
|
76
|
-
it { expect(
|
76
|
+
it { expect(base.send(:files_from_path, path)).to eq [file_in_path] }
|
77
77
|
end
|
78
78
|
|
79
79
|
context 'path is a file' do
|
@@ -84,7 +84,7 @@ RSpec.describe PolishGeeks::DevTools::Commands::Base do
|
|
84
84
|
.with("#{app_root}/#{path}")
|
85
85
|
.and_return(true)
|
86
86
|
end
|
87
|
-
it { expect(
|
87
|
+
it { expect(base.send(:files_from_path, path)).to eq ["#{app_root}/#{path}"] }
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|