Last active
November 2, 2024 20:19
-
-
Save apainintheneck/8dc5929355328f2d4fbde2397e5a5b0e to your computer and use it in GitHub Desktop.
A simple cli wrapper around the `cronex` gem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
if ARGV.size != 1 | |
puts "usage: cronex [cron line]" | |
exit 1 | |
end | |
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "cronex" | |
end | |
begin | |
puts Cronex::ExpressionDescriptor.new(ARGV.first).description | |
rescue => e | |
puts "error: invalid cron line syntax" | |
puts "message: #{e.message}" | |
exit 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment