iso8601 0.8.1 → 0.8.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: ebc324dddf45972ba0a794b182d1cc9057aba93a
4
- data.tar.gz: df0e9923948069eff193d5cad7db26e244bb25aa
3
+ metadata.gz: fd22bba59a7a58d3de630fee01ac22e7d1883eef
4
+ data.tar.gz: f74f72a6343a250efb7c364e72470973984dc0c7
5
5
  SHA512:
6
- metadata.gz: d475f9aa2193aeb8d1e935fb2b74aaeb98112184d5e3d95243d10768bc10799327a130e57def52791bf0a310de16ae5703962cb7ee8d23e8a3a56ec06b9f6f6c
7
- data.tar.gz: d8e4f640791540d73a3388d11c2a4cbf01379cf34db30324b6e83fadf69213be7e099465edb1860387498d0d7221a064b2bf3829379dd37b07a7bb4f58eb15ae
6
+ metadata.gz: 871a47af5667cc18985c72b46ae93a98d0291be954818104891b27548fa8fa4953a3da8a0c3966bdc9813e3e0b3558f508ba3cbf8f3f59998ddea599bf089083
7
+ data.tar.gz: 05aea0366c18e414d66b7ac50279656c5a2bbee537b22db547c58709445509de3ee8cf102f109ab011b2c84711ba59a30e02a8a8a0e8666c261af3c490efeadc
@@ -1,3 +1,7 @@
1
+ ## 0.8.2
2
+
3
+ * Fix time components using comma (,) as a decimal separator.
4
+
1
5
  ## 0.8.1
2
6
 
3
7
  * Fix durations using comma (,) as a decimal separator.
@@ -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
- ISO8601::DateTime.new(moment.strftime(format))
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
- ISO8601::DateTime.new(moment.strftime(format))
49
+ self.class.new(moment.strftime(format))
50
50
  end
51
51
  ##
52
52
  # Converts DateTime to a formated string
@@ -122,7 +122,7 @@ module ISO8601
122
122
 
123
123
  hour = hour.to_i
124
124
  minute &&= minute.to_i
125
- second &&= second.to_f
125
+ second &&= second.tr(',', '.').to_f
126
126
 
127
127
  fail ISO8601::Errors::UnknownPattern, @original unless valid_zone?(zone)
128
128
 
@@ -1,5 +1,5 @@
1
1
  module ISO8601
2
2
  ##
3
3
  # The gem version
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
@@ -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.1
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-14 00:00:00.000000000 Z
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