philiprehberger-cron_kit 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -0
- data/lib/philiprehberger/cron_kit/expression.rb +9 -0
- data/lib/philiprehberger/cron_kit/version.rb +1 -1
- data/lib/philiprehberger/cron_kit.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 572641da4c6142b108cd4a8afa600688b4959655980d60cfdcec4daf81e7392b
|
|
4
|
+
data.tar.gz: 9084dc4a9faa4f93442f5e3eac9dda386b58fe01c1d8b2d74dd52eb1d08db89a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2080702b376ec83e6079db2e8211bb037380355558c7308f3ab7dd53ab6f5a4716da533de5d7542354e773c73432307ebf66920fcba1eaa6209e51956a5252f5
|
|
7
|
+
data.tar.gz: '058da0b3d2c99826c89ca9b59f4bd5937c41a0edc577fe6275c0db50afb0797824315a9382a072b4152ad02ce3b4d5238110980bff81f9d1bb4add687f856aa1'
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-04-08
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Align gemspec summary with README description.
|
|
14
|
+
|
|
15
|
+
## [0.4.1] - 2026-04-07
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- `Philiprehberger::CronKit.valid?` and `Expression.valid?` predicates for non-raising expression validation
|
|
19
|
+
|
|
10
20
|
## [0.4.0] - 2026-04-05
|
|
11
21
|
|
|
12
22
|
### Added
|
data/README.md
CHANGED
|
@@ -195,6 +195,7 @@ scheduler.next_runs(from: Time.now)
|
|
|
195
195
|
| Method | Description |
|
|
196
196
|
|--------|-------------|
|
|
197
197
|
| `Philiprehberger::CronKit.parse(expression, timezone: nil)` | Parse a cron expression, returns `Expression` |
|
|
198
|
+
| `Philiprehberger::CronKit.valid?(expression, timezone: nil)` | Return true if the expression parses without error |
|
|
198
199
|
| `Philiprehberger::CronKit.new` | Create a new `Scheduler` |
|
|
199
200
|
| `Expression#match?(time)` | Check if a Time matches the expression |
|
|
200
201
|
| `Expression#next_at(from:)` | Find the next matching Time |
|
|
@@ -16,6 +16,15 @@ module Philiprehberger
|
|
|
16
16
|
|
|
17
17
|
attr_reader :raw, :timezone
|
|
18
18
|
|
|
19
|
+
# Return true if the given expression parses without error.
|
|
20
|
+
# Provides a non-raising alternative to rescuing `ParseError`.
|
|
21
|
+
def self.valid?(expression, timezone: nil)
|
|
22
|
+
new(expression, timezone: timezone)
|
|
23
|
+
true
|
|
24
|
+
rescue ParseError, ArgumentError
|
|
25
|
+
false
|
|
26
|
+
end
|
|
27
|
+
|
|
19
28
|
def initialize(expression, timezone: nil)
|
|
20
29
|
@raw = Aliases.expand(expression.to_s.strip)
|
|
21
30
|
@timezone = timezone
|
|
@@ -20,5 +20,11 @@ module Philiprehberger
|
|
|
20
20
|
def self.new
|
|
21
21
|
Scheduler.new
|
|
22
22
|
end
|
|
23
|
+
|
|
24
|
+
# Return true if the given string is a valid cron expression.
|
|
25
|
+
# Accepts the same syntax as `parse` (5-field expressions and aliases).
|
|
26
|
+
def self.valid?(expression, timezone: nil)
|
|
27
|
+
Expression.valid?(expression, timezone: timezone)
|
|
28
|
+
end
|
|
23
29
|
end
|
|
24
30
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: philiprehberger-cron_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Philip Rehberger
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A zero-dependency Ruby gem for parsing 5-field cron expressions and running
|
|
14
14
|
an in-process scheduler. Supports wildcards, ranges, steps, and lists.
|
|
@@ -56,5 +56,5 @@ requirements: []
|
|
|
56
56
|
rubygems_version: 3.5.22
|
|
57
57
|
signing_key:
|
|
58
58
|
specification_version: 4
|
|
59
|
-
summary: Cron expression parser and scheduler
|
|
59
|
+
summary: Cron expression parser and scheduler
|
|
60
60
|
test_files: []
|