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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f263bcd5514b460b4cb10a43df35c8892bfd6833
4
- data.tar.gz: 3a6cff0f27219456cec1b66f77278be4ed73624c
3
+ metadata.gz: d0bcdd2460eb86f8898212a9eca5e325c9aa5e61
4
+ data.tar.gz: d8abd19da58e28473139b8f137991cb0ee150c49
5
5
  SHA512:
6
- metadata.gz: 6185e7082e304721164dd59a375a6ccecfa2b549a52323a5b438c4703494af2f1a111cd144499f732259392cea9cb33c5fb6251012cb0e1cab5db19449b56125
7
- data.tar.gz: 1a29549c56f3be9af3ee80131642c340a2efcd801158088ec8ddd631471cd5a01dc8961be4e181e69d705227c5e311875c36b6bd7cee45c9b61b68a6f6e06bea
6
+ metadata.gz: 04bfd4f32ce8f8ef6585042425ea64cc95d07998287fb16fa45b8d0a06d5dd48f8b85e6fecbf00e69101e560f21527ef6539a8994a9457357d25c2c832c7b87f
7
+ data.tar.gz: 87db3c22292ed9d5a22ecc84e6b14dafb2ed1c7a4c2f829873593b86b37707999adfaf43a5e0d801daffaaec9c7b599beade2d366d108c60bf2e8989998ed4b4
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.10.2 / 2013-09-09
2
+
3
+ * Fix 1.8.7 support (due to be dropped in 0.11.0)
4
+ * Bugfix for times with negative zones
5
+
1
6
  # 0.10.1 / 2013-08-27
2
7
 
3
8
  * Support `ActiveSupport::TimeZone` (#209, #208)
@@ -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.1"
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"
@@ -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!(/(?<=:\d{2}|:\d{2}\.\d{3})\-(\d{2}:?\d{2})\b/, 'tzminus\1')
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!(/['"]/, '')
@@ -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.1
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-08-27 00:00:00.000000000 Z
12
+ date: 2013-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake