datet 0.0.22 → 0.0.23

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.22
1
+ 0.0.23
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "datet"
8
- s.version = "0.0.22"
8
+ s.version = "0.0.23"
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-06"
12
+ s.date = "2013-03-27"
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,7 +1122,10 @@ 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}$)$/)
1125
+ elsif match = timestr_t.match(/^(\d{4})-(\d{2})-(\d{2})t(\d{2}):(\d{2}):(\d{2})\+(\d{4}$)$/i)
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+)$/)
1128
+ #FIXME: Parse the weird usec at the end.
1126
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)
1127
1130
  end
1128
1131
 
@@ -559,4 +559,9 @@ describe "Datet" do
559
559
  expect = 27
560
560
  raise "Expected #{expect} but got #{years}" if age != expect
561
561
  end
562
+
563
+ it "should handle a format form mssql" do
564
+ datet = Datet.in("2010-10-31T18:21:45.8770000")
565
+ datet.dbstr.should eql("2010-10-31 18:21:45")
566
+ end
562
567
  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.22
4
+ version: 0.0.23
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-06 00:00:00.000000000 Z
12
+ date: 2013-03-27 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: -4119752225823393758
113
+ hash: -3509118619356449614
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements: