From 2f468ef239cfc83c15b14b3d6e344e67c3480aab Mon Sep 17 00:00:00 2001 From: Chris Dillon Date: Sat, 30 Mar 2013 13:46:37 -0400 Subject: [PATCH] DOS newlines on Rakefile, unsupported rake/rdoctask fix, other minor typos --- Rakefile | 106 +++++++++++++++++----------------- lib/array_stats.rb | 2 +- test/test_array_stats.rb | 2 +- test/test_float_extensions.rb | 4 +- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Rakefile b/Rakefile index a0bac28..35f5310 100644 --- a/Rakefile +++ b/Rakefile @@ -1,53 +1,53 @@ -require 'rubygems' -require 'rake' - -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "array_stats" - gem.summary = %Q{Easy mean, median, percentile, and sum statistics for Ruby Arrays} - gem.description = %Q{Easy mean, median, percentile, and sum statistics for Ruby Arrays} - gem.email = "gems@benkoski.com" - gem.homepage = "http://github.com/bkoski/array_stats" - gem.authors = ["Ben Koski"] - gem.add_development_dependency "thoughtbot-shoulda", ">= 0" - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" -end - -require 'rake/testtask' -Rake::TestTask.new(:test) do |test| - test.libs << 'lib' << 'test' - test.pattern = 'test/**/test_*.rb' - test.verbose = true -end - -begin - require 'rcov/rcovtask' - Rcov::RcovTask.new do |test| - test.libs << 'test' - test.pattern = 'test/**/test_*.rb' - test.verbose = true - end -rescue LoadError - task :rcov do - abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" - end -end - -task :test => :check_dependencies - -task :default => :test - -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "array_stats #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end +require 'rubygems' +require 'rake' + +begin + require 'jeweler' + Jeweler::Tasks.new do |gem| + gem.name = "array_stats" + gem.summary = %Q{Easy mean, median, percentile, and sum statistics for Ruby Arrays} + gem.description = %Q{Easy mean, median, percentile, and sum statistics for Ruby Arrays} + gem.email = "gems@benkoski.com" + gem.homepage = "http://github.com/bkoski/array_stats" + gem.authors = ["Ben Koski"] + gem.add_development_dependency "thoughtbot-shoulda", ">= 0" + # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings + end + Jeweler::GemcutterTasks.new +rescue LoadError + puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" +end + +require 'rake/testtask' +Rake::TestTask.new(:test) do |test| + test.libs << 'lib' << 'test' + test.pattern = 'test/**/test_*.rb' + test.verbose = true +end + +begin + require 'rcov/rcovtask' + Rcov::RcovTask.new do |test| + test.libs << 'test' + test.pattern = 'test/**/test_*.rb' + test.verbose = true + end +rescue LoadError + task :rcov do + abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" + end +end + +task :test => :check_dependencies + +task :default => :test + +require 'rdoc/task' +Rake::RDocTask.new do |rdoc| + version = File.exist?('VERSION') ? File.read('VERSION') : "" + + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "array_stats #{version}" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/lib/array_stats.rb b/lib/array_stats.rb index 112e98e..e165755 100644 --- a/lib/array_stats.rb +++ b/lib/array_stats.rb @@ -2,7 +2,7 @@ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) module ArrayStats - VERSION = '0.5.0' + VERSION = '0.6.0' end require "#{File.dirname(__FILE__)}/array_stats/float" diff --git a/test/test_array_stats.rb b/test/test_array_stats.rb index 491c328..4d94c0c 100644 --- a/test/test_array_stats.rb +++ b/test/test_array_stats.rb @@ -54,7 +54,7 @@ class TestArrayStats < Test::Unit::TestCase end context "mean" do - should "return the mean for the array " do + should "return the mean for the array" do assert_equal 7, [2,4,6,8,10,12].mean assert_equal 25, [48,29,26,19,3].mean end diff --git a/test/test_float_extensions.rb b/test/test_float_extensions.rb index 73075de..0abde0a 100644 --- a/test/test_float_extensions.rb +++ b/test/test_float_extensions.rb @@ -20,12 +20,12 @@ class TestFloatExtensions < Test::Unit::TestCase assert_in_delta 0.2456, n.fractional_part, 0.00000001 end - should "retrun the decimal parts, even if they are 0" do + should "return the decimal parts, even if they are 0" do n = 12.0 assert_equal 0.0, n.fractional_part end - should "retrun the decimal as a positive number, even if the original float is negative" do + should "return the decimal as a positive number, even if the original float is negative" do n = -12.2399 assert_in_delta 0.2399, n.fractional_part, 0.00000001 end