sidekiq-belt 0.3.1 → 0.3.2

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: c5e4649a97ccde536e22d2449ec678ccde0b955c0788c223fecd16487e7e9880
4
- data.tar.gz: 690b2b57d00bba771275d7143c2104f9b139fc2b883600bf4a95bfbd8b6591b5
3
+ metadata.gz: e1d58a367e0ec0d41fb826a95a5b61cc59c6431fd5d50f235786cb3521e1ac69
4
+ data.tar.gz: 2cf1947d6e5ca5b54fe9989ec5a30e09923474412bce3d65475a13aa693d29fd
5
5
  SHA512:
6
- metadata.gz: dd3e644e8fb40e12809cd5de2744640a46df7695ad2146d7333ac09a7bcc3460168a23ff891d0e60b54fed06986240242f816f2e344d45fc86ead4c9399e350b
7
- data.tar.gz: 61dc37a8dd5f5e3b29d7410275b3c2776063ac6e2944a72b01619cbb713e8c24d55dbf21c301781865cc9b8b030d7278d1e521e115742b1d6938fc103d65d377
6
+ metadata.gz: 8f8b2a0e54438fc416a638c3de38bcdccd187eea0363863d33ec04a2aa97dfc97983548445ab1f7f15148837123dccdad11cc47274ac59287e473c1223189b78
7
+ data.tar.gz: 6467a245b671d70c33b759b579f1ea12d4adf48c0bde494979e39d8c6663468859fc147f9f9add16ac967a9249e3ae6ac50476078fb59629167a14d5aeffa610
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.2] - 2024-01-07
4
+
5
+ - Feature to sort periodic list by class name
6
+
3
7
  ## [0.3.1] - 2023-11-01
4
8
 
5
9
  - Added style to pause button
@@ -4,6 +4,7 @@ require "sidekiq"
4
4
 
5
5
  require_relative "periodic_pause"
6
6
  require_relative "periodic_run"
7
+ require_relative "periodic_sort"
7
8
 
8
9
  module Sidekiq
9
10
  module Belt
@@ -12,13 +13,16 @@ module Sidekiq
12
13
  def self.use!(options = [:all])
13
14
  return unless Sidekiq.ent?
14
15
 
15
- all = options.include?(:all)
16
-
17
- Sidekiq::Belt::Ent::PeriodicPause.use! if all || options.include?(:periodic_pause)
18
- Sidekiq::Belt::Ent::PeriodicRun.use! if all || options.include?(:periodic_run)
16
+ Sidekiq::Belt::Ent::PeriodicPause.use! if should_use?(:periodic_pause, options)
17
+ Sidekiq::Belt::Ent::PeriodicRun.use! if should_use?(:periodic_run, options)
18
+ Sidekiq::Belt::Ent::PeriodicSort.use! if should_use?(:periodic_sort, options)
19
19
 
20
20
  true
21
21
  end
22
+
23
+ def self.should_use?(key, options)
24
+ options.include?(:all) || options.include?(key)
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sidekiq/web/helpers"
4
+
5
+ module Sidekiq
6
+ module Belt
7
+ module Ent
8
+ module PeriodicSort
9
+ module SidekiqLoopsPeriodicSort
10
+ def each(&block)
11
+ @lids.map { |lid| Sidekiq::Periodic::Loop.new(lid) }.sort_by(&:klass).each(&block)
12
+ end
13
+ end
14
+
15
+ def self.use!
16
+ require("sidekiq-ent/periodic")
17
+ require("sidekiq-ent/periodic/static_loop")
18
+
19
+ Sidekiq::Periodic::LoopSet.prepend(Sidekiq::Belt::Ent::PeriodicSort::SidekiqLoopsPeriodicSort)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Belt
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.2"
6
6
  end
7
7
  end
@@ -14,7 +14,9 @@ module Sidekiq
14
14
 
15
15
  path_info ||= ::Rack::Utils.unescape(env["PATH_INFO"])
16
16
 
17
- Sidekiq::Config::DEFAULTS[:replace_views].fetch(path_info.to_s, []).each do |content_block|
17
+ replace_views = Sidekiq::Config::DEFAULTS[:replace_views] || {}
18
+
19
+ replace_views.fetch(path_info.to_s, []).each do |content_block|
18
20
  content_block.call(content)
19
21
  end
20
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-belt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Jeremias da Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -45,6 +45,7 @@ files:
45
45
  - lib/sidekiq/belt/ent/files.rb
46
46
  - lib/sidekiq/belt/ent/periodic_pause.rb
47
47
  - lib/sidekiq/belt/ent/periodic_run.rb
48
+ - lib/sidekiq/belt/ent/periodic_sort.rb
48
49
  - lib/sidekiq/belt/pro/failed_batch_remove.rb
49
50
  - lib/sidekiq/belt/pro/files.rb
50
51
  - lib/sidekiq/belt/version.rb