sidekiq-cron-tasks 0.2.0 → 0.3.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
  SHA1:
3
- metadata.gz: a0bebc8a18c90f14c7f7b6d2ace03c96daf76ca0
4
- data.tar.gz: 10adc1c729afd1dd1a8fbd1f2b1b4a6586b73b81
3
+ metadata.gz: 3bff8d9c971caf0970d2e2d3badc4fac9a11fe54
4
+ data.tar.gz: b967dd1fd477f69926927ab6bbfe18261ed4116e
5
5
  SHA512:
6
- metadata.gz: 416113bdf08a72f514a807ea5c6ad8701d08484bf707e93da1cdb4b9e8c46c467c0ed1d76809b7133c53209ef79b817bd479aeb212007833b20b6be309c17345
7
- data.tar.gz: 9438ab02e0ad0135aa0f74f90868c45112322effda90d5905524cf83bc31897f8c651c5787e5f71b253af674e0dfd7cd1cd8dcac91df735a27b299b5a150c63b
6
+ metadata.gz: d526d3e7efe74f58852a1b15e648afa76c5561270a25f57839969be371c97a28e09f49af4b430731503b21780a21e84db02f40f305efa7c9bf1609239a91b311
7
+ data.tar.gz: 07d9cfa9f6fb35a9e88ee218e2838157a74581e6fd66ffa5edbbb64ccc1ebcc104e78e7cf3a583a52624b0607db663e9ab8f0fbb8b999294327f382a31fab22b
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Sidekiq::Cron::Tasks
2
2
 
3
+ [![Build Status](https://travis-ci.org/coverhound/sidekiq-cron-tasks.svg?branch=master)](https://travis-ci.org/coverhound/sidekiq-cron-tasks)
4
+
3
5
  Adds `rake` and `cap` tasks for loading `Sidekiq::Cron::Job`s from a config
4
6
  file.
5
7
 
@@ -12,6 +12,18 @@ namespace :deploy do
12
12
  after "deploy:updated", "deploy:sidekiq_cron"
13
13
  end
14
14
 
15
+ namespace :sidekiq_cron do
16
+ task clear: [:set_rails_env] do
17
+ on fetch(:sidekiq_cron_servers) do
18
+ within release_path do
19
+ with rails_env: fetch(:rails_env) do
20
+ execute :rake, "sidekiq_cron:clear"
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+
15
27
  namespace :load do
16
28
  task :defaults do
17
29
  set :sidekiq_cron_role, fetch(:sidekiq_cron_role, :app)
@@ -3,7 +3,7 @@ module Sidekiq
3
3
  module Tasks
4
4
  class Railtie < ::Rails::Railtie
5
5
  rake_tasks do
6
- load "tasks/sidekiq_cron/load.rake"
6
+ load "tasks/sidekiq_cron/tasks.rake"
7
7
  end
8
8
  end
9
9
  end
@@ -1,7 +1,7 @@
1
1
  module Sidekiq
2
2
  module Cron
3
3
  module Tasks
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
6
6
  end
7
7
  end
@@ -10,7 +10,13 @@ namespace :sidekiq_cron do
10
10
  new_hash[prefixed_name] = options
11
11
  end
12
12
 
13
- Sidekiq::Cron::Job.all.select { |job| job.name =~ /\A#{config.prefix} / }.each(&:destroy)
13
+ Rake::Task['sidekiq_cron:clear'].invoke
14
14
  Sidekiq::Cron::Job.load_from_hash prefixed_hash
15
15
  end
16
+
17
+ desc "Clear Sidekiq Cron entries"
18
+ task clear: :environment do
19
+ prefix = Sidekiq::Cron::Tasks.config.prefix
20
+ Sidekiq::Cron::Job.all.select { |job| job.name =~ /\A#{prefix} / }.each(&:destroy)
21
+ end
16
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-cron-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Farah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -103,7 +103,7 @@ files:
103
103
  - lib/sidekiq/cron/tasks/railtie.rb
104
104
  - lib/sidekiq/cron/tasks/version.rb
105
105
  - lib/sidekiq_cron_tasks.rb
106
- - lib/tasks/sidekiq_cron/load.rake
106
+ - lib/tasks/sidekiq_cron/tasks.rake
107
107
  homepage: https://github.com/coverhound/sidekiq-cron-tasks
108
108
  licenses:
109
109
  - MIT