/cron-expression-parser

CRON expression parser tech test

Primary LanguageRuby

CRON expression parser

How to use this parser

  1. Clone or download this repo
  2. > bundle

Parsing expressions:

Run this program in your command line passing your expression as a single string, like so:

> ruby lib/app.rb '*/15 0 1,15 * 1-5 /usr/bin/find'

The above command should give you the following output:

Screenshot 2021-06-12 at 19 07 32

How to run specs

> rspec

Screenshot 2021-06-12 at 19 07 23

Lint with

> rubocop

TODO

  • handle all the fields processing for input '*/15 0 1,15 * 1-5 /usr/bin/find'
  • add handling of other input formats
  • run the CLI from a separate file that calls the parser
  • add error handling
    • exception for completely incorrect inputs
    • exception for illegal 0s