Project

whedon

0.01
No commit activity in last 3 years
No release in over 3 years
Parses cron lines into a Schedule instance that can be queried.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 3.5.0

Runtime

>= 0
 Project Readme

whedon - parse crontab syntax

The goal of this gem is to parse a crontab timing specification and produce an object that can be queried about the schedule.

This gem began as an extraction of Rufus::CronLine from the rufus-scheduler gem.

Build Status

API example

sch = Whedon::Schedule.new('30 * * * *')

# Most Recent
sch.last

# Upcoming
sch.next

# Next after date/time argument
sch.next("2020/07/01")

# Given date/time matches cron string
sch.matches?("2020/07/01 14:00:00")

# Time.now matches cron string
sch.now?

# Give cron string represented as an array
# [seconds minutes hours days months weekdays monthdays timezone]
sch.to_a

And ... the Name?

Why 'whedon' ? First, when was taken. I was considering variations on 'when do', & it occurred to me that 'whedon' (a la Joss Whedon) was an obvious anagram of 'when do'. The pun regarding Whedon::Schedule being that Joss Whedon's television series tend to get pulled from the network schedule.

License

MIT. See LICENSE.