new_time 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecf87326a298905488030af21a6fea616fbd52fa
4
- data.tar.gz: cd7f3bf81f047ab7adcc3b8745dfef7d2e1bdf64
3
+ metadata.gz: 3844189bf4a61688714fd85e39a4d617f18650a5
4
+ data.tar.gz: ed77ac05becb69df09d68d23d932298adcf51144
5
5
  SHA512:
6
- metadata.gz: 9b6e2389d3c4e479eb63cc4a8894e539b41bedf1f322f765ddbcd81fcca84987aa9c61bccca235d0bdd1b3c5a295abe0eca35ee5c4b8ae51483310fa0e699ec6
7
- data.tar.gz: 563ba3fbb987eabf1b56b12d7176e42825959daa068a222754186d7fa217ee9d0cc3fc1778ccf8952600f7a75a3c49f73e628de87dcf8afa26edfa19b29351e9
6
+ metadata.gz: 48ee8db0feb7569a2c1d0393f8de0df5f82c15388e707ee92d60406db0c92435a2f3ef5684c43197c570df9daeb0fe203a9f702baf4b153ac42f9e602e4f64e7
7
+ data.tar.gz: 12cb94d9966d7290bfe7ddbe4aff3e7a6261ae6536bd06a2cc13b11e46383282ed2478fed8a155eca1b908d83ec0a9ad330bc668ed8e3b1d7929f833e69a8cef
@@ -1,3 +1,3 @@
1
1
  module NewTime
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/new_time.rb CHANGED
@@ -50,7 +50,7 @@ module NewTime
50
50
  new_start_hour = 18
51
51
  end
52
52
  end
53
- start + (new_seconds / (60 * 60) - new_start_hour) * (finish - start) / 12
53
+ start + (new_seconds.to_f / (60 * 60) - new_start_hour) * (finish - start) / 12
54
54
  end
55
55
 
56
56
  def self.convert(date_time, point)
@@ -85,5 +85,20 @@ describe NewTime do
85
85
  it { i(7, 12) }
86
86
  it { i(7, 18) }
87
87
  end
88
+
89
+ describe "inverting should work with zero fractional" do
90
+ it do
91
+ n1 = NewTime::NewTime.new(2015,2,1,6,50,33,0)
92
+ t1 = n1.convert(point)
93
+ n2 = NewTime::NewTime.convert(t1, point)
94
+ expect(n2.year).to eq n1.year
95
+ expect(n2.month).to eq n1.month
96
+ expect(n2.day).to eq n1.day
97
+ expect(n2.hours).to eq n1.hours
98
+ expect(n2.minutes).to eq n1.minutes
99
+ expect(n2.seconds).to eq n1.seconds
100
+ expect(n2.fractional).to eq n1.fractional
101
+ end
102
+ end
88
103
  end
89
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: new_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Landauer