timeliness 0.3.8 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5416676829597b429ae232b78e90623d8e1aabc2
4
- data.tar.gz: 0ab3eb69ceead65aa57c127daf153c7ebe8702f6
2
+ SHA256:
3
+ metadata.gz: 61304e47092ed4394992d7be784270fdb300cbfb82209398795fe50d37c9bc88
4
+ data.tar.gz: 64d5a8f434688d5094210fb9d3f0563ea0d86052bd9e09a74d2f4a9e873d1df4
5
5
  SHA512:
6
- metadata.gz: 417eee657c054357f1be5d59a461d993c95a58248dfaa942198625627d79516204917d27973ac5b17ff44429ae749abe8a727665ad50656e264745e18c6d7e4c
7
- data.tar.gz: 0b6316ca2d841d7f827409e2ebcd31b9162cfa6dc29d8d686501b27b71edc34e114de8569aa4e008fe42e025974404ade97208bc4e9d815715da0c629f16e025
6
+ metadata.gz: 70299983eed5a69131fa0411c553affae6ff98ff0896e5ef26a1a7b7e846b4091daa752a6798d51d328dd349fef2814db6381fe801945bd51eff8a820bb89eff
7
+ data.tar.gz: '046963beb68a47fd1445872417342f4e5dff465376730ebf6aadff3259d3571e9c6845b9af85994247b593480ae778373279a42b99c6b7854c8befb520caacff'
@@ -260,7 +260,7 @@ parser will then not consider that a valid format. To remove a format
260
260
 
261
261
  Adding new formats is also simple
262
262
 
263
- Timeliness.add_formats(:time, "d o'clock")
263
+ Timeliness.add_formats(:time, "h o'clock")
264
264
 
265
265
  Now "10 o'clock" will be a valid value.
266
266
 
@@ -28,6 +28,7 @@ module Timeliness
28
28
 
29
29
  value = create_time_in_zone(time_array[0..6].compact, zone || zone_option)
30
30
  value = shift_time_to_zone(value, zone_option) if zone
31
+ return nil unless value
31
32
 
32
33
  offset ? value + (value.utc_offset - offset) : value
33
34
  rescue ArgumentError, TypeError
@@ -1,3 +1,3 @@
1
1
  module Timeliness
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.10'
3
3
  end
@@ -64,6 +64,10 @@ describe Timeliness::Parser do
64
64
  should_not_parse("2000-02-01 25:13:14")
65
65
  end
66
66
 
67
+ it 'should return nil for ISO 8601 string with invalid time part' do
68
+ should_not_parse("2000-02-01T25:13:14+02:00")
69
+ end
70
+
67
71
  context "string with zone offset value" do
68
72
  context "when current timezone is earler than string zone" do
69
73
  before(:all) do
@@ -459,6 +463,11 @@ describe Timeliness::Parser do
459
463
  expect(time).to be_nil
460
464
  end
461
465
 
466
+ it "should return nil for invalid time in array with timezone" do
467
+ time = parser.make_time([2010,9,8,25,13,14,0,1])
468
+ expect(time).to be_nil
469
+ end
470
+
462
471
  context "default timezone" do
463
472
  before do
464
473
  @default_timezone = Timeliness.default_timezone
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = %q{http://github.com/adzap/timeliness}
12
12
  s.summary = %q{Date/time parsing for the control freak.}
13
13
  s.description = %q{Fast date/time parser with customisable formats, timezone and I18n support.}
14
+ s.license = "MIT"
14
15
 
15
16
  s.rubyforge_project = %q{timeliness}
16
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeliness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-06 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -112,7 +112,8 @@ files:
112
112
  - spec/timeliness_helper.rb
113
113
  - timeliness.gemspec
114
114
  homepage: http://github.com/adzap/timeliness
115
- licenses: []
115
+ licenses:
116
+ - MIT
116
117
  metadata: {}
117
118
  post_install_message:
118
119
  rdoc_options: []
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  version: '0'
131
132
  requirements: []
132
133
  rubyforge_project: timeliness
133
- rubygems_version: 2.4.5
134
+ rubygems_version: 2.7.6
134
135
  signing_key:
135
136
  specification_version: 4
136
137
  summary: Date/time parsing for the control freak.