timeliness 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.rdoc +1 -1
- data/lib/timeliness/parser.rb +1 -0
- data/lib/timeliness/version.rb +1 -1
- data/spec/timeliness/parser_spec.rb +9 -0
- data/timeliness.gemspec +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 61304e47092ed4394992d7be784270fdb300cbfb82209398795fe50d37c9bc88
|
4
|
+
data.tar.gz: 64d5a8f434688d5094210fb9d3f0563ea0d86052bd9e09a74d2f4a9e873d1df4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70299983eed5a69131fa0411c553affae6ff98ff0896e5ef26a1a7b7e846b4091daa752a6798d51d328dd349fef2814db6381fe801945bd51eff8a820bb89eff
|
7
|
+
data.tar.gz: '046963beb68a47fd1445872417342f4e5dff465376730ebf6aadff3259d3571e9c6845b9af85994247b593480ae778373279a42b99c6b7854c8befb520caacff'
|
data/README.rdoc
CHANGED
@@ -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, "
|
263
|
+
Timeliness.add_formats(:time, "h o'clock")
|
264
264
|
|
265
265
|
Now "10 o'clock" will be a valid value.
|
266
266
|
|
data/lib/timeliness/parser.rb
CHANGED
@@ -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
|
data/lib/timeliness/version.rb
CHANGED
@@ -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
|
data/timeliness.gemspec
CHANGED
@@ -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.
|
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:
|
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.
|
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.
|