philiprehberger-cron_parser 0.1.2 → 0.1.4
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 +22 -4
- data/lib/philiprehberger/cron_parser/expression.rb +1 -1
- data/lib/philiprehberger/cron_parser/field.rb +3 -3
- data/lib/philiprehberger/cron_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32817318714cb93a510d59bfae5592462669488da4ee176d3985d484889f48d7
|
|
4
|
+
data.tar.gz: ad3ebb67b51c6e6b93a1126779950b5097b04ba6c935d7c8406250c5f5637f4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04572d61d279af7901ad03bc56f041e0e0fc7083323b240639fb8fa4d3646ad340976c22051ed5e84a3d79471c63b8a39a983f245aa44ab276c2f88aeed0db6e
|
|
7
|
+
data.tar.gz: 61d578083cf566b3add7df47b14203d8c3ef6815128d89fd3cf2a86c1d952702168a085ae175f1b1f1d75d38c509d460bec09852366a6c9ded1ed4cb1c275bd4
|
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.1.4] - 2026-03-31
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Standardize README badges, support section, and license format
|
|
14
|
+
|
|
15
|
+
## [0.1.3] - 2026-03-24
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Remove inline comments from Development section to match template
|
|
19
|
+
|
|
10
20
|
## [0.1.2] - 2026-03-22
|
|
11
21
|
|
|
12
22
|
### Changed
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/philiprehberger/rb-cron-parser/actions/workflows/ci.yml)
|
|
4
4
|
[](https://rubygems.org/gems/philiprehberger-cron_parser)
|
|
5
|
-
[](https://github.com/philiprehberger/rb-cron-parser/commits/main)
|
|
6
6
|
|
|
7
7
|
Cron expression parser for calculating next and previous occurrences
|
|
8
8
|
|
|
@@ -83,10 +83,28 @@ Philiprehberger::CronParser.new('0 0 1 * *') # first of month
|
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
bundle install
|
|
86
|
-
bundle exec rspec
|
|
87
|
-
bundle exec rubocop
|
|
86
|
+
bundle exec rspec
|
|
87
|
+
bundle exec rubocop
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
## Support
|
|
91
|
+
|
|
92
|
+
If you find this project useful:
|
|
93
|
+
|
|
94
|
+
⭐ [Star the repo](https://github.com/philiprehberger/rb-cron-parser)
|
|
95
|
+
|
|
96
|
+
🐛 [Report issues](https://github.com/philiprehberger/rb-cron-parser/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
|
|
97
|
+
|
|
98
|
+
💡 [Suggest features](https://github.com/philiprehberger/rb-cron-parser/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)
|
|
99
|
+
|
|
100
|
+
❤️ [Sponsor development](https://github.com/sponsors/philiprehberger)
|
|
101
|
+
|
|
102
|
+
🌐 [All Open Source Projects](https://philiprehberger.com/open-source-packages)
|
|
103
|
+
|
|
104
|
+
💻 [GitHub Profile](https://github.com/philiprehberger)
|
|
105
|
+
|
|
106
|
+
🔗 [LinkedIn Profile](https://www.linkedin.com/in/philiprehberger)
|
|
107
|
+
|
|
90
108
|
## License
|
|
91
109
|
|
|
92
|
-
MIT
|
|
110
|
+
[MIT](LICENSE)
|
|
@@ -39,12 +39,12 @@ module Philiprehberger
|
|
|
39
39
|
case part
|
|
40
40
|
when '*'
|
|
41
41
|
(@min..@max).to_a
|
|
42
|
-
when
|
|
42
|
+
when %r{\A\*/(\d+)\z}
|
|
43
43
|
step = Regexp.last_match(1).to_i
|
|
44
44
|
raise Error, "Invalid step: #{step}" if step.zero?
|
|
45
45
|
|
|
46
46
|
(@min..@max).step(step).to_a
|
|
47
|
-
when
|
|
47
|
+
when %r{\A(\d+)-(\d+)(?:/(\d+))?\z}
|
|
48
48
|
range_start = Regexp.last_match(1).to_i
|
|
49
49
|
range_end = Regexp.last_match(2).to_i
|
|
50
50
|
step = Regexp.last_match(3)&.to_i || 1
|
|
@@ -68,7 +68,7 @@ module Philiprehberger
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def validate_value!(value)
|
|
71
|
-
return if value
|
|
71
|
+
return if value.between?(@min, @max)
|
|
72
72
|
|
|
73
73
|
raise Error, "Value #{value} out of range (#{@min}-#{@max})"
|
|
74
74
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: philiprehberger-cron_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
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-03-
|
|
11
|
+
date: 2026-03-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Parse standard 5-field cron expressions and calculate next/previous occurrences,
|
|
14
14
|
match times against patterns, and generate human-readable descriptions.
|