datet 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.23
1
+ 0.0.24
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "datet"
8
- s.version = "0.0.23"
8
+ s.version = "0.0.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2013-03-27"
12
+ s.date = "2013-04-08"
13
13
  s.description = "A framework for handeling date- and time-related stuff in Ruby."
14
14
  s.email = "k@spernj.org"
15
15
  s.extra_rdoc_files = [
@@ -1122,11 +1122,13 @@ class Datet
1122
1122
  return Datet.new(match[1].to_i, match[2].to_i, match[3].to_i, match[5].to_i, match[6].to_i, match[7].to_i)
1123
1123
  elsif match = timestr_t.match(/^([A-z]+),\s*(\d+)\s+([A-z]+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s*([A-z]+)$/)
1124
1124
  return Datet.new(match[4].to_i, Datet.month_str_to_no(match[3]), match[2].to_i, match[5].to_i, match[6].to_i, match[7].to_i)
1125
- elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})t(\d{2}):(\d{2}):(\d{2})\+(\d{4}$)$/i)
1125
+ elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})t(\d{2}):(\d{2}):(\d{2})\+(\d{4})$/i)
1126
1126
  return Datet.new(match[1].to_i, match[2].to_i, match[3].to_i, match[4].to_i, match[5].to_i, match[6].to_i)
1127
- elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})t(\d{2}):(\d{2}):(\d{2})\.(\d+)$/)
1127
+ elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})(t|\s+)(\d{2}):(\d{2}):(\d{2})\.(\d+)(z|)$/i)
1128
1128
  #FIXME: Parse the weird usec at the end.
1129
- return Datet.new(match[1].to_i, match[2].to_i, match[3].to_i, match[4].to_i, match[5].to_i, match[6].to_i)
1129
+ return Datet.new(match[1].to_i, match[2].to_i, match[3].to_i, match[5].to_i, match[6].to_i, match[7].to_i)
1130
+ elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})(t|\s+)(\d{2}):(\d{2}):(\d{2})(z|)$/i)
1131
+ return Datet.new(match[1].to_i, match[2].to_i, match[3].to_i, match[5].to_i, match[6].to_i, match[7].to_i)
1130
1132
  end
1131
1133
 
1132
1134
  raise ArgumentError, "Wrong format: '#{timestr}', class: '#{timestr.class.name}'"
@@ -563,5 +563,8 @@ describe "Datet" do
563
563
  it "should handle a format form mssql" do
564
564
  datet = Datet.in("2010-10-31T18:21:45.8770000")
565
565
  datet.dbstr.should eql("2010-10-31 18:21:45")
566
+
567
+ datet = Datet.in("2010-10-31T18:21:45Z")
568
+ datet.dbstr.should eql("2010-10-31 18:21:45")
566
569
  end
567
570
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  segments:
112
112
  - 0
113
- hash: -3509118619356449614
113
+ hash: 4532058298207669716
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements: