chronic_between 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/lib/chronic_between.rb +7 -2
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd466f4f19e9f874988e0329cf2a23e65dae616e89a43cc6adc96fbb226c7f4a
|
4
|
+
data.tar.gz: a73e8db3600949810dcc188a1b93f38dea023a4b1af71149e507462dad63d860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcff7e1534de947ebecf54b4f99bd4ae256e58010e25ddc403329af1369c72c79d9637d516f02a7572912bc84d643feee078d830bf7b32ccba33b21696181ab5
|
7
|
+
data.tar.gz: 0e84a667249e165e9a59a82b12bead1d1e08e8c3e216988fc4f0a9122fbcb09f27db1244e6fd0d534ab039c4cf5b0bb4936262c48e15f8bb46fc14a4ec0edffb
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
��
|
1
|
+
&���H[����-nM�Ց���Z��Vf�T�wo����������2��U�_��&��2ƄtNp|x��:l=7\dV[ߊ��q���i�>c��"&aW�Z�(L���"[\��g���W��'�`�1����i��[.#]�Ьo���G�%��|NRbuWH����T����3�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/chronic_between.rb
CHANGED
@@ -9,8 +9,9 @@ require 'app-routes'
|
|
9
9
|
class ChronicBetween
|
10
10
|
include AppRoutes
|
11
11
|
|
12
|
-
def initialize(x)
|
12
|
+
def initialize(x, debug: false)
|
13
13
|
|
14
|
+
@debug = debug
|
14
15
|
@times = x.is_a?(String) ? x.split(/[,;&]/).map(&:strip) : x
|
15
16
|
super()
|
16
17
|
end
|
@@ -146,12 +147,15 @@ class ChronicBetween
|
|
146
147
|
|
147
148
|
# e.g. April 5th - April 9th
|
148
149
|
get %r{^(.*)\s+-\s+(.*)$} do
|
150
|
+
|
151
|
+
puts 'route 600' if @debug
|
149
152
|
d1, d2 = params[:captures]
|
150
153
|
cdate1, cdate2 = [d1,d2].map {|d| Chronic.parse(d, :now => Time.local(@year))}
|
151
154
|
n_days = ((cdate2 - cdate1) / 86400).to_i
|
152
155
|
|
153
156
|
date1 = DateTime.parse(cdate1.strftime("%d-%b-%y") + ' 00:00')
|
154
|
-
|
157
|
+
date2 = DateTime.parse(cdate1.strftime("%d-%b-%y") + ' 23:59:59')
|
158
|
+
[date1, date2 + n_days]
|
155
159
|
end
|
156
160
|
|
157
161
|
# e.g. April 5th
|
@@ -166,6 +170,7 @@ class ChronicBetween
|
|
166
170
|
end
|
167
171
|
|
168
172
|
def build(times)
|
173
|
+
|
169
174
|
times.inject([]) do |result, x|
|
170
175
|
r = run_route(x.strip)
|
171
176
|
r.first.is_a?(Array) ? result + r : result << r
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chronic_between
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
Ne+ahcHAtwCL3/OPMC7V9VQfw400l8Gx8gnhXY+vg37QXrdjt1Aq6cSlHhdnQJkr
|
36
36
|
+UWA0LSKYjup6Y8u3MMD7/Lf
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2021-06-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: chronic
|
@@ -78,7 +78,7 @@ dependencies:
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: 0.1.19
|
80
80
|
description:
|
81
|
-
email:
|
81
|
+
email: digital.robertson@gmail.com
|
82
82
|
executables: []
|
83
83
|
extensions: []
|
84
84
|
extra_rdoc_files: []
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.1.2
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: chronic_between
|
metadata.gz.sig
CHANGED
Binary file
|