ci-helper 0.3.2 → 0.4.0
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/README.md +4 -0
- data/lib/ci_helper/commands/check_sidekiq_scheduler_config.rb +35 -0
- data/lib/ci_helper/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61e68cfd07a49efbe7edeedfd4bb579d5359caa0b6660bf00d6a6f8cd653226b
|
4
|
+
data.tar.gz: 915c87759e1da667c808d7136e4c3dc5fcf4be1ae81f3476b11b4b006542ecf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e8d5ecaa8724f9f44df8606ebd1be1d64fe010e8c5f27947ee5e320b43b782ec97baa0e52c82b51190fcb68ef184c0aaa98e08f0cc31a8a5f51087348626572
|
7
|
+
data.tar.gz: 5c48c38e8847e5a00d6b987a015d580ee1329b1fc32d9ba84963e677f59cff731eb08ffb6d90578277b82883c28bc7bb50484e129dff4de2445ffa59276925c1
|
data/README.md
CHANGED
@@ -70,6 +70,10 @@ List of available commands:
|
|
70
70
|
By default final coverage is calculated using result from `coverage/.resultset.json`.
|
71
71
|
* `--setup-file-path` — relative path to your `.rb` file, which setups `SimpleCov`.
|
72
72
|
Usually it is `spec_helper.rb`.
|
73
|
+
* **CheckSidekiqSchedulerConfig** — checks `sidekiq_scheduler` config by trying to resolve jobs constants via `rails runner`.
|
74
|
+
Accepted flags: `--config-path`
|
75
|
+
* `--config-path` — relative path to your config yaml file with schedule.
|
76
|
+
Usually it is `config/sidekiq_scheduler.yml`.
|
73
77
|
|
74
78
|
### Rake Tasks
|
75
79
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
module CIHelper
|
6
|
+
module Commands
|
7
|
+
class CheckSidekiqSchedulerConfig < BaseCommand
|
8
|
+
def call
|
9
|
+
return 0 if job_constants.empty?
|
10
|
+
|
11
|
+
cmd = craft_jobs_const_get_cmd
|
12
|
+
execute_with_rails_runner(cmd)
|
13
|
+
0
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def execute_with_rails_runner(cmd)
|
19
|
+
execute("bundle exec rails runner \"#{cmd}\"")
|
20
|
+
end
|
21
|
+
|
22
|
+
def craft_jobs_const_get_cmd
|
23
|
+
"#{job_constants}.each { |x| Object.const_get(x) }"
|
24
|
+
end
|
25
|
+
|
26
|
+
def job_constants
|
27
|
+
@job_constants ||= config.values.reject(&:nil?).flat_map(&:keys).uniq
|
28
|
+
end
|
29
|
+
|
30
|
+
def config
|
31
|
+
@config ||= YAML.load_file(options[:config_path])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/ci_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustAnotherDude
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/ci_helper/commands/check_coverage.rb
|
194
194
|
- lib/ci_helper/commands/check_db_development.rb
|
195
195
|
- lib/ci_helper/commands/check_db_rollback.rb
|
196
|
+
- lib/ci_helper/commands/check_sidekiq_scheduler_config.rb
|
196
197
|
- lib/ci_helper/commands/check_spec_suffixes.rb
|
197
198
|
- lib/ci_helper/commands/rubocop_lint.rb
|
198
199
|
- lib/ci_helper/commands/run_specs.rb
|