From 7df773b4463c8a5a8a1b2110e0fcfafd1a2ad7ea Mon Sep 17 00:00:00 2001 From: FIlipe Veloso Date: Fri, 24 May 2019 17:46:47 -0300 Subject: [PATCH 1/3] Basic update to ruby 2.6.3 & rubocop basic lintes changes on test.rb --- .travis.yml | 1 + Gemfile.lock | 46 +++++++++++++++++++++++++--------------------- test/test.rb | 38 +++++++++++++++++++------------------- 3 files changed, 45 insertions(+), 40 deletions(-) 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/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 From 4df1fad2951baba2d1ef3fa41b02e9b6988fd0c5 Mon Sep 17 00:00:00 2001 From: FIlipe Veloso Date: Fri, 24 May 2019 17:54:21 -0300 Subject: [PATCH 2/3] rubocop on rake task, magic comment for future updates --- Rakefile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) 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 - - - From de78a6f0cef928e219dff7df5d119ff01d59283d Mon Sep 17 00:00:00 2001 From: FIlipe Veloso Date: Fri, 24 May 2019 17:58:09 -0300 Subject: [PATCH 3/3] add and build v 2.5.2 - rake safe 100% --- descriptive_statistics.gemspec | 3 +-- pkg/descriptive_statistics-2.5.1.gem | Bin 6144 -> 0 bytes pkg/descriptive_statistics-2.5.2.gem | Bin 0 -> 6144 bytes 3 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 pkg/descriptive_statistics-2.5.1.gem create mode 100644 pkg/descriptive_statistics-2.5.2.gem 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 77b2338e3a860d65da2e4c9bfaccae5edb8735c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHKc|6qJ8Xty2itNjbElU~3Fbvs-WLK0zBFiKc#xf|&Oi_$%gOF^mNJwZb6-6kr z6ESvP#mK&98S}f|d;fUfPk-F|&+Xp(xu2eY&N-jwoaa2tIp61bJY8^3SDkQ9aMvKv z&mzP=DJv_3{uuY^$5BxUsR~k5+TVdfsUlQWKnO*oG713_L;Ng-{wmks59j2&uTr3! zi;Kr!89&Vb75^W${b}3}$NyKCqR}iMEw7{tjNlK+XX1MioDoZO-Z4va;~_GH$n-lV zl{ZqKs1MOO?mO@9{4E|4&}!udXiQxlhC2`Pz$Fv7hU1%&OSt??DJ$IbbDooPrDB*{ z3{`Ta>ZG72Pl!Vr(|7MB!dSTc`8N&}ak@*LmIn`m4urJ^7l%Mn1!jWX($Jm!#Yl+~ z&7s7nT4w7nHUvykR**Vd&QS=(q7;hnVf;?yaLk7<0Wwi4G z!(x(O9*?g+!!TCX7CF4$Z)IwM&55W&oe*S_y!?a1z>}0XX5bmh6lvc zax>Ar9xvMY%(p_W95L4(x2JJicHgm_$csRD4bMLKJv8USt7j1O@n(4oN(Dp<9r%`+ zr;@?z?YCL|)n#qa_c&85ySvFIqp|TCmb+L=<{&c|R$)9Sc(<)4)4MCZf@F#nvCb1Ax61{7gjoF(B5|3rcsXpwNNN?72RIsm%zu}w2 z?8Bb7uK3Uz!J3eyG9lT|VB(!n0UWA0HQAq}soPO;@osW}W6QFn(EIB{BBAP178lu2 zK~(8xkEmXEj<;H2v+D6LNMq-~kK){pk+|TI1-956?!zj#QBCj%`aM+2roU`~M3vAK ziaJM$IQt4s!5COZG}suVVzm)PObOSkzM#EqX7q|Hj*SQuC2&SGQY<3yR1u8$SXEIG zH;&?|yC{7zdB=4_=MWwpb|R-wV;Lb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