Skip to content
Browse files

adding reek rake task

  • Loading branch information...
1 parent f69abc6 commit bc5949fed32f538705a93dba4718d6bca5efc074 @mockdeep mockdeep committed Aug 21, 2012
Showing with 27 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +14 −0 Gemfile.lock
  3. +12 −0 lib/tasks/reek.rake
View
1 Gemfile
@@ -41,4 +41,5 @@ group :development do
gem 'guard-spork'
gem 'cucumber-rails', '0.3.2'
gem 'guard-cucumber'
+ gem 'reek'
end
View
14 Gemfile.lock
@@ -117,9 +117,16 @@ GEM
recurly (0.3.3)
activeresource (>= 2.3)
activesupport (>= 2.3)
+ reek (1.2.12)
+ ripper_ruby_parser (~> 0.0.7)
+ ruby2ruby (~> 1.2.5)
+ ruby_parser (~> 2.0)
+ sexp_processor (~> 3.0)
reportable (1.1.2)
activerecord (>= 2.0.0)
activesupport (>= 2.0.0)
+ ripper_ruby_parser (0.0.8)
+ sexp_processor (~> 3.0)
rmagick (2.13.1)
rpx_now (0.6.24)
json_pure
@@ -132,13 +139,19 @@ GEM
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
+ ruby2ruby (1.2.5)
+ ruby_parser (~> 2.0)
+ sexp_processor (~> 3.0)
+ ruby_parser (2.3.1)
+ sexp_processor (~> 3.0)
rubytree (0.7.0)
rubyzip (0.9.9)
selenium-webdriver (2.24.0)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
+ sexp_processor (3.2.0)
shoulda (3.0.1)
shoulda-context (~> 1.0.0)
shoulda-matchers (~> 1.0.0)
@@ -187,6 +200,7 @@ DEPENDENCIES
rails (= 2.3.14)
rake (= 0.8.7)
recurly (= 0.3.3)
+ reek
reportable (= 1.1.2)
rpx_now (= 0.6.24)
rspec (= 1.3.2)
View
12 lib/tasks/reek.rake
@@ -0,0 +1,12 @@
+namespace :reek do
+ task :statements do
+ dirs_to_reek = ['app/models', 'app/controllers', 'app/helpers']
+ files_to_reek = dirs_to_reek.map { |dir| Dir[File.join(dir, "**/*.rb")] }
+ output = `reek #{files_to_reek.join(' ')}`
+ long_methods = output.lines.select { |line| line =~ /TooManyStatements/ }
+ long_methods.sort! do |line_1, line_2|
+ line_1.split[3].to_i <=> line_2.split[3].to_i
+ end
+ puts long_methods
+ end
+end

0 comments on commit bc5949f

Please sign in to comment.
Something went wrong with that request. Please try again.