From 4776d8ab504b3fe51eed0b674b1c641dc1dec46f Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 23 Feb 2017 07:52:48 +0900 Subject: [PATCH 1/4] Fix warnings: `Use assert_nil if expecting nil` --- test/test_parsing.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_parsing.rb b/test/test_parsing.rb index 1c7f9eae..979167b6 100644 --- a/test/test_parsing.rb +++ b/test/test_parsing.rb @@ -450,7 +450,7 @@ def test_handle_sm_sd # assert_equal Time.local(2006, 12, 16, 12), time # # time = parse_now("13/06") - # assert_equal nil, time + # assert_nil time # end def test_handle_sy_sm @@ -513,7 +513,7 @@ def test_handle_orr assert_equal Time.local(2007, 01, 30, 12), time time = parse_now("5th tuesday in february") - assert_equal nil, time + assert_nil time %W(jan feb march april may june july aug sep oct nov dec).each_with_index do |month, index| time = parse_now("5th tuesday in #{month}") @@ -529,7 +529,7 @@ def test_handle_o_r_s_r assert_equal Time.local(2006, 11, 15, 12), time time = parse_now("10th wednesday in november") - assert_equal nil, time + assert_nil time # time = parse_now("3rd wednesday in 2007") # assert_equal Time.local(2007, 1, 20, 12), time @@ -1060,13 +1060,13 @@ def test_parse_guess_o_r_g_r def test_parse_guess_nonsense time = parse_now("some stupid nonsense") - assert_equal nil, time + assert_nil time time = parse_now("Ham Sandwich") - assert_equal nil, time + assert_nil time time = parse_now("t") - assert_equal nil, time + assert_nil time end def test_parse_span From fa547b45a7723aca889115e50452b4bed9cbe520 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 23 Feb 2017 12:42:13 +0900 Subject: [PATCH 2/4] Use the latest Rubies on Travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8722f9f6..d7a5577e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: ruby rvm: + - 2.4.0 + - 2.3 + - 2.2 - 2.1 - 2.0.0 - 1.9.3 From 73e4a94ce7f7e95e9425e2f7e16b8ba5af70e69e Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 4 Apr 2017 11:32:16 +0900 Subject: [PATCH 3/4] CI against Ruby 2.4.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7a5577e..ca6b9333 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby rvm: - - 2.4.0 + - 2.4.1 - 2.3 - 2.2 - 2.1 From 86db388a71bc8f5c9e8b861d75e23df4abac26b6 Mon Sep 17 00:00:00 2001 From: Renz Iver Baliber Date: Wed, 28 Jun 2017 13:05:26 +0800 Subject: [PATCH 4/4] Fix Chronic.parse year 00 returns nil --- lib/chronic/date.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/chronic/date.rb b/lib/chronic/date.rb index 64bfed11..8c646191 100644 --- a/lib/chronic/date.rb +++ b/lib/chronic/date.rb @@ -46,9 +46,8 @@ def self.could_be_month?(month, width = nil) # Checks if given number could be year def self.could_be_year?(year, width = nil) - year >= 1 && year <= 9999 && (width.nil? || width == 2 || width == 4) + year >= 0 && year <= 9999 && (width.nil? || width == 2 || width == 4) end - # Build a year from a 2 digit suffix. # # year - The two digit Integer year to build from.