chronic_cron 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. data/lib/chronic_cron.rb +3 -3
  2. metadata +2 -2
data/lib/chronic_cron.rb CHANGED
@@ -23,9 +23,9 @@ class ChronicCron
23
23
  day.to_i <= last_day.day
24
24
  end
25
25
 
26
- def self.parse(s)
26
+ def self.parse(object)
27
27
 
28
- raw_a = s.split
28
+ raw_a = object.is_a?(String) ? object.split : object
29
29
  raw_a << '*' if raw_a.length <= 5 # add the year?
30
30
 
31
31
  units = Time.now.to_a.values_at(1..4) + [nil, Time.now.year]
@@ -40,7 +40,7 @@ class ChronicCron
40
40
  Time.parse("%s-%s-%s %s:%s" % date.reverse)},
41
41
  year: lambda{|x, interval|
42
42
  date = x.to_a.values_at(1..5)
43
- interfval.times { date[4].succ! }
43
+ interval.times { date[4].succ! }
44
44
  Time.parse("%s-%s-%s %s:%s" % date.reverse)}
45
45
  }
46
46
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: chronic_cron
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors: []
8
8
 
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-24 00:00:00 +01:00
13
+ date: 2011-04-25 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies: []
16
16