ci-helper 0.3.2 → 0.4.0

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: 01b88f245129abe666d9e52f64a749f4f8a03cd831f2896cd76bb55447d6deac
4
- data.tar.gz: c26bf42cfa1630fb7bc8926c187b4a4b19d7b16efdc584aeea087bcee8016bc0
3
+ metadata.gz: 61e68cfd07a49efbe7edeedfd4bb579d5359caa0b6660bf00d6a6f8cd653226b
4
+ data.tar.gz: 915c87759e1da667c808d7136e4c3dc5fcf4be1ae81f3476b11b4b006542ecf2
5
5
  SHA512:
6
- metadata.gz: 93c3507199dacbd55ce9d2f3076117df7005f3bacee604c3a1fe14521f47b0194acf5fe5c778c5159221a3e0c856dfcfb062a200f49c2206147e550186cb5663
7
- data.tar.gz: e3257ec1a7df016bbbe195a9ae9b9cde553745041995b8588999f6cab26ae01f53b0f9e278a5f0912bb559ffed0010d29b90d829036649b072f845ec24a9c513
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CIHelper
4
- VERSION = "0.3.2"
4
+ VERSION = "0.4.0"
5
5
  end
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.3.2
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-10-16 00:00:00.000000000 Z
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