chronic 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -0
- data/lib/chronic.rb +2 -2
- data/lib/chronic/parser.rb +1 -1
- data/test/test_parsing.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0bcdd2460eb86f8898212a9eca5e325c9aa5e61
|
4
|
+
data.tar.gz: d8abd19da58e28473139b8f137991cb0ee150c49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bfd4f32ce8f8ef6585042425ea64cc95d07998287fb16fa45b8d0a06d5dd48f8b85e6fecbf00e69101e560f21527ef6539a8994a9457357d25c2c832c7b87f
|
7
|
+
data.tar.gz: 87db3c22292ed9d5a22ecc84e6b14dafb2ed1c7a4c2f829873593b86b37707999adfaf43a5e0d801daffaaec9c7b599beade2d366d108c60bf2e8989998ed4b4
|
data/HISTORY.md
CHANGED
data/lib/chronic.rb
CHANGED
@@ -53,7 +53,7 @@ require 'chronic/repeaters/repeater_time'
|
|
53
53
|
# Chronic.parse('monday', :context => :past)
|
54
54
|
# #=> Mon Aug 21 12:00:00 PDT 2006
|
55
55
|
module Chronic
|
56
|
-
VERSION = "0.10.
|
56
|
+
VERSION = "0.10.2"
|
57
57
|
|
58
58
|
class << self
|
59
59
|
|
@@ -139,7 +139,7 @@ module Chronic
|
|
139
139
|
end
|
140
140
|
if Chronic.time_class.name == "Date"
|
141
141
|
Chronic.time_class.new(year, month, day)
|
142
|
-
elsif not Chronic.time_class.respond_to?(:new)
|
142
|
+
elsif not Chronic.time_class.respond_to?(:new) or (RUBY_VERSION.to_f < 1.9 and Chronic.time_class.name == "Time")
|
143
143
|
Chronic.time_class.local(year, month, day, hour, minute, second)
|
144
144
|
else
|
145
145
|
offset = Time::normalize_offset(offset) if Chronic.time_class.name == "DateTime"
|
data/lib/chronic/parser.rb
CHANGED
@@ -90,7 +90,7 @@ module Chronic
|
|
90
90
|
text = text.to_s.downcase
|
91
91
|
text.gsub!(/\b(\d{2})\.(\d{2})\.(\d{4})\b/, '\3 / \2 / \1')
|
92
92
|
text.gsub!(/\b([ap])\.m\.?/, '\1m')
|
93
|
-
text.gsub!(/(
|
93
|
+
text.gsub!(/(\s+|:\d{2}|:\d{2}\.\d{3})\-(\d{2}:?\d{2})\b/, '\1tzminus\2')
|
94
94
|
text.gsub!(/\./, ':')
|
95
95
|
text.gsub!(/([ap]):m:?/, '\1m')
|
96
96
|
text.gsub!(/['"]/, '')
|
data/test/test_parsing.rb
CHANGED
@@ -180,6 +180,9 @@ class TestParsing < TestCase
|
|
180
180
|
time = parse_now("2011-07-03 22:11:35 +01:00")
|
181
181
|
assert_equal 1309727495, time.to_i
|
182
182
|
|
183
|
+
time = parse_now("2011-07-03 16:11:35 -05:00")
|
184
|
+
assert_equal 1309727495, time.to_i
|
185
|
+
|
183
186
|
time = parse_now("2011-07-03 21:11:35 UTC")
|
184
187
|
assert_equal 1309727495, time.to_i
|
185
188
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|