diff --git a/.travis.yml b/.travis.yml index 962e1d0..6d673c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: ruby rvm: + - 2.6.3 - 2.3.0 - 2.2.0 - 2.1.0 diff --git a/Gemfile.lock b/Gemfile.lock index cfa5ba9..83775e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,28 +1,29 @@ GEM remote: https://rubygems.org/ specs: - diff-lcs (1.2.5) - docile (1.1.5) - minitest (5.8.4) - multi_json (1.10.1) - rake (10.4.2) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) + diff-lcs (1.3) + docile (1.3.1) + json (2.2.0) + minitest (5.11.3) + rake (12.3.2) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-support (3.1.2) - simplecov (0.9.1) - docile (~> 1.1.0) - multi_json (~> 1.0) - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) PLATFORMS ruby @@ -32,3 +33,6 @@ DEPENDENCIES rake rspec simplecov + +BUNDLED WITH + 2.0.1 diff --git a/Rakefile b/Rakefile index 7f30bf5..a656605 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'bundler/setup' require 'bundler/gem_tasks' require 'rake/testtask' @@ -11,29 +13,28 @@ begin require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:refinement) do |task| - task.rspec_opts = "--order rand" - task.pattern = "spec/refinement/*_spec.rb" + task.rspec_opts = '--order rand' + task.pattern = 'spec/refinement/*_spec.rb' end RSpec::Core::RakeTask.new(:monkeypatch) do |task| - task.rspec_opts = "--order rand" - task.pattern = "spec/monkeypatch/*_spec.rb" + task.rspec_opts = '--order rand' + task.pattern = 'spec/monkeypatch/*_spec.rb' end RSpec::Core::RakeTask.new(:safe) do |task| - task.rspec_opts = "--order rand" - task.pattern = "spec/safe/*_spec.rb" + task.rspec_opts = '--order rand' + task.pattern = 'spec/safe/*_spec.rb' end - rescue LoadError - warn "rspec unavailable" + warn 'rspec unavailable' end task :default do - Rake::Task["test"].invoke - Rake::Task["monkeypatch"].invoke - Rake::Task["safe"].invoke - Rake::Task["refinement"].invoke if ruby_major >= 2 && ruby_minor >= 1 + Rake::Task['test'].invoke + Rake::Task['monkeypatch'].invoke + Rake::Task['safe'].invoke + Rake::Task['refinement'].invoke if ruby_major >= 2 && ruby_minor >= 1 end def ruby_major @@ -43,6 +44,3 @@ end def ruby_minor RUBY_VERSION.split(/\./)[1].to_i end - - - diff --git a/descriptive_statistics.gemspec b/descriptive_statistics.gemspec index 1a2a02a..6d93bd2 100644 --- a/descriptive_statistics.gemspec +++ b/descriptive_statistics.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'descriptive_statistics' - s.version = '2.5.1' + s.version = '2.5.2' s.homepage = 'https://github.com/thirtysixthspan/descriptive_statistics' s.summary = 'Descriptive Statistics' s.description = 'Adds descriptive statistics methods to Enumerable module for use on collections or Numeric data' @@ -9,4 +9,3 @@ Gem::Specification.new do |s| s.files = Dir['lib/**/**/*'] s.license = "MIT" end - diff --git a/pkg/descriptive_statistics-2.5.1.gem b/pkg/descriptive_statistics-2.5.1.gem deleted file mode 100644 index 77b2338..0000000 Binary files a/pkg/descriptive_statistics-2.5.1.gem and /dev/null differ diff --git a/pkg/descriptive_statistics-2.5.2.gem b/pkg/descriptive_statistics-2.5.2.gem new file mode 100644 index 0000000..ae75621 Binary files /dev/null and b/pkg/descriptive_statistics-2.5.2.gem differ diff --git a/test/test.rb b/test/test.rb index 569b49f..cb96b13 100644 --- a/test/test.rb +++ b/test/test.rb @@ -5,64 +5,64 @@ SimpleCov.command_name 'minitest' -class TestData < MiniTest::Unit::TestCase +class TestData < Minitest::Test def setup @data = [] - CSV.foreach("test/testdata.csv") do |row| + CSV.foreach('test/testdata.csv') do |row| @data.push row.map(&:to_f) end end def test_sum @data.each do |test_case| - assert_equal test_case[0,10].sum.round(6), test_case[10].round(6) + assert_equal test_case[0, 10].sum.round(6), test_case[10].round(6) end end def test_mean @data.each do |test_case| - assert_equal test_case[0,10].mean.round(6), test_case[11].round(6) + assert_equal test_case[0, 10].mean.round(6), test_case[11].round(6) end end def test_median @data.each do |test_case| - assert_equal test_case[0,10].median.round(6), test_case[12].round(6) + assert_equal test_case[0, 10].median.round(6), test_case[12].round(6) end end def test_variance @data.each do |test_case| - assert_equal test_case[0,10].variance.round(6), test_case[13].round(6) + assert_equal test_case[0, 10].variance.round(6), test_case[13].round(6) end end def test_standard_deviation @data.each do |test_case| - assert_equal test_case[0,10].standard_deviation.round(6), test_case[14].round(6) + assert_equal test_case[0, 10].standard_deviation.round(6), test_case[14].round(6) end end def test_percentile @data.each do |test_case| - assert_equal test_case[0,10].percentile(0).round(6), test_case[15].round(6) - assert_equal test_case[0,10].percentile(10).round(6), test_case[16].round(6) - assert_equal test_case[0,10].percentile(20).round(6), test_case[17].round(6) - assert_equal test_case[0,10].percentile(30).round(6), test_case[18].round(6) - assert_equal test_case[0,10].percentile(40).round(6), test_case[19].round(6) - assert_equal test_case[0,10].percentile(50).round(6), test_case[20].round(6) - assert_equal test_case[0,10].percentile(60).round(6), test_case[21].round(6) - assert_equal test_case[0,10].percentile(70).round(6), test_case[22].round(6) - assert_equal test_case[0,10].percentile(80).round(6), test_case[23].round(6) - assert_equal test_case[0,10].percentile(90).round(6), test_case[24].round(6) - assert_equal test_case[0,10].percentile(100).round(6), test_case[25].round(6) + assert_equal test_case[0, 10].percentile(0).round(6), test_case[15].round(6) + assert_equal test_case[0, 10].percentile(10).round(6), test_case[16].round(6) + assert_equal test_case[0, 10].percentile(20).round(6), test_case[17].round(6) + assert_equal test_case[0, 10].percentile(30).round(6), test_case[18].round(6) + assert_equal test_case[0, 10].percentile(40).round(6), test_case[19].round(6) + assert_equal test_case[0, 10].percentile(50).round(6), test_case[20].round(6) + assert_equal test_case[0, 10].percentile(60).round(6), test_case[21].round(6) + assert_equal test_case[0, 10].percentile(70).round(6), test_case[22].round(6) + assert_equal test_case[0, 10].percentile(80).round(6), test_case[23].round(6) + assert_equal test_case[0, 10].percentile(90).round(6), test_case[24].round(6) + assert_equal test_case[0, 10].percentile(100).round(6), test_case[25].round(6) end end def test_percentile_rank @data.each do |test_case| - assert_equal test_case[0,10].percentile_rank(50).round(6), test_case[26].round(6) + assert_equal test_case[0, 10].percentile_rank(50).round(6), test_case[26].round(6) end end