preek 1.5.1 → 1.6.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
2
  SHA1:
3
- metadata.gz: 3de170e7e48fb838dc8486e5e454193df7ada8a5
4
- data.tar.gz: f03da30344efc94f3348a0832c8c3cb436c806c3
3
+ metadata.gz: 7b64b0dc9727407560c0f4299922a3babc94ba77
4
+ data.tar.gz: 0e6a17def70678dba079d7686fe85da2011072e7
5
5
  SHA512:
6
- metadata.gz: 13658f79c1f9748410bde706afa47a2ae53a09abe776a1cf8129f9a117e6c2e374aabbca76a489ba2d26457fd6ff65d4dd26480ca81f21cc021cf59430cb0377
7
- data.tar.gz: 452cda3f91a5d0e2c3ee7e2d3c1eb1fbdcaa513c46273c2d9e1845870385f6c89be9ee1643b38ac7cdab229e3292642887f33cde1fc44c9fd672291c93457dc3
6
+ metadata.gz: 1e34fec2c37c6e545d076267961dd9a3656c8a71d0033cda693cf7c4362186ac03851744f50349ee902aeb754045083d17d73b6aa3754b4380c9d0a9fee7e31d
7
+ data.tar.gz: 08a470789a8e1c6809d525e597f25350f1e8e61e0953c07f1df31686fade7be2653123350dec2596fd2b380c4ce221da8b57c7d042127bcaef5340c9057bed9d
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rbx
19
+ .tags*
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/lib/#{m[1]}_spec.rb" }
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
- @location[CONTEXT_KEY][/^([\w:]*)(#\w*)?/, 1]
5
+ context[/^([\w:]*)(#\w*)?/, 1]
6
6
  end
7
7
 
8
8
  def smell_method
9
- @location[CONTEXT_KEY][/^([\w:]*)(#\w*)?/, 2]
9
+ context[/^([\w:]*)(#\w*)?/, 2]
10
10
  end
11
11
 
12
12
  def smell_string
13
- "#{smell_method} #{@smell['message']} (#{@smell['subclass']}) at lines #{Array(@location['lines'])*','}"
13
+ "#{smell_method} #{message} (#{subclass}) at lines #{Array(lines)*','}"
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Preek
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -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.3.3"
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"
@@ -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.5.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-09-04 00:00:00.000000000 Z
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.3.3
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.3.3
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: