Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ server Rake tasks, + code/test ratio (currently 1:2.9)

  • Loading branch information...
commit 169e17e02c98451e52ab6adf487cb0255c61218a 1 parent 42824d7
@floere authored
View
10 server/Rakefile
@@ -8,11 +8,5 @@
# load rakefile
# end
-require_relative 'lib/picky/tasks'
-
-require 'rspec'
-require 'rspec/core/rake_task'
-
-task :default => :spec
-
-RSpec::Core::RakeTask.new :spec
+load File.expand_path '../tasks/specs.rake', __FILE__
+load File.expand_path '../tasks/stats.rake', __FILE__
View
8 server/tasks/specs.rake
@@ -1,10 +1,10 @@
-# Specs.
-#
require 'rspec'
require 'rspec/core/rake_task'
-desc "Run specs"
-RSpec::Core::RakeTask.new :rspec
+task :default => :spec
+
+desc "Run specs."
+RSpec::Core::RakeTask.new :spec
task :simplecov do
ENV['COV'] = 'yes'
View
11 server/tasks/stats.rake
@@ -2,7 +2,9 @@
#
desc "Pedestrian CLOC statistics."
task :stats do
- %w|lib spec test_project test_project_sinatra|.each do |dir|
+ libs = 0.0
+ specs = 0.0
+ %w|lib spec test_project|.each do |dir|
original_dir = dir
dir = "#{dir}/*.rb"
dirs = 5.times.inject([dir]) do |dirs, _|
@@ -12,6 +14,13 @@ task :stats do
amount = line.split(':').last.to_i
total + amount
end
+ if original_dir == 'lib'
+ libs += total
+ else
+ specs += total
+ end
puts "#{original_dir}: #{total}"
end
+ puts
+ puts "Code/Test Ratio: 1:#{(specs/libs).round(1)}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.