activejob-scheduler 0.0.1 → 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +12 -15
- data/.rspec +1 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +26 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +13 -1
- data/LICENSE.txt +17 -18
- data/MIT-LICENSE +20 -0
- data/README.md +133 -44
- data/Rakefile +27 -4
- data/activejob-scheduler.gemspec +29 -19
- data/bin/console +14 -0
- data/bin/rails +12 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/setup +7 -0
- data/bin/test +5 -0
- data/lib/active_job/scheduler.rb +33 -2
- data/lib/active_job/scheduler/engine.rb +17 -0
- data/lib/active_job/scheduler/error.rb +9 -0
- data/lib/active_job/scheduler/event.rb +89 -0
- data/lib/active_job/scheduler/interval.rb +46 -0
- data/lib/active_job/scheduler/job.rb +84 -53
- data/lib/active_job/scheduler/mailer.rb +35 -0
- data/lib/active_job/scheduler/missing_config_error.rb +12 -0
- data/lib/active_job/scheduler/not_defined_error.rb +12 -0
- data/lib/active_job/scheduler/not_supported_error.rb +12 -0
- data/lib/active_job/scheduler/schedule.rb +114 -0
- data/lib/active_job/scheduler/version.rb +4 -1
- data/lib/activejob-scheduler.rb +3 -0
- data/lib/tasks/activejob_scheduler_tasks.rake +8 -0
- metadata +196 -53
- data/bin/ajs +0 -7
- data/lib/active_job/scheduler/cli.rb +0 -113
- data/lib/active_job/scheduler/jobs.rb +0 -32
- data/lib/active_job/scheduler/task.rb +0 -38
- data/spec/active_job/scheduler/job_spec.rb +0 -44
- data/spec/active_job/scheduler/jobs_spec.rb +0 -24
- data/spec/fixtures/jobs.yml +0 -3
- data/spec/spec_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5249502825a6e087006bf9d2bd61499546bb8af8a3aff2b57eee5621cba496e0
|
4
|
+
data.tar.gz: be51136634feecf5881769d6ddc50a5b426f1024b840751dc3a134ee9c1cf673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac63b3c8cb324a661441784c2bb1b839d2a7433eb3d5422f707f8c02f1674f11ac6f2ef6b3fcb708572057432c072a39798050b18f7c303ac0ecb4a8aa4dd834
|
7
|
+
data.tar.gz: 040a90dc42586f6447e9110445b5b71aba276afc3edae392f11f5ad5140df5bdba9381a23d52a78167bec4ca88a8c7d17e90bf39260e596f5c1b9a21a50611fd
|
data/.gitignore
CHANGED
@@ -1,17 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
.bundle/
|
2
|
+
log/*.log
|
3
|
+
pkg/
|
4
|
+
test/dummy/db/*.sqlite3
|
5
|
+
test/dummy/db/*.sqlite3-journal
|
6
|
+
test/dummy/log/*.log
|
7
|
+
test/dummy/tmp/
|
8
|
+
test/dummy/.sass-cache
|
9
|
+
vendor/
|
6
10
|
Gemfile.lock
|
7
|
-
|
8
|
-
|
11
|
+
.env
|
12
|
+
.yardoc
|
13
|
+
doc
|
9
14
|
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- vendor/**/*
|
4
|
+
- test/dummy/**/*
|
5
|
+
- bin/**/*
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Exclude:
|
9
|
+
- activejob-scheduler.gemspec
|
10
|
+
|
11
|
+
Metrics/MethodLength:
|
12
|
+
Exclude:
|
13
|
+
- lib/active_job/scheduler/event.rb
|
14
|
+
|
15
|
+
Naming/FileName:
|
16
|
+
Exclude:
|
17
|
+
- lib/activejob-scheduler.rb
|
data/.travis.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.5
|
4
|
+
- 2.6
|
5
|
+
- ruby-head
|
6
|
+
matrix:
|
7
|
+
allow_failures:
|
8
|
+
- rvm: ruby-head
|
9
|
+
before_install: gem install bundler
|
10
|
+
before_script:
|
11
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
12
|
+
- chmod +x ./cc-test-reporter
|
13
|
+
- ./cc-test-reporter before-build
|
14
|
+
after_script:
|
15
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
16
|
+
deploy:
|
17
|
+
provider: rubygems
|
18
|
+
api_key:
|
19
|
+
secure: Pc0pTAFK72e7m47TnOg8f07MF8wrx5soR/D6K9VOT5+TWEPmYktVuoubsdNBc7Qf+MoTRdqbTeyvcqBI2BCuQUh98Ls8AC3pdmiz2WNNN8LFm3JYudLR/tRU2Fm6jsM5hE/Q6kdqCBEYgR1radwGv5IBBl9JjCs8amC2bVuJHBw=
|
20
|
+
gem: activejob-scheduler
|
21
|
+
on:
|
22
|
+
tags: true
|
23
|
+
repo: tubbo/activejob-scheduler
|
24
|
+
env:
|
25
|
+
global:
|
26
|
+
secure: QvIDmtMATWuUuPvqujou8wgClT5JgXiVwHzqort0a+ssLQsi5kMNw+AAiNyfgKc0OOlxgKEJkJr1LSgZpyOiVhmpJ88cItaLI3ngSCHZIYT+LqU31wxcTTmTqXpdgZymrHMdHmeInxkIvtC1kzLatIUF8XODA+CnXWjEVBT/HXc=
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
|
-
#
|
5
|
+
# Declare your gem's dependencies in activejob_scheduler.gemspec.
|
6
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
7
|
+
# development dependencies will be added by default to the :development group.
|
4
8
|
gemspec
|
9
|
+
|
10
|
+
# Declare any dependencies that are still in development here instead of in
|
11
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
12
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
13
|
+
# your gem to rubygems.org.
|
14
|
+
|
15
|
+
# To use a debugger
|
16
|
+
# gem 'byebug', group: [:development, :test]
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2016 Tom Scott
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the following conditions:
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Tom Scott
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# ActiveJob::Scheduler
|
2
2
|
|
3
|
+
[![Current Gem Version](https://badge.fury.io/rb/activejob-scheduler.svg)](http://badge.fury.io/rb/activejob-scheduler)
|
4
|
+
[![Build Status](https://travis-ci.org/tubbo/activejob-scheduler.svg?branch=master)](https://travis-ci.org/tubbo/activejob-scheduler)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/94b5d52c0059cc8a380b/maintainability)](https://codeclimate.com/github/tubbo/activejob-scheduler/maintainability)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/94b5d52c0059cc8a380b/test_coverage)](https://codeclimate.com/github/tubbo/activejob-scheduler/test_coverage)
|
7
|
+
|
3
8
|
An extension to [ActiveJob][aj] for running background jobs
|
4
9
|
periodically, according to a schedule. Inspired by its predecessors,
|
5
10
|
[resque-scheduler][resque] and [sidekiq-scheduler][sidekiq],
|
@@ -7,84 +12,168 @@ periodically, according to a schedule. Inspired by its predecessors,
|
|
7
12
|
everyone's hands, by way of the pre-defined ActiveJob API which most
|
8
13
|
popular queueing backend choices already support.
|
9
14
|
|
10
|
-
Like its predecessors, `ActiveJob::Scheduler`
|
11
|
-
|
12
|
-
|
15
|
+
Like its predecessors, `ActiveJob::Scheduler` uses the same powerful
|
16
|
+
syntax for describing when periodic jobs should run as
|
17
|
+
[Rufus::Scheduler][rufus]. However, unlike its predecessors,
|
18
|
+
`ActiveJob::Scheduler` does not require a separate process to be run.
|
19
|
+
Instead, it uses an `after_perform` callback to re-enqueue the job after
|
20
|
+
it has been performed.
|
13
21
|
|
14
22
|
## Installation
|
15
23
|
|
16
24
|
Add this line to your application's Gemfile:
|
17
25
|
|
18
|
-
|
26
|
+
```ruby
|
27
|
+
gem 'activejob-scheduler'
|
28
|
+
```
|
19
29
|
|
20
30
|
And then execute:
|
21
31
|
|
22
32
|
$ bundle
|
23
33
|
|
34
|
+
Or install it yourself as:
|
35
|
+
|
36
|
+
$ gem install activejob-scheduler
|
37
|
+
|
24
38
|
## Usage
|
25
39
|
|
26
|
-
|
40
|
+
To schedule your jobs, add the `repeat` macro to the job definition:
|
27
41
|
|
28
|
-
```
|
29
|
-
|
42
|
+
```ruby
|
43
|
+
class GenerateSitemapsJob < ApplicationJob
|
44
|
+
repeat 'every day at 2am'
|
45
|
+
|
46
|
+
def perform
|
47
|
+
SitemapGenerator.generate
|
48
|
+
end
|
49
|
+
end
|
30
50
|
```
|
31
51
|
|
32
|
-
|
33
|
-
|
34
|
-
|
52
|
+
This macro can also be used to configure the job event, like its name or
|
53
|
+
arguments:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
class GenerateSitemapsJob < ApplicationJob
|
57
|
+
repeat every: '1d', name: 'Sitemap Generator', arguments: %w(foo bar)
|
58
|
+
|
59
|
+
def perform(foo, bar)
|
60
|
+
SitemapGenerator.generate(foo, bar) # => foo == "foo", bar == "bar"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
The DSL also allows you to iterate over a collection and pass in a
|
66
|
+
different argument for each item:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
class SyncOrdersJob < ApplicationJob
|
70
|
+
repeat 'every day at 11:30am', each: -> { Order.not_synced }
|
71
|
+
|
72
|
+
def perform(order)
|
73
|
+
ExternalSystem.create(order)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
78
|
+
This will trigger the event every day at 11:30am, but enqueue a job for
|
79
|
+
each model in the collection, and pass it into the job arguments. You
|
80
|
+
can specify static arguments here as well, they will be passed in prior
|
81
|
+
to the item argument at the end.
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
class SyncOrdersJob < ApplicationJob
|
85
|
+
repeat 'every day at 11:30am',
|
86
|
+
arguments: ['synced'],
|
87
|
+
each: -> { Order.not_synced }
|
88
|
+
|
89
|
+
def perform(type, order)
|
90
|
+
ExternalSystem.create(type: type, order: order) # type is "synced"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
Start the schedule by running this command:
|
35
96
|
|
36
97
|
```bash
|
37
|
-
|
98
|
+
./bin/rails activejob:schedule
|
38
99
|
```
|
39
100
|
|
40
|
-
|
101
|
+
### YAML Schedule
|
102
|
+
|
103
|
+
Much like **resque-scheduler**, you can use a YAML schedule file with
|
104
|
+
**activejob-scheduler** with a very similar syntax. To generate a new
|
105
|
+
one, run:
|
41
106
|
|
42
107
|
```bash
|
43
|
-
$
|
108
|
+
$ rails generate activejob:schedule
|
44
109
|
```
|
45
110
|
|
46
|
-
|
47
|
-
delegates all the real processing to your queue workers, and simply
|
48
|
-
enqueues jobs as the specified time rolls around.
|
111
|
+
Then, add your jobs into the YAML like so:
|
49
112
|
|
50
|
-
|
113
|
+
```yaml
|
114
|
+
generate_sitemaps:
|
115
|
+
interval:
|
116
|
+
every: '1d'
|
117
|
+
```
|
118
|
+
|
119
|
+
This is entirely optional, however, and both DSL-based jobs and
|
120
|
+
YAML-based jobs will be included in the schedule at runtime.
|
51
121
|
|
52
|
-
|
53
|
-
make sure to include tests with all your work.
|
122
|
+
### Mailers
|
54
123
|
|
55
|
-
|
124
|
+
```ruby
|
125
|
+
class AdminMailer < ApplicationMailer
|
126
|
+
repeat :daily_status, 'every day at 8am'
|
127
|
+
def daily_status
|
128
|
+
mail to: User.admins.pluck(:email)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
This will send the email every day at **8:00am**. You can also pass all
|
134
|
+
the regular fields from `repeat` in the job DSL like arguments and the
|
135
|
+
various fugit-parsed intervals.
|
56
136
|
|
57
|
-
|
137
|
+
You can also send a different email for each recipient:
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
class UserMailer < ApplicationMailer
|
141
|
+
repeat :status, 'every day at 8am', each: -> { User.receive_email }
|
142
|
+
def status(user)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
```
|
146
|
+
|
147
|
+
This lambda will be called when the event is enqueued, and individual
|
148
|
+
mails will be sent out for each user in the collection.
|
149
|
+
|
150
|
+
## Development
|
58
151
|
|
59
|
-
|
60
|
-
|
152
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
153
|
+
Then, run `rake rspec` to run the tests. You can also run `bin/console`
|
154
|
+
for an interactive prompt that will allow you to experiment.
|
61
155
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
Software is furnished to do so, subject to the following conditions:
|
156
|
+
To install this gem onto your local machine, run `bin/rake install`. To
|
157
|
+
release a new version, update the version number in `version.rb`, and
|
158
|
+
then run `bin/rake release`, which will create a git tag for the version,
|
159
|
+
push git commits and tags, and push the `.gem` file to
|
160
|
+
[rubygems.org](https://rubygems.org).
|
68
161
|
|
69
|
-
|
70
|
-
this list of conditions and the following disclaimers.
|
162
|
+
## Contributing
|
71
163
|
|
72
|
-
|
73
|
-
|
74
|
-
|
164
|
+
Bug reports and pull requests are welcome on GitHub at
|
165
|
+
https://github.com/tubbo/activejob-scheduler. This project is intended
|
166
|
+
to be a safe, welcoming space for collaboration, and contributors
|
167
|
+
are expected to adhere to the
|
168
|
+
[Contributor Covenant](contributor-covenant.org) code of conduct.
|
75
169
|
|
76
|
-
|
77
|
-
products derived from this Software without specific prior written permission.
|
170
|
+
## License
|
78
171
|
|
79
|
-
|
80
|
-
|
81
|
-
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE
|
82
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
83
|
-
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
84
|
-
DEALINGS WITH THE SOFTWARE.
|
172
|
+
The gem is available as open source under the terms of the [MIT
|
173
|
+
License][mit].
|
85
174
|
|
86
|
-
[aj]: https://github.com/rails/activejob
|
175
|
+
[aj]: https://github.com/rails/rails/tree/master/activejob
|
87
176
|
[resque]: https://github.com/resque/resque-scheduler
|
88
177
|
[sidekiq]: https://github.com/Moove-it/sidekiq-scheduler
|
89
178
|
[rufus]: https://github.com/jmettraux/rufus-scheduler
|
90
|
-
[
|
179
|
+
[mit]: http://opensource.org/licenses/MIT
|
data/Rakefile
CHANGED
@@ -1,5 +1,28 @@
|
|
1
|
-
|
2
|
-
require "bundler/gem_tasks"
|
3
|
-
require "rspec/core/rake_task"
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
|
-
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'bundler/gem_tasks'
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
require 'rubocop/rake_task'
|
7
|
+
require 'yard'
|
8
|
+
require 'travis/release/task'
|
9
|
+
require 'rake/testtask'
|
10
|
+
|
11
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
12
|
+
|
13
|
+
load 'rails/tasks/engine.rake'
|
14
|
+
load 'rails/tasks/statistics.rake'
|
15
|
+
|
16
|
+
Rake::TestTask.new(:test) do |t|
|
17
|
+
t.libs << 'test'
|
18
|
+
t.pattern = 'test/**/*_test.rb'
|
19
|
+
t.verbose = false
|
20
|
+
end
|
21
|
+
|
22
|
+
RuboCop::RakeTask.new :lint
|
23
|
+
|
24
|
+
YARD::Rake::YardocTask.new :doc
|
25
|
+
|
26
|
+
Travis::Release::Task.new
|
27
|
+
|
28
|
+
task default: %i[lint test build doc]
|
data/activejob-scheduler.gemspec
CHANGED
@@ -1,28 +1,38 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'active_job/scheduler/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'activejob-scheduler'
|
8
9
|
spec.version = ActiveJob::Scheduler::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
|
12
|
-
spec.
|
13
|
-
spec.
|
14
|
-
spec.
|
10
|
+
spec.authors = ['Tom Scott']
|
11
|
+
spec.email = ['tscott@weblinc.com']
|
12
|
+
|
13
|
+
spec.summary = 'Scheduled jobs for ActiveJob.'
|
14
|
+
spec.description = spec.summary.to_s
|
15
|
+
spec.homepage = 'https://github.com/tubbo/activejob-scheduler'
|
16
|
+
spec.license = 'MIT'
|
15
17
|
|
16
|
-
spec.files = `git ls-files`.split(
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
spec.require_paths = [
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
20
22
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'bundler', '>= 1', '< 3'
|
24
|
+
spec.add_development_dependency 'mocha', '~> 1.9'
|
25
|
+
spec.add_development_dependency 'rails', '~> 6'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
28
|
+
spec.add_development_dependency 'rubocop', '>= 0.49.0'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.17'
|
30
|
+
spec.add_development_dependency 'sqlite3', '~> 1.4'
|
31
|
+
spec.add_development_dependency 'yard', '>= 0.9.20'
|
24
32
|
|
25
|
-
spec.add_dependency '
|
26
|
-
spec.add_dependency '
|
27
|
-
spec.add_dependency '
|
33
|
+
spec.add_dependency 'actionmailer', '> 5', '< 7'
|
34
|
+
spec.add_dependency 'activejob', '> 5', '< 7'
|
35
|
+
spec.add_dependency 'activesupport', '> 5', '< 7'
|
36
|
+
spec.add_dependency 'fugit', '~> 1.3'
|
37
|
+
spec.add_dependency 'travis-release', '~> 0'
|
28
38
|
end
|