chronic_cron 0.3.2 → 0.3.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: 82f5e984d64725d608a1a29f7a958dcdedd47dd9
4
- data.tar.gz: e19b4bd2fe08e096c2898c2f8dbcf796c00051b7
3
+ metadata.gz: af577c5eef66d08a38b6c2fede4034908d6abbc8
4
+ data.tar.gz: 1d21b2c87d9fbd6a7f5685d362f33f0ac16ae940
5
5
  SHA512:
6
- metadata.gz: cc9e5ba1d9e79daa4c160697e7ad62c498628a27ca60fcb5e9c8ab728164e831eea5fd492a59dbc05b8eee312e99e8b80fec12cf421992f70ad9e502de523a19
7
- data.tar.gz: 707f219e4b7c4d0b636122da730537d58307550284680572e6110968d91909af0b270e3ac82a7f6c13bc532cc7bbc36ae9e7d5cdb0321b169612d401d52daa72
6
+ metadata.gz: 195c017132e9fe611c7e5142efe6ada9dded73cc76f540cbf48e5016cc4cd73a6c36c86fd66d0519fb67eaf8781d32676ba8774e1670e01855b8b58c10d1353b
7
+ data.tar.gz: d4b5291a704d9d6911d51a53417a1e037817addd6e22f6e598a31a28e254dbaba451ecccdb4814d7ffa0bbe1ea023cfa9cfe463f964ba0409acfaa2972ed748f
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- j(G���\���!��DKJU�摘��ec�93{��m�2hY�� H$F Ž�N�����(}4Vth�� �� JVÍ��ۉ��s��L��&:D��S93g"�YT$�%���P��4�
1
+ d_ W��VFz�m���, 0Cho� :U
2
+ ��b�������� ��ld��C�8�F�)�X�Ms3W�k@Ѥ��L�w��g�5��\Y���9�6��-�7=�RV5�=�A` ��s���:a��q�#)1����8��'xA�ß�e�K*�)�;*��@TV�J��◭9���� GBJlN�o�5��� �_��Ǔ���8�J���p}��k�ٝ']*�� .���aF,���N��D�r�ҜI ����f�
data.tar.gz.sig CHANGED
Binary file
data/lib/chronic_cron.rb CHANGED
@@ -186,8 +186,24 @@ class ChronicCron
186
186
  minute, hour = Chronic.parse(raw_time).to_a[1,2]
187
187
  "%s %s %s * %s" % [minute, hour, day_range, wday]
188
188
 
189
- end
189
+ end
190
+
191
+ # e.g. last sunday of March at 1am
190
192
 
193
+ get /last (#{Date::DAYNAMES.join('|')}) (?:of|in) \
194
+ (#{Date::MONTHNAMES[1..-1].join('|')})\s+at\s+(\d{1,2})(?::(\d{1,2}))?\
195
+ ([ap]m)/i do |day, month, raw_hrs, mins, meridiem|
196
+
197
+ now = Chronic.parse(month, now: @now)
198
+
199
+ t = Chronic.parse(month, now:
200
+ Time.local(now > @now ? now.year : now.year.next))
201
+ t2 = Chronic.parse('last ' + day, now:
202
+ Time.local(t.year, t.month.next)).to_date
203
+ hrs = in24hrs(raw_hrs, meridiem)
204
+
205
+ "%s %s %s %s *" % [mins.to_i, hrs, t2.day, t.month]
206
+ end
191
207
 
192
208
  # e.g. every 2nd tuesday at 4:40pm
193
209
  get /every\s+2nd\s+#{weekday}\s+at\s+(\d{1,2})(?::(\d{1,2}))?([ap]m)/i do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chronic_cron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  0wcgVFIVtcpX9C67gxjhpnaGcldx1X9px9b4jorMz4yZHdq+MonVlmQlYfhPLRog
32
32
  krK/e35wvDmTqQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-11-10 00:00:00.000000000 Z
34
+ date: 2017-03-28 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: app-routes
@@ -114,7 +114,7 @@ dependencies:
114
114
  - !ruby/object:Gem::Version
115
115
  version: 0.1.9
116
116
  description:
117
- email: james@r0bertson.co.uk
117
+ email: james@jamesrobertson.eu
118
118
  executables: []
119
119
  extensions: []
120
120
  extra_rdoc_files: []
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.5.1
143
+ rubygems_version: 2.6.8
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: chronic_cron
metadata.gz.sig CHANGED
Binary file