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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d531bd7e71a0daf06b61250a3059ce01bd1f6172febf2d1a11a706cfaff19ae9
4
- data.tar.gz: e9ba16ef0e196bea211fb25bbce57e21a15da013efa053fde0c094d5fe151116
3
+ metadata.gz: bafcac59f207b83fb56b794ebf4fe8a91a90abe4c91f3de573d8501b36fccc93
4
+ data.tar.gz: 66fa54377bf9a20cd5692918edd83698ccdfa89e9d805915b4eecf79040d0c0e
5
5
  SHA512:
6
- metadata.gz: 8f9cf851644bf65f09df48a26271e5d388946111e727ae4dd9bff690e558082e90de481231a6ab1ddb8a3f4b0dec9dc0762d6e3bdbb597e06141c295ef3aaf3d
7
- data.tar.gz: eced56243c7204cd445166e0dbeca2612c6e4c608c2b97746352af48f0142eab1e7440dee4070650bf312ece41ef04cd1d4a607d81ac1a6e8a09844a61ae90d7
6
+ metadata.gz: 787bd39026c34fd5b7762e05d4476db86b64f8840cb48b9a0eeb49bec0506463d24f32763a37ef18f3bd8eb51f5f7269f8acd29496147f35ba80d288a9dbde6f
7
+ data.tar.gz: 2e9710b47ab66b8f2789929d981757da7ec69378e735b753ce4de069710cccecdd701639f5a9918bac6e788b78fc195f178c2a74d7775b5b25ca0e09f551e9c3
@@ -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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
24
+ uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
25
25
  - name: Install Ruby and gems
26
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
40
+ uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
41
41
  - name: Install Ruby and gems
42
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
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@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
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@5f528da5c95691c4cf42ff76a4d10854b62cbb82
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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
10
+ uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
11
11
  - name: Install Ruby and gems
12
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
12
+ uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b
13
13
  with:
14
14
  bundler-cache: true
15
15
  ruby-version: "3.2"
@@ -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: '675114c1b5a1999a112f8adaad8c99f8de6f7bcc'
15
+ rev: '24e7411d9606fd064e720ecb65a965646b6f8a06'
16
16
  hooks:
17
17
  - id: rubocop
18
- additional_dependencies: ["standard:1.25.3"]
18
+ additional_dependencies: ["standard:1.31.0"]
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.3
2
+ -----
3
+ - Fix validator for ranges (e.g., `1-5`)
4
+
1
5
  0.0.2
2
6
  -----
3
7
  - Do not allow "7" in a day-of-week block to represent Sunday (CronToGo only allows "0")
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.0"
9
+ gem "rspec", "~> 3.13"
10
10
  gem "rspec-its", "~>1.3"
11
- gem "standard", "~> 1.29.0"
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.2)
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.5)
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.4)
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.4.5)
35
+ crack (1.0.0)
36
+ bigdecimal
35
37
  rexml
36
- diff-lcs (1.5.0)
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.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.1)
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.7.6)
70
- faraday-net_http (>= 2.0, < 3.1)
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.2)
75
- faraday-retry (2.2.0)
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.1)
78
- i18n (1.13.0)
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.6.3)
87
+ json (2.7.1)
85
88
  language_server-protocol (3.17.0.3)
86
- lint_roller (1.0.0)
89
+ lint_roller (1.1.0)
87
90
  method_source (1.0.0)
88
- minitest (5.18.0)
89
- parallel (1.23.0)
90
- parser (3.2.2.1)
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.1)
101
+ public_suffix (5.0.4)
102
+ racc (1.7.3)
96
103
  rainbow (3.1.1)
97
- regexp_parser (2.8.0)
98
- rexml (3.2.5)
99
- rspec (3.12.0)
100
- rspec-core (~> 3.12.0)
101
- rspec-expectations (~> 3.12.0)
102
- rspec-mocks (~> 3.12.0)
103
- rspec-core (3.12.2)
104
- rspec-support (~> 3.12.0)
105
- rspec-expectations (3.12.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.12.0)
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.12.5)
118
+ rspec-mocks (3.13.0)
112
119
  diff-lcs (>= 1.2.0, < 2.0)
113
- rspec-support (~> 3.12.0)
114
- rspec-support (3.12.0)
115
- rubocop (1.52.0)
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.2.0.0)
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.28.0, < 2.0)
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.29.0)
126
- parser (>= 3.2.1.0)
127
- rubocop-performance (1.18.0)
128
- rubocop (>= 1.7.0, < 2.0)
129
- rubocop-ast (>= 0.4.0)
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
- ruby2_keywords (0.0.5)
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.52.0)
142
+ rubocop (~> 1.62.0)
136
143
  standard-custom (~> 1.0.0)
137
- standard-performance (~> 1.1.0)
138
- standard-custom (1.0.1)
144
+ standard-performance (~> 1.3)
145
+ standard-custom (1.0.2)
139
146
  lint_roller (~> 1.0)
140
- standard-performance (1.1.0)
141
- lint_roller (~> 1.0)
142
- rubocop-performance (~> 1.18.0)
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 (2.2.0)
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.4.2)
149
- vcr (6.1.0)
150
- webmock (3.18.1)
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.8)
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.0)
175
+ rspec (~> 3.13)
165
176
  rspec-its (~> 1.3)
166
- standard (~> 1.29.0)
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 < upper_limit || upper > upper_limit
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
@@ -1,3 +1,3 @@
1
1
  module CronToGoSync
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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: 2023-06-09 00:00:00.000000000 Z
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.10
199
+ rubygems_version: 3.4.19
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: CronToGo configuration syncing library