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
- SHA1:
3
- metadata.gz: 66f0ba46303354b7b468dcc13103acffe6e53b65
4
- data.tar.gz: 92334c787512fe9b2b6b3b7406d7709d6de27c16
2
+ SHA256:
3
+ metadata.gz: 38e1fef1daba59d9089c2d76e641bd3badbb63fc8f6ee41e1848a25d6c37ca97
4
+ data.tar.gz: c408e991827a4432a65635aac1a08ae4adfc85fbd7b6e07374db3521ea000a67
5
5
  SHA512:
6
- metadata.gz: 85b76abcb7b43301d8a16a5200e69ba2a9f734dac717e983e930da2fdc258261a61936481672bdf2f9523f0270254fb5e81010c0d8a764151f8a1f9525e713fa
7
- data.tar.gz: 29f0fa854708b4abb50c5ba563abf9334f6a3b410fa4bea7d85f320ac86d9ddaa12b1ab0ac22481cf0537bfc3ccea8b480af64c37d273aeb70ed0a306a0b3903
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?(::Fixnum)
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?(::Fixnum)
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
 
@@ -1,3 +1,3 @@
1
1
  module SlideRule
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'date'
2
3
 
3
4
  describe ::SlideRule::DistanceCalculators::DayOfMonth do
4
5
  describe '#calculate' do
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.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: 2016-02-03 00:00:00.000000000 Z
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 and algorithms.
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
- rubyforge_project:
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