Skip to content

Commit

Permalink
Start of rake task for counting characters
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcdonough committed May 3, 2011
1 parent f0cc75c commit b3cb76e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ require 'rubygems'
require 'rake'
require 'spec/rake/spectask'

COUNT_WHITESPACE = false

Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
Expand All @@ -13,5 +15,9 @@ task :default => [:spec, :count]
task :count do
open(File.dirname(__FILE__) + "/lib/golf.rb") do |file|
solution = file.read
solution.gsub!(/\w/,"") unless COUNT_WHITESPACE
total_characters = solution.length
puts "----------------------"
puts "Total characters: #{total_characters}"
end
end

0 comments on commit b3cb76e

Please sign in to comment.