cron_format 0.2.3 → 0.3.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
  SHA1:
3
- metadata.gz: 8ebce971a3172e6d89ba2775731d78de3c474bed
4
- data.tar.gz: 0d4636996d9774e16ec0eada15006eaa2ae8f502
3
+ metadata.gz: c57e56c6118c71ec947e6e8b204594d8849e3293
4
+ data.tar.gz: a40f45eb9830c5adedc8bf115c42464189337564
5
5
  SHA512:
6
- metadata.gz: 5f1b7e3d60615e556b7f243d39e59c46f967818833adf72a934faf7311d4ed03bc52d4f47d34bb7d44812622ad81549f4d79017d0c70fd56133e100cd774745c
7
- data.tar.gz: 24352852a4e28e5145b7fceac40d7eb698c41a8a0cc76246ec7724ff2ceac36b2e49a931fb98815926abbcf6c2016f000a71692f5a5a97ffb0a9fc6bd1f77764
6
+ metadata.gz: b8cf6fbc415bed166afe1c8b9373633eeb8134a07b66fe06de1e09303b53c5856d010fc378c46faa62eeb0c2f9384f1d6c22d15998acbb98d0e49cc0e997d42e
7
+ data.tar.gz: 2ba604ae1fb8ba9c56cc42112895f72e308092d861f01f847a15957ceaca7c5e9a133206b9f92afcbaf1d51ceac0bfaedd3942fd6fb378dabf4cf2f4f896869a
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- !֑�i[�@� +��$�=j
2
- ��>��y!�#���NY�%:�O@�:��7m��By�oT{���吩ͷ��+�
1
+ _�K�8���هv[8tg�����dO7�E��S�Z���'�0���pu��N����okDk<�ls
2
+ ҡ�c<�=���j��" ��=���p` W�\�`W ���6�s�/:��� �[~d/%aB8EH�Rؑ�� tt5W��SI��`�P؉�
data.tar.gz.sig CHANGED
Binary file
data/lib/cron_format.rb CHANGED
@@ -34,8 +34,8 @@ class CronFormat
34
34
 
35
35
  a = @cron_string.split
36
36
 
37
- val = if @cron_string =~ %r{/} then
38
- a.reverse.detect{|x| x[/\//]}
37
+ val = if @cron_string =~ %r{[/,]} then
38
+ a.reverse.detect{|x| x[/[\/,]/]}
39
39
  else
40
40
  a.detect{|x| x != '*'}
41
41
  end
@@ -45,12 +45,19 @@ class CronFormat
45
45
  if val then
46
46
  index = a.index(val)
47
47
 
48
- r = val[/\/(\d+)$/,1]
48
+ r = val[/,|\/(\d+)$/,1]
49
49
 
50
50
  n = if r then
51
+
51
52
  index == 4 ? r.to_i * 7 : 0
53
+
52
54
  else
53
- val.to_i
55
+
56
+ if val =~ /,/ then
57
+ 1
58
+ else
59
+ val.to_i
60
+ end
54
61
  end
55
62
  end
56
63
 
@@ -74,6 +81,7 @@ class CronFormat
74
81
  ]
75
82
 
76
83
  r = units[index].call @to_time, n
84
+
77
85
  @to_time = r
78
86
 
79
87
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cron_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  MmJuAQVfTk9wZd03YN619a64hLGIvud4ASW7UVAW0B4U0PcmbhHvne07e11jt7j5
32
32
  WwVcDIvT38Bo3hAt
33
33
  -----END CERTIFICATE-----
34
- date: 2015-03-04 00:00:00.000000000 Z
34
+ date: 2015-03-11 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
metadata.gz.sig CHANGED
Binary file