cronex 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +20 -0
- data/.travis.yml +1 -2
- data/CHANGELOG.md +3 -0
- data/README.md +6 -1
- data/lib/cronex/exp_descriptor.rb +1 -0
- data/lib/cronex/parser.rb +1 -0
- data/lib/cronex/version.rb +1 -1
- data/spec/exp_descriptor_en_spec.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27e7637c0b490441441238824af2bd3a54c6f263e88acc9490ee20190c852258
|
4
|
+
data.tar.gz: bc2e41a12f8a15f21d50cffa2fef998647b8cc7e3429e2b4b5b7297d83d02c02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a73574bad6da9bfa391897a9a34f86ec3353718406da131faaa2af8f7b63a5f6f7694a45f67f47b24ff352179798c9342e21966f9104ed423c00dae41e144539
|
7
|
+
data.tar.gz: '081dbbc263ed70ab9f6f514f3359f17df56c270ff1eea91a72b197426c31b6403bd10d4020e7289b6b9f7cc64069714d3decd1e43481e6a6384ec0601472169f'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Test
|
3
|
+
|
4
|
+
on: [push, pull_request]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby-version: [2.5, 2.6, 2.7]
|
12
|
+
name: Ruby ${{ matrix.ruby-version }}
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Setup Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby-version }}
|
19
|
+
- run: bundle install
|
20
|
+
- run: bundle exec rake
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Cronex
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/cronex.svg)](https://badge.fury.io/rb/cronex)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/alpinweis/cronex/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/alpinweis/cronex/actions/workflows/test.yml?query=branch%3Amaster)
|
5
5
|
|
6
6
|
A Ruby library that converts cron expressions into human readable strings.
|
7
7
|
Translated to Ruby from [cron-expression-descriptor](https://github.com/bradyholt/cron-expression-descriptor) (C#) via
|
@@ -70,6 +70,11 @@ Or install it yourself as:
|
|
70
70
|
=> Every minute between 4:00 AM and 4:10 AM # PDT or
|
71
71
|
=> Every minute between 3:00 AM and 3:10 AM # PST
|
72
72
|
|
73
|
+
### Strict quartz-scheduler implementation support
|
74
|
+
|
75
|
+
Cronex::ExpressionDescriptor.new('* * * * *', strict_quartz: true).description
|
76
|
+
=> Cronex::ExpressionError (Error: Expression only has 5 parts. For 'strict_quartz' option, at least 6 parts are required)
|
77
|
+
|
73
78
|
See spec tests for more examples.
|
74
79
|
|
75
80
|
### Contributing
|
data/lib/cronex/parser.rb
CHANGED
@@ -27,6 +27,7 @@ module Cronex
|
|
27
27
|
if len < 5
|
28
28
|
fail ExpressionError, "Error: Expression only has #{len} parts. At least 5 parts are required"
|
29
29
|
elsif len == 5
|
30
|
+
fail ExpressionError, "Error: Expression only has 5 parts. For 'strict_quartz' option, at least 6 parts are required" if options[:strict_quartz]
|
30
31
|
# 5 part CRON so shift array past seconds element
|
31
32
|
parsed_parts.insert(1, *parts)
|
32
33
|
elsif len == 6
|
data/lib/cronex/version.rb
CHANGED
@@ -390,6 +390,12 @@ module Cronex
|
|
390
390
|
end
|
391
391
|
end
|
392
392
|
|
393
|
+
context 'strict_quartz' do
|
394
|
+
it '5 part cron fails' do
|
395
|
+
expect { desc('* * * * *', strict_quartz: true) }.to raise_error(Cronex::ExpressionError)
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
393
399
|
context 'timezone' do
|
394
400
|
it 'minute span' do
|
395
401
|
tz = TZInfo::Timezone.get('America/Los_Angeles')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Kazaku
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -87,6 +87,7 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/test.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
93
|
- ".rubocop.yml"
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
- !ruby/object:Gem::Version
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.1.4
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: Ruby library that converts cron expressions into human readable strings
|