slide_rule 1.0.0 → 1.0.1
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 38e1fef1daba59d9089c2d76e641bd3badbb63fc8f6ee41e1848a25d6c37ca97
|
4
|
+
data.tar.gz: c408e991827a4432a65635aac1a08ae4adfc85fbd7b6e07374db3521ea000a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec65e2cdf24fe70bf839a8885ecb42cb40a958aa592fe7a1cf360bd6b7bb1462afcb13e675e0dcfbfd89c4f5dc063f8e240e457b2f1041daf08ee303336f373b
|
7
|
+
data.tar.gz: 7911f9ed6c7043eb623c80984820fddc02130d1ec5c74681204441d7c644d83d6432d2f87778abb5a64849b415105b261cb1a3722faf0ed2c91e3340bf0fc730
|
@@ -24,7 +24,7 @@ module SlideRule
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def cleanse_date(date)
|
27
|
-
date = Time.at(date).utc.to_date if date.is_a?(::
|
27
|
+
date = Time.at(date).utc.to_date if date.is_a?(::Integer)
|
28
28
|
date = Date.parse(date) unless date.is_a?(::Date) || date.is_a?(::Time)
|
29
29
|
date = date.to_date if date.is_a?(::Time)
|
30
30
|
|
@@ -8,7 +8,7 @@ module SlideRule
|
|
8
8
|
date_2 = cleanse_date(date_2)
|
9
9
|
threshold = options[:threshold] || DAYS_IN_YEAR
|
10
10
|
days_apart = (date_1.mjd - date_2.mjd).abs
|
11
|
-
|
11
|
+
|
12
12
|
return 1 if days_apart >= threshold
|
13
13
|
|
14
14
|
distance = days_apart.to_f / threshold
|
@@ -18,7 +18,7 @@ module SlideRule
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def cleanse_date(date)
|
21
|
-
date = Time.at(date).utc.to_date if date.is_a?(::
|
21
|
+
date = Time.at(date).utc.to_date if date.is_a?(::Integer)
|
22
22
|
date = Date.parse(date) unless date.is_a?(::Date) || date.is_a?(::Time)
|
23
23
|
date = date.to_date if date.is_a?(::Time)
|
24
24
|
|
data/lib/slide_rule/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slide_rule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mattnichols
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,8 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
-
description: Calculates the distance between 2 arbitrary objects using specified fields
|
84
|
+
description: Calculates the distance between 2 arbitrary objects using specified fields
|
85
|
+
and algorithms.
|
85
86
|
email:
|
86
87
|
- dev@mx.com
|
87
88
|
executables: []
|
@@ -128,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
- !ruby/object:Gem::Version
|
129
130
|
version: '0'
|
130
131
|
requirements: []
|
131
|
-
|
132
|
-
rubygems_version: 2.4.8
|
132
|
+
rubygems_version: 3.2.15
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Ruby object distance calculator
|