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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e2865012a80e1f1b4a3fcaf61ff9fe58dbc4e78a5a3d0d7b3f11fbfe77c9fc5
4
- data.tar.gz: 24917faa9f82dd24a0bb77d69ad634a848fd2ab7f591543683c267b07a37cff2
3
+ metadata.gz: cd466f4f19e9f874988e0329cf2a23e65dae616e89a43cc6adc96fbb226c7f4a
4
+ data.tar.gz: a73e8db3600949810dcc188a1b93f38dea023a4b1af71149e507462dad63d860
5
5
  SHA512:
6
- metadata.gz: 8ae97ebee98bd804fb629e19cb43f43b89454524e3c352ad164358c734743f319588d4e29f9f075f633644e3a6278681843956e8e6489246c61b1946493e0f34
7
- data.tar.gz: 84b766228dbeace64509714a112e470c70b68c139265f3165f0121970ab2be9804324e3ca8a7c2008cb95c364059a6019c3fd77369a176a90808fe85159eb1bf
6
+ metadata.gz: dcff7e1534de947ebecf54b4f99bd4ae256e58010e25ddc403329af1369c72c79d9637d516f02a7572912bc84d643feee078d830bf7b32ccba33b21696181ab5
7
+ data.tar.gz: 0e84a667249e165e9a59a82b12bead1d1e08e8c3e216988fc4f0a9122fbcb09f27db1244e6fd0d534ab039c4cf5b0bb4936262c48e15f8bb46fc14a4ec0edffb
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- ��N.�ȕ�u
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
@@ -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
- [date1, date1 + n_days + 1]
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.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: 2020-08-18 00:00:00.000000000 Z
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: james@jamesrobertson.eu
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.0.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