iso8601 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/iso8601/date_time.rb +2 -2
- data/lib/iso8601/time.rb +1 -1
- data/lib/iso8601/version.rb +1 -1
- data/spec/iso8601/time_spec.rb +4 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd22bba59a7a58d3de630fee01ac22e7d1883eef
|
4
|
+
data.tar.gz: f74f72a6343a250efb7c364e72470973984dc0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 871a47af5667cc18985c72b46ae93a98d0291be954818104891b27548fa8fa4953a3da8a0c3966bdc9813e3e0b3558f508ba3cbf8f3f59998ddea599bf089083
|
7
|
+
data.tar.gz: 05aea0366c18e414d66b7ac50279656c5a2bbee537b22db547c58709445509de3ee8cf102f109ab011b2c84711ba59a30e02a8a8a0e8666c261af3c490efeadc
|
data/CHANGELOG.md
CHANGED
data/lib/iso8601/date_time.rb
CHANGED
@@ -36,7 +36,7 @@ module ISO8601
|
|
36
36
|
moment = @date_time.to_time.localtime(zone) + other
|
37
37
|
format = moment.subsec.zero? ? FORMAT : FORMAT_WITH_FRACTION
|
38
38
|
|
39
|
-
|
39
|
+
self.class.new(moment.strftime(format))
|
40
40
|
end
|
41
41
|
##
|
42
42
|
# Substraction
|
@@ -46,7 +46,7 @@ module ISO8601
|
|
46
46
|
moment = @date_time.to_time.localtime(zone) - other
|
47
47
|
format = moment.subsec.zero? ? FORMAT : FORMAT_WITH_FRACTION
|
48
48
|
|
49
|
-
|
49
|
+
self.class.new(moment.strftime(format))
|
50
50
|
end
|
51
51
|
##
|
52
52
|
# Converts DateTime to a formated string
|
data/lib/iso8601/time.rb
CHANGED
data/lib/iso8601/version.rb
CHANGED
data/spec/iso8601/time_spec.rb
CHANGED
@@ -46,6 +46,10 @@ describe ISO8601::Time do
|
|
46
46
|
expect(t.zone).to eq('+04:00')
|
47
47
|
end
|
48
48
|
|
49
|
+
it "should keep the correct fraction when using commma separators" do
|
50
|
+
expect(ISO8601::Time.new('T16:26:10,5Z').second).to eq(10.5)
|
51
|
+
end
|
52
|
+
|
49
53
|
it "should respond to delegated casting methods" do
|
50
54
|
expect(ISO8601::Time.new('T10:09:08Z')).to respond_to(:to_s, :to_time, :to_date, :to_datetime)
|
51
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso8601
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnau Siches
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -101,4 +101,3 @@ test_files:
|
|
101
101
|
- spec/iso8601/duration_spec.rb
|
102
102
|
- spec/iso8601/time_spec.rb
|
103
103
|
- spec/spec_helper.rb
|
104
|
-
has_rdoc: yard
|