cron_to_go_sync 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -6
- data/.github/workflows/release.yml +2 -2
- data/.pre-commit-config.yaml +2 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +67 -56
- data/lib/cron_to_go_sync/parser.rb +2 -1
- data/lib/cron_to_go_sync/version.rb +1 -1
- data/spec/parser_spec.rb +16 -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: bafcac59f207b83fb56b794ebf4fe8a91a90abe4c91f3de573d8501b36fccc93
|
4
|
+
data.tar.gz: 66fa54377bf9a20cd5692918edd83698ccdfa89e9d805915b4eecf79040d0c0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 787bd39026c34fd5b7762e05d4476db86b64f8840cb48b9a0eeb49bec0506463d24f32763a37ef18f3bd8eb51f5f7269f8acd29496147f35ba80d288a9dbde6f
|
7
|
+
data.tar.gz: 2e9710b47ab66b8f2789929d981757da7ec69378e735b753ce4de069710cccecdd701639f5a9918bac6e788b78fc195f178c2a74d7775b5b25ca0e09f551e9c3
|
data/.github/workflows/ci.yml
CHANGED
@@ -21,9 +21,9 @@ jobs:
|
|
21
21
|
ruby: ["3.0", "3.1", "3.2"]
|
22
22
|
steps:
|
23
23
|
- name: Checkout code
|
24
|
-
uses: actions/checkout@
|
24
|
+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
25
25
|
- name: Install Ruby and gems
|
26
|
-
uses: ruby/setup-ruby@
|
26
|
+
uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b
|
27
27
|
with:
|
28
28
|
bundler-cache: true
|
29
29
|
ruby-version: ${{ matrix.ruby }}
|
@@ -37,17 +37,17 @@ jobs:
|
|
37
37
|
contents: read
|
38
38
|
steps:
|
39
39
|
- name: Checkout code
|
40
|
-
uses: actions/checkout@
|
40
|
+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
41
41
|
- name: Install Ruby and gems
|
42
|
-
uses: ruby/setup-ruby@
|
42
|
+
uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b
|
43
43
|
with:
|
44
44
|
bundler-cache: true
|
45
45
|
ruby-version: "3.2"
|
46
46
|
- name: Bundle Audit Check
|
47
47
|
run: bundle exec bundle-audit update && bundle exec bundle-audit check
|
48
48
|
- name: Setup Python
|
49
|
-
uses: actions/setup-python@
|
49
|
+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
|
50
50
|
with:
|
51
51
|
python-version: "3.10"
|
52
52
|
- name: Run pre-commit
|
53
|
-
uses: pre-commit/action@
|
53
|
+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
|
@@ -7,9 +7,9 @@ jobs:
|
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
steps:
|
9
9
|
- name: Checkout code
|
10
|
-
uses: actions/checkout@
|
10
|
+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
11
11
|
- name: Install Ruby and gems
|
12
|
-
uses: ruby/setup-ruby@
|
12
|
+
uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b
|
13
13
|
with:
|
14
14
|
bundler-cache: true
|
15
15
|
ruby-version: "3.2"
|
data/.pre-commit-config.yaml
CHANGED
@@ -12,7 +12,7 @@ repos:
|
|
12
12
|
exclude: '^spec/data/'
|
13
13
|
- id: check-merge-conflict
|
14
14
|
- repo: https://github.com/rubocop/rubocop.git
|
15
|
-
rev: '
|
15
|
+
rev: '24e7411d9606fd064e720ecb65a965646b6f8a06'
|
16
16
|
hooks:
|
17
17
|
- id: rubocop
|
18
|
-
additional_dependencies: ["standard:1.
|
18
|
+
additional_dependencies: ["standard:1.31.0"]
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -6,9 +6,9 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
group :development, :test do
|
9
|
-
gem "rspec", "~> 3.
|
9
|
+
gem "rspec", "~> 3.13"
|
10
10
|
gem "rspec-its", "~>1.3"
|
11
|
-
gem "standard", "~> 1.
|
11
|
+
gem "standard", "~> 1.35.1"
|
12
12
|
gem "pry", "~> 0.14"
|
13
13
|
gem "webmock", "~> 3"
|
14
14
|
gem "vcr", "~> 6"
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cron_to_go_sync (0.0.
|
4
|
+
cron_to_go_sync (0.0.3)
|
5
5
|
activesupport
|
6
6
|
dry-types
|
7
7
|
dry-validation
|
@@ -15,14 +15,15 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
-
activesupport (7.0.
|
18
|
+
activesupport (7.0.7.2)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 1.6, < 2)
|
21
21
|
minitest (>= 5.1)
|
22
22
|
tzinfo (~> 2.0)
|
23
|
-
addressable (2.8.
|
23
|
+
addressable (2.8.6)
|
24
24
|
public_suffix (>= 2.0.2, < 6.0)
|
25
25
|
ast (2.4.2)
|
26
|
+
bigdecimal (3.1.6)
|
26
27
|
bundle-audit (0.1.0)
|
27
28
|
bundler-audit
|
28
29
|
bundler-audit (0.9.1)
|
@@ -31,13 +32,14 @@ GEM
|
|
31
32
|
citrus (3.0.2)
|
32
33
|
coderay (1.1.3)
|
33
34
|
concurrent-ruby (1.2.2)
|
34
|
-
crack (0.
|
35
|
+
crack (1.0.0)
|
36
|
+
bigdecimal
|
35
37
|
rexml
|
36
|
-
diff-lcs (1.5.
|
38
|
+
diff-lcs (1.5.1)
|
37
39
|
dry-configurable (1.0.1)
|
38
40
|
dry-core (~> 1.0, < 2)
|
39
41
|
zeitwerk (~> 2.6)
|
40
|
-
dry-core (1.0.
|
42
|
+
dry-core (1.0.1)
|
41
43
|
concurrent-ruby (~> 1.0)
|
42
44
|
zeitwerk (~> 2.6)
|
43
45
|
dry-inflector (1.0.0)
|
@@ -54,7 +56,8 @@ GEM
|
|
54
56
|
dry-logic (>= 1.4, < 2)
|
55
57
|
dry-types (>= 1.7, < 2)
|
56
58
|
zeitwerk (~> 2.6)
|
57
|
-
dry-types (1.7.
|
59
|
+
dry-types (1.7.2)
|
60
|
+
bigdecimal (~> 3.0)
|
58
61
|
concurrent-ruby (~> 1.0)
|
59
62
|
dry-core (~> 1.0)
|
60
63
|
dry-inflector (~> 1.0)
|
@@ -66,104 +69,112 @@ GEM
|
|
66
69
|
dry-initializer (~> 3.0)
|
67
70
|
dry-schema (>= 1.12, < 2)
|
68
71
|
zeitwerk (~> 2.6)
|
69
|
-
faraday (2.
|
70
|
-
faraday-net_http (>= 2.0, < 3.
|
71
|
-
ruby2_keywords (>= 0.0.4)
|
72
|
+
faraday (2.9.0)
|
73
|
+
faraday-net_http (>= 2.0, < 3.2)
|
72
74
|
faraday-follow_redirects (0.3.0)
|
73
75
|
faraday (>= 1, < 3)
|
74
|
-
faraday-net_http (3.0
|
75
|
-
|
76
|
+
faraday-net_http (3.1.0)
|
77
|
+
net-http
|
78
|
+
faraday-retry (2.2.1)
|
76
79
|
faraday (~> 2.0)
|
77
|
-
hashdiff (1.0
|
78
|
-
i18n (1.
|
80
|
+
hashdiff (1.1.0)
|
81
|
+
i18n (1.14.1)
|
79
82
|
concurrent-ruby (~> 1.0)
|
80
83
|
interactor (3.1.2)
|
81
84
|
interactor-contracts (0.3.0)
|
82
85
|
dry-validation (~> 1.0)
|
83
86
|
interactor (~> 3)
|
84
|
-
json (2.
|
87
|
+
json (2.7.1)
|
85
88
|
language_server-protocol (3.17.0.3)
|
86
|
-
lint_roller (1.
|
89
|
+
lint_roller (1.1.0)
|
87
90
|
method_source (1.0.0)
|
88
|
-
minitest (5.
|
89
|
-
|
90
|
-
|
91
|
+
minitest (5.19.0)
|
92
|
+
net-http (0.4.1)
|
93
|
+
uri
|
94
|
+
parallel (1.24.0)
|
95
|
+
parser (3.3.0.5)
|
91
96
|
ast (~> 2.4.1)
|
97
|
+
racc
|
92
98
|
pry (0.14.2)
|
93
99
|
coderay (~> 1.1)
|
94
100
|
method_source (~> 1.0)
|
95
|
-
public_suffix (5.0.
|
101
|
+
public_suffix (5.0.4)
|
102
|
+
racc (1.7.3)
|
96
103
|
rainbow (3.1.1)
|
97
|
-
regexp_parser (2.
|
98
|
-
rexml (3.2.
|
99
|
-
rspec (3.
|
100
|
-
rspec-core (~> 3.
|
101
|
-
rspec-expectations (~> 3.
|
102
|
-
rspec-mocks (~> 3.
|
103
|
-
rspec-core (3.
|
104
|
-
rspec-support (~> 3.
|
105
|
-
rspec-expectations (3.
|
104
|
+
regexp_parser (2.9.0)
|
105
|
+
rexml (3.2.6)
|
106
|
+
rspec (3.13.0)
|
107
|
+
rspec-core (~> 3.13.0)
|
108
|
+
rspec-expectations (~> 3.13.0)
|
109
|
+
rspec-mocks (~> 3.13.0)
|
110
|
+
rspec-core (3.13.0)
|
111
|
+
rspec-support (~> 3.13.0)
|
112
|
+
rspec-expectations (3.13.0)
|
106
113
|
diff-lcs (>= 1.2.0, < 2.0)
|
107
|
-
rspec-support (~> 3.
|
114
|
+
rspec-support (~> 3.13.0)
|
108
115
|
rspec-its (1.3.0)
|
109
116
|
rspec-core (>= 3.0.0)
|
110
117
|
rspec-expectations (>= 3.0.0)
|
111
|
-
rspec-mocks (3.
|
118
|
+
rspec-mocks (3.13.0)
|
112
119
|
diff-lcs (>= 1.2.0, < 2.0)
|
113
|
-
rspec-support (~> 3.
|
114
|
-
rspec-support (3.
|
115
|
-
rubocop (1.
|
120
|
+
rspec-support (~> 3.13.0)
|
121
|
+
rspec-support (3.13.0)
|
122
|
+
rubocop (1.62.1)
|
116
123
|
json (~> 2.3)
|
124
|
+
language_server-protocol (>= 3.17.0)
|
117
125
|
parallel (~> 1.10)
|
118
|
-
parser (>= 3.
|
126
|
+
parser (>= 3.3.0.2)
|
119
127
|
rainbow (>= 2.2.2, < 4.0)
|
120
128
|
regexp_parser (>= 1.8, < 3.0)
|
121
129
|
rexml (>= 3.2.5, < 4.0)
|
122
|
-
rubocop-ast (>= 1.
|
130
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
123
131
|
ruby-progressbar (~> 1.7)
|
124
132
|
unicode-display_width (>= 2.4.0, < 3.0)
|
125
|
-
rubocop-ast (1.
|
126
|
-
parser (>= 3.
|
127
|
-
rubocop-performance (1.
|
128
|
-
rubocop (>= 1.
|
129
|
-
rubocop-ast (>=
|
133
|
+
rubocop-ast (1.31.2)
|
134
|
+
parser (>= 3.3.0.4)
|
135
|
+
rubocop-performance (1.20.2)
|
136
|
+
rubocop (>= 1.48.1, < 2.0)
|
137
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
130
138
|
ruby-progressbar (1.13.0)
|
131
|
-
|
132
|
-
standard (1.29.0)
|
139
|
+
standard (1.35.1)
|
133
140
|
language_server-protocol (~> 3.17.0.2)
|
134
141
|
lint_roller (~> 1.0)
|
135
|
-
rubocop (~> 1.
|
142
|
+
rubocop (~> 1.62.0)
|
136
143
|
standard-custom (~> 1.0.0)
|
137
|
-
standard-performance (~> 1.
|
138
|
-
standard-custom (1.0.
|
144
|
+
standard-performance (~> 1.3)
|
145
|
+
standard-custom (1.0.2)
|
139
146
|
lint_roller (~> 1.0)
|
140
|
-
|
141
|
-
|
142
|
-
|
147
|
+
rubocop (~> 1.50)
|
148
|
+
standard-performance (1.3.1)
|
149
|
+
lint_roller (~> 1.1)
|
150
|
+
rubocop-performance (~> 1.20.2)
|
143
151
|
thor (1.2.2)
|
144
|
-
toml-rb (
|
152
|
+
toml-rb (3.0.1)
|
145
153
|
citrus (~> 3.0, > 3.0)
|
154
|
+
racc (~> 1.7)
|
146
155
|
tzinfo (2.0.6)
|
147
156
|
concurrent-ruby (~> 1.0)
|
148
|
-
unicode-display_width (2.
|
149
|
-
|
150
|
-
|
157
|
+
unicode-display_width (2.5.0)
|
158
|
+
uri (0.13.0)
|
159
|
+
vcr (6.2.0)
|
160
|
+
webmock (3.23.0)
|
151
161
|
addressable (>= 2.8.0)
|
152
162
|
crack (>= 0.3.2)
|
153
163
|
hashdiff (>= 0.4.0, < 2.0.0)
|
154
|
-
zeitwerk (2.6.
|
164
|
+
zeitwerk (2.6.12)
|
155
165
|
|
156
166
|
PLATFORMS
|
157
167
|
arm64-darwin-22
|
168
|
+
arm64-darwin-23
|
158
169
|
x86_64-linux
|
159
170
|
|
160
171
|
DEPENDENCIES
|
161
172
|
bundle-audit (~> 0.1.0)
|
162
173
|
cron_to_go_sync!
|
163
174
|
pry (~> 0.14)
|
164
|
-
rspec (~> 3.
|
175
|
+
rspec (~> 3.13)
|
165
176
|
rspec-its (~> 1.3)
|
166
|
-
standard (~> 1.
|
177
|
+
standard (~> 1.35.1)
|
167
178
|
vcr (~> 6)
|
168
179
|
webmock (~> 3)
|
169
180
|
|
@@ -68,7 +68,8 @@ module CronToGoSync
|
|
68
68
|
lower = lower.to_i
|
69
69
|
upper = upper.to_i
|
70
70
|
return "invalid range lower #{lower}" if lower < lower_limit || lower > upper_limit
|
71
|
-
return "invalid range upper #{upper}" if upper <
|
71
|
+
return "invalid range upper #{upper}" if upper < lower_limit || upper > upper_limit
|
72
|
+
return "range not in order" if upper <= lower
|
72
73
|
elsif !range.match?(/\A[0-9]+\z/)
|
73
74
|
return "invalid range value #{range}"
|
74
75
|
else
|
data/spec/parser_spec.rb
CHANGED
@@ -30,5 +30,21 @@ RSpec.describe CronToGoSync::Parser do
|
|
30
30
|
input_hash = {"job_name" => {schedule: "*/99 * * * *", enabled: true, ttl: 86400, dyno_size: "Basic", command: "/bin/true"}}
|
31
31
|
expect { described_class.parse_hash(input_hash) }.to raise_error(RuntimeError, /invalid denominator value/)
|
32
32
|
end
|
33
|
+
|
34
|
+
it "validates schedule range" do
|
35
|
+
input_hash = {"job_name" => {schedule: "* * * * 1-5", enabled: true, ttl: 86400, dyno_size: "Basic", command: "/bin/true"}}
|
36
|
+
parsed = described_class.parse_hash(input_hash)
|
37
|
+
expect(parsed["job_name"][:schedule]).to eq "* * * * 1-5"
|
38
|
+
end
|
39
|
+
|
40
|
+
it "validates schedule range values" do
|
41
|
+
input_hash = {"job_name" => {schedule: "* * * * 1-9", enabled: true, ttl: 86400, dyno_size: "Basic", command: "/bin/true"}}
|
42
|
+
expect { described_class.parse_hash(input_hash) }.to raise_error(RuntimeError, /invalid range upper/)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "validates schedule range order" do
|
46
|
+
input_hash = {"job_name" => {schedule: "* * * * 5-1", enabled: true, ttl: 86400, dyno_size: "Basic", command: "/bin/true"}}
|
47
|
+
expect { described_class.parse_hash(input_hash) }.to raise_error(RuntimeError, /range not in order/)
|
48
|
+
end
|
33
49
|
end
|
34
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cron_to_go_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instrumentl, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
|
-
rubygems_version: 3.4.
|
199
|
+
rubygems_version: 3.4.19
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: CronToGo configuration syncing library
|