preek 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjczMTRhYmZjYTA0ODE2M2Y3NjFhNWFlMzRhNDQ1N2E1OTRkZWI1Mw==
5
- data.tar.gz: !binary |-
6
- YjFmYmZhMGU3NDA5N2M1ZjdlNWVmYmI1ZDU1YzI4YmE0YTQxYWM2Yg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NzZmN2JiOTg0ODI2N2Q0MzM0MzM4MTg2Y2Q2Y2IwNjViZWY1NzJhMDM2MjVj
10
- ODA4MzYzYzJiMDE1MjI0MzU2YzVlMjdiZDBhNGZmNTRjYzUyNzI5YTE4NWI0
11
- ODY4OTczMTNiZTJmOTUzYjc5NGRiZWQ3Njg0OThiNTkzYTgzMWM=
12
- data.tar.gz: !binary |-
13
- NTVjODc4NDAwYjM2Yjc5M2IyM2QwNTliOTAyMzJjNzZmMmFmMDMwZGIxODhi
14
- OGE5MGU4MTliZGI2ZDVjMmU3YzUxOWY3NmVmYTRmNGViYTczYmNkOThmMWI3
15
- ZWMyN2Q1YWE1MTI0Y2ExMDMxNTAwMDhjNTY3YTk4NzQ0ZTBlOWU=
2
+ SHA1:
3
+ metadata.gz: a8559dbf44087b95a487aa6cd703eab355856553
4
+ data.tar.gz: 20d5406a15c573adfaa73cb51d9cdfdf082334e6
5
+ SHA512:
6
+ metadata.gz: fb9f6342f78100d39b6f944d0c97066a3ec204acc2279010443b318bfa0c852d79a529a2174f00082cec13d5fa5d83c730e9f8041e6e9e023c43f175614b3b3e
7
+ data.tar.gz: a568c93c4d40d2fc03043dbc65b6e11190a8d9cf33909d8c39d27589d8b198a20224236c7139f4b9b0d666d0c25917840fd8db7277f85b32056e30f488e7fa3a
data/.travis.yml CHANGED
@@ -5,4 +5,5 @@ rvm:
5
5
  - 2.0.0
6
6
  branches:
7
7
  only:
8
- - master
8
+ - master
9
+ script: rspec spec
data/Guardfile CHANGED
@@ -6,4 +6,3 @@ guard 'rspec' do
6
6
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
7
  watch('spec/spec_helper.rb') { "spec" }
8
8
  end
