datet 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/datet.gemspec +2 -2
- data/lib/datet.rb +2 -0
- data/spec/datet_spec.rb +4 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.18
|
data/datet.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{datet}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.18"
|
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 = %q{2012-08-
|
12
|
+
s.date = %q{2012-08-26}
|
13
13
|
s.description = %q{A framework for handeling date- and time-related stuff in Ruby.}
|
14
14
|
s.email = %q{k@spernj.org}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/datet.rb
CHANGED
@@ -1540,6 +1540,8 @@ class Datet
|
|
1540
1540
|
|
1541
1541
|
year_no = match[4].to_i
|
1542
1542
|
self.year = year_no if year_no > 0
|
1543
|
+
elsif datet = Datet.in(str) rescue false
|
1544
|
+
self.update_from_time(datet.time)
|
1543
1545
|
else
|
1544
1546
|
raise "Could not understand given string: '#{str}'."
|
1545
1547
|
end
|
data/spec/datet_spec.rb
CHANGED
@@ -518,5 +518,9 @@ describe "Datet" do
|
|
518
518
|
datet.update_from_str("1/2 2009")
|
519
519
|
res = datet.dbstr
|
520
520
|
raise "Expected '2009-02-01 09:30:30' but got: '#{res}'." if res != "2009-02-01 09:30:30"
|
521
|
+
|
522
|
+
datet.update_from_str("2012-06-17 10:30:00")
|
523
|
+
res = datet.dbstr
|
524
|
+
raise "Expected '2012-06-17 10:30:00' but got: '#{res}'." if res != "2012-06-17 10:30:00"
|
521
525
|
end
|
522
526
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: datet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.18
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kasper Johansen
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-08-
|
13
|
+
date: 2012-08-26 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
hash: -
|
96
|
+
hash: -2763202019321149336
|
97
97
|
segments:
|
98
98
|
- 0
|
99
99
|
version: "0"
|