preek 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Guardfile +2 -2
- data/lib/preek/ext/smell_warning.rb +3 -3
- data/lib/preek/version.rb +1 -1
- data/preek.gemspec +1 -1
- data/spec/cli_spec.rb +11 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b64b0dc9727407560c0f4299922a3babc94ba77
|
4
|
+
data.tar.gz: 0e6a17def70678dba079d7686fe85da2011072e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e34fec2c37c6e545d076267961dd9a3656c8a71d0033cda693cf7c4362186ac03851744f50349ee902aeb754045083d17d73b6aa3754b4380c9d0a9fee7e31d
|
7
|
+
data.tar.gz: 08a470789a8e1c6809d525e597f25350f1e8e61e0953c07f1df31686fade7be2653123350dec2596fd2b380c4ce221da8b57c7d042127bcaef5340c9057bed9d
|
data/.gitignore
CHANGED
data/Guardfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
3
3
|
|
4
4
|
guard 'rspec' do
|
5
|
-
watch(%r{^spec/.+_spec\.rb$})
|
6
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/
|
5
|
+
watch(%r{^spec/.+_spec\.rb$}) { |m| m[0] }
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/cli_spec.rb" }
|
7
7
|
watch('spec/spec_helper.rb') { "spec" }
|
8
8
|
end
|
@@ -2,15 +2,15 @@ module Reek
|
|
2
2
|
# Is was easier this way
|
3
3
|
class SmellWarning
|
4
4
|
def klass
|
5
|
-
|
5
|
+
context[/^([\w:]*)(#\w*)?/, 1]
|
6
6
|
end
|
7
7
|
|
8
8
|
def smell_method
|
9
|
-
|
9
|
+
context[/^([\w:]*)(#\w*)?/, 2]
|
10
10
|
end
|
11
11
|
|
12
12
|
def smell_string
|
13
|
-
"#{smell_method} #{
|
13
|
+
"#{smell_method} #{message} (#{subclass}) at lines #{Array(lines)*','}"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/preek/version.rb
CHANGED
data/preek.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
gem.version = Preek::VERSION
|
19
19
|
gem.add_runtime_dependency "thor", "~> 0.18"
|
20
|
-
gem.add_runtime_dependency "reek", "~> 1.
|
20
|
+
gem.add_runtime_dependency "reek", "~> 1.5.1"
|
21
21
|
gem.add_development_dependency "rspec", "~> 2.14.1"
|
22
22
|
gem.add_development_dependency "rspec-given"
|
23
23
|
gem.add_development_dependency "guard", "~> 2.3.0"
|
data/spec/cli_spec.rb
CHANGED
@@ -9,6 +9,7 @@ describe Preek::CLI do
|
|
9
9
|
File.expand_path(File.join(File.dirname(__FILE__),'test_files/',"#{file_name}.rb"))
|
10
10
|
end
|
11
11
|
|
12
|
+
|
12
13
|
describe 'Commands' do
|
13
14
|
|
14
15
|
context 'errors' do
|
@@ -165,6 +166,16 @@ describe Preek::CLI do
|
|
165
166
|
Then{expect(output).to include(args[1], args[0])}
|
166
167
|
end
|
167
168
|
end
|
169
|
+
|
170
|
+
# Also tests proper output fully
|
171
|
+
context "with --compact option" do
|
172
|
+
Given(:args){ [test_file('too_many_statements')] }
|
173
|
+
Given(:dir){File.dirname(__FILE__)}
|
174
|
+
Given(:expected_output){"\n-\n\nfile: #{dir}/test_files/too_many_statements.rb\nclass: TooManyStatments\nsmells: \n#loong_method has approx 7 statements (TooManyStatements) at lines 4\n\n-\n\ntotal: 1\n\n-\n\n"}
|
175
|
+
When(:output) { capture(:stdout) { Preek::CLI.start ['-c'].concat(args) } }
|
176
|
+
Then{expect(output).to eq expected_output}
|
177
|
+
end
|
178
|
+
|
168
179
|
end
|
169
180
|
|
170
181
|
describe 'Git' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: preek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Neverland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.5.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.5.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,3 +179,4 @@ test_files:
|
|
179
179
|
- spec/test_files/non_smelly.rb
|
180
180
|
- spec/test_files/too_many_statements.rb
|
181
181
|
- spec/test_files/two_smelly_classes.rb
|
182
|
+
has_rdoc:
|