9
-
data/README.md CHANGED
@@ -1,23 +1,39 @@
1
1
  [![Code Climate](https://codeclimate.com/github/joenas/preek.png)](https://codeclimate.com/github/joenas/preek)
2
+ [![Build Status](https://travis-ci.org/joenas/preek.png)](https://travis-ci.org/joenas/preek)
3
+ [![Dependency Status](https://gemnasium.com/joenas/preek.png)](https://gemnasium.com/joenas/preek)
4
+ [![Coverage Status](https://coveralls.io/repos/joenas/preek/badge.png?branch=master)](https://coveralls.io/r/joenas/preek?branch=master)
5
+
2
6
 
3
7
  # Preek
4
8
 
5
9
  For a pretty colorful output of [Reek](https://github.com/troessner/reek), which is an awesome gem!
10
+ This is just something I came up with while learning [Thor](https://github.com/wycats/thor).
11
+ As an exercise I also worked on getting Reek and Pelusa to stop whining when running them on the code.
6
12
 
7
13
  ## Installation
8
14
 
9
15
  Install it yourself as:
10
16
 
11
17
  $ git clone git@github.com:joenas/preek.git
12
-
18
+
13
19
  $ cd preek
14
20
 
15
21
  $ rake install
16
22
 
23
+ or
24
+
25
+ $ gem install preek
26
+
27
+
17
28
  ## Usage
18
29
 
19
30
  $ preek . or file
20
31
 
32
+ At the moment it only supports files, not stuff like this:
33
+
34
+ $ echo "def x() true end" | reek
35
+
36
+
21
37
  ## Contributing
22
38
 
23
39
  1. Fork it
@@ -34,7 +34,6 @@ module Preek
34
34
  say "\n\t#{'-'*60}\n\n"
35
35
  end
36
36
 
37
-
38
37
  def padding; 0; end
39
38
 
40
39
  def format_path file
@@ -10,7 +10,7 @@ module Reek
10
10
  end
11
11
 
12
12
  def smell_string
13
- "#{smell_method} #{@smell['message']} (#{@smell['subclass']}) at lines #{@location['lines']*','}"
13
+ "#{smell_method} #{@smell['message']} (#{@smell['subclass']}) at lines #{Array(@location['lines'])*','}"
14
14
  end
15
15
  end
16
16
  end
data/lib/preek/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Preek
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/preek.gemspec CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../lib/preek/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Jon Neverland"]
6
6
  gem.email = ["jonwestin@gmail.com"]
7
- gem.description = %q{Gives the nice output to the reek}
7
+ gem.description = %q{Gives a nice, colorful output to Reek. Based on Thor.}
8
8
  gem.summary = %q{It might reek but its pretty}
9
9
  gem.homepage = "https://github.com/joenas/preek"
10
10
 
@@ -15,12 +15,11 @@ Gem::Specification.new do |gem|
15
15
  gem.name = "preek"
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = Preek::VERSION
18
- gem.add_runtime_dependency "thor"
19
- gem.add_runtime_dependency "reek"
20
- gem.add_runtime_dependency "rake"
21
- gem.add_development_dependency "rake"
22
- gem.add_development_dependency "rspec"
23
- gem.add_development_dependency "guard"
24
- gem.add_development_dependency "guard-rspec"
25
- gem.add_development_dependency "simplecov"
18
+ gem.add_runtime_dependency "thor", ">=0.16"
19
+ gem.add_runtime_dependency "reek", ">=1.3"
20
+ gem.add_development_dependency "rspec", ">=2.13"
21
+ gem.add_development_dependency "guard", ">=1.6"
22
+ gem.add_development_dependency "guard-pushover"
23
+ gem.add_development_dependency "guard-rspec", ">=2.4"
24
+ gem.add_development_dependency 'coveralls'
26
25
  end
data/spec/preek_spec.rb CHANGED
@@ -74,5 +74,15 @@ describe Preek::Preek do
74
74
  output.should include("#loong_method", "#x")
75
75
  end
76
76
  end
77
+
78
+ context "when given file has NilCheck smell" do
79
+ let(:args){ [test_file('nil_check')] }
80
+ it "output contains 'NilCheck'" do
81
+ output.should include("NilCheck")
82
+ end
83
+ it "outputs the name of the file" do
84
+ output.should include(args[0])
85
+ end
86
+ end
77
87
  end
78
88
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'simplecov'
2
- SimpleCov.start
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
3
 
4
4
  $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
5
5
  require 'stringio'
@@ -0,0 +1,12 @@
1
+ #This class a nil check
2
+ class NilCheck
3
+ def initialize(number)
4
+ @number = number
5
+ end
6
+
7
+ def nil_check
8
+ @number.times do |number|
9
+ next if number.nil?
10
+ end
11
+ end
12
+ end
metadata CHANGED
@@ -1,128 +1,114 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Neverland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-02-28 00:00:00.000000000 Z
11
+ date: 2013-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.16'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '0.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: reek
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.3'
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: '0'
40
+ version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
42
+ name: rspec
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - ! '>='
45
+ - - '>='
60
46
  - !ruby/object:Gem::Version
61
- version: '0'
47
+ version: '2.13'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - ! '>='
52
+ - - '>='
67
53
  - !ruby/object:Gem::Version
68
- version: '0'
54
+ version: '2.13'
69
55
  - !ruby/object:Gem::Dependency
70
- name: rspec
56
+ name: guard
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - ! '>='
59
+ - - '>='
74
60
  - !ruby/object:Gem::Version
75
- version: '0'
61
+ version: '1.6'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - ! '>='
66
+ - - '>='
81
67
  - !ruby/object:Gem::Version
82
- version: '0'
68
+ version: '1.6'
83
69
  - !ruby/object:Gem::Dependency
84
- name: guard
70
+ name: guard-pushover
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - ! '>='
73
+ - - '>='
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - ! '>='
80
+ - - '>='
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: guard-rspec
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - ! '>='
87
+ - - '>='
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: '2.4'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ! '>='
94
+ - - '>='
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: '2.4'
111
97
  - !ruby/object:Gem::Dependency
112
- name: simplecov
98
+ name: coveralls
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - ! '>='
108
+ - - '>='
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
- description: Gives the nice output to the reek
111
+ description: Gives a nice, colorful output to Reek. Based on Thor.
126
112
  email:
127
113
  - jonwestin@gmail.com
128
114
  executables:
@@ -140,7 +126,6 @@ files:
140
126
  - Rakefile
141
127
  - bin/preek
142
128
  - lib/preek.rb
143
- - lib/preek/cli.rb
144
129
  - lib/preek/klass_collector.rb
145
130
  - lib/preek/smell_collector.rb
146
131
  - lib/preek/smell_file.rb
@@ -153,6 +138,7 @@ files:
153
138
  - spec/spec_helper.rb
154
139
  - spec/test_files/irresponsible.rb
155
140
  - spec/test_files/irresponsible_and_lazy.rb
141
+ - spec/test_files/nil_check.rb
156
142
  - spec/test_files/non_smelly.rb
157
143
  - spec/test_files/too_many_statements.rb
158
144
  - spec/test_files/two_smelly_classes.rb
@@ -165,17 +151,17 @@ require_paths:
165
151
  - lib
166
152
  required_ruby_version: !ruby/object:Gem::Requirement
167
153
  requirements:
168
- - - ! '>='
154
+ - - '>='
169
155
  - !ruby/object:Gem::Version
170
156
  version: '0'
171
157
  required_rubygems_version: !ruby/object:Gem::Requirement
172
158
  requirements:
173
- - - ! '>='
159
+ - - '>='
174
160
  - !ruby/object:Gem::Version
175
161
  version: '0'
176
162
  requirements: []
177
163
  rubyforge_project:
178
- rubygems_version: 2.0.0
164
+ rubygems_version: 2.0.3
179
165
  signing_key:
180
166
  specification_version: 4
181
167
  summary: It might reek but its pretty
@@ -184,6 +170,7 @@ test_files:
184
170
  - spec/spec_helper.rb
185
171
  - spec/test_files/irresponsible.rb
186
172
  - spec/test_files/irresponsible_and_lazy.rb
173
+ - spec/test_files/nil_check.rb
187
174
  - spec/test_files/non_smelly.rb
188
175
  - spec/test_files/too_many_statements.rb
189
176
  - spec/test_files/two_smelly_classes.rb
data/lib/preek/cli.rb DELETED
@@ -1,24 +0,0 @@
1
- require 'preek'
2
- module Preek
3
- class Cli
4
- def initialize(args)
5
- @args = args
6
- end
7
-
8
- def execute
9
- Preek.start []
10
- end
11
- end
12
- end
13
-
14
-
15
- # unless ARGV.empty?
16
- # preek = Preek::Preek.new
17
- # if preek.respond_to? ARGV[0]
18
- # preek.send ARGV.shift.to_sym, ARGV
19
- # else
20
- # preek.parse ARGV
21
- # end
22
- # else
23
- # Preek::Preek.start
24
- # end