Scron::History
Inherits Reference < Object
Keeps track of the last time a command ran. When a command runs, update the timestamp with
Scron::History#touch. The entire history database can be written to a string with
Scron::History#to_s.
Constructors
new(text : String, now : Time)
Instantiates a new history. Example history format looks like:
2020-01-01.06:00 /path/to/command1
2020-02-05.22:15 /path/to/command2 arg1 arg2
Example usage:
Scron::History.new("2020-01-01.06:00 /path/to/command1")
Instance methods
touch(command)
Sets timestamp to current time. This method should be called whenever the command runs.