midget_jobs 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/db/database.yml +8 -0
- data/db/migrate/20191022104513_create_midget_jobs.rb +13 -0
- data/db/migrate/20191022104514_create_midget_triggers.rb +19 -0
- data/lib/active_job/queue_adapters/midget_job_adapter.rb +33 -0
- data/lib/generators/midget_jobs/USAGE +10 -0
- data/lib/generators/midget_jobs/install_generator.rb +15 -0
- data/lib/generators/midget_jobs/templates/create_midget_jobs.rb +13 -0
- data/lib/generators/midget_jobs/templates/create_midget_triggers.rb +19 -0
- data/lib/generators/midget_jobs/templates/midget_job_initializer.rb +8 -0
- data/lib/midget_jobs/job.rb +37 -0
- data/lib/midget_jobs/scheduler.rb +42 -0
- data/lib/midget_jobs/version.rb +3 -0
- data/lib/midget_jobs.rb +13 -0
- data/lib/models/concerns/postgres_notifications_listener.rb +24 -0
- data/lib/models/midget_job.rb +25 -0
- data/midget_job.gemspec +34 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5b97d31874a18423a96d2ac76fa0137db3ba641cd02753138f1b75d6a59f830e
|
4
|
+
data.tar.gz: 053f4aa574341fed2479523d8ca320f0e974c445fc4ceaeec39c49ad675da294
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 65507a94451f88790e18a4d692d19b971b02d476e62df55349775d09ea9c467d7c8749c2557d686f6fd6a3cb6d15881ab0fb764542df3f0833054df83a8f9c25
|
7
|
+
data.tar.gz: 49615de063d22529e7bf1a08b132621e13d07b7e32772431a42e4fe7e3054cc194e983e2fa9b65dc388b66649e25489ff3ddf1959fca6f4b7485fc985a07b605
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at chmel@jchsoft.cz. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in midget_job.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
group :test do
|
7
|
+
gem 'minitest'
|
8
|
+
gem 'minitest-reporters'
|
9
|
+
gem 'minitest-stub_any_instance'
|
10
|
+
|
11
|
+
gem 'minitest-reporters'
|
12
|
+
gem 'activerecord'
|
13
|
+
gem 'pg'
|
14
|
+
gem 'activesupport'
|
15
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Josef Chmel
|
4
|
+
|
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:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
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/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# MidgetJob
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/midget_job`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'midget_job'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install midget_job
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/midget_job. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the MidgetJob project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/midget_job/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "midget_job"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/db/database.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateMidgetTriggers < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
execute <<-SQL
|
4
|
+
CREATE OR REPLACE FUNCTION notice_midget_job_insert() RETURNS trigger AS $$
|
5
|
+
DECLARE
|
6
|
+
channel_name varchar DEFAULT (TG_TABLE_NAME || '_notices');
|
7
|
+
BEGIN
|
8
|
+
PERFORM pg_notify(channel_name, json_build_object('action', TG_OP, 'id', NEW.id)::text);
|
9
|
+
|
10
|
+
RETURN NEW;
|
11
|
+
END;
|
12
|
+
$$ LANGUAGE plpgsql;
|
13
|
+
|
14
|
+
CREATE TRIGGER notice_on_insert
|
15
|
+
AFTER INSERT ON public.midget_jobs FOR EACH ROW
|
16
|
+
EXECUTE PROCEDURE notice_midget_job_insert();
|
17
|
+
SQL
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'midget_jobs/job'
|
2
|
+
|
3
|
+
module ActiveJob
|
4
|
+
module QueueAdapters
|
5
|
+
class MidgetJobAdapter
|
6
|
+
attr_accessor(:perform_enqueued_jobs, :perform_enqueued_at_jobs, :filter, :reject, :queue)
|
7
|
+
|
8
|
+
def enqueue(job) #:nodoc:
|
9
|
+
Rails.logger.debug "job: #{job}"
|
10
|
+
JobWrapper.enqueue job
|
11
|
+
end
|
12
|
+
|
13
|
+
def enqueue_at(job, timestamp) #:nodoc:
|
14
|
+
Rails.logger.debug "job: #{job}, #{timestamp}"
|
15
|
+
JobWrapper.enqueue job, at: timestamp
|
16
|
+
end
|
17
|
+
|
18
|
+
def enqueued_jobs
|
19
|
+
JobWrapper.enqueued_jobs
|
20
|
+
end
|
21
|
+
|
22
|
+
def performed_jobs
|
23
|
+
[]
|
24
|
+
end
|
25
|
+
|
26
|
+
class JobWrapper < MidgetJobs::Job
|
27
|
+
def run(serialized_job)
|
28
|
+
Base.execute serialized_job
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Description:
|
2
|
+
This generator creates an initializer file at config/initializers and migrations to db/migrate
|
3
|
+
|
4
|
+
Example:
|
5
|
+
rails generate midget_jobs:install
|
6
|
+
|
7
|
+
This will create:
|
8
|
+
config/initializers/midget_jobs.rb
|
9
|
+
db/migrate/#{Time.now.strftime "%Y%m%d%H%M%S"}_create_midget_jobs.rb
|
10
|
+
db/migrate/#{Time.now.strftime "%Y%m%d%H%M%S"}_create_midget_triggers.rb
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/active_record'
|
3
|
+
|
4
|
+
module MidgetJobs
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
7
|
+
desc 'This generator creates an initializer file at config/initializers and migrations to db/migrate'
|
8
|
+
|
9
|
+
def copy_install_file
|
10
|
+
copy_file "midget_job_initializer.rb", "config/initializers/midget_jobs.rb"
|
11
|
+
copy_file "create_midget_jobs.rb", "db/migrate/#{Time.now.strftime "%Y%m%d%H%M%S"}_create_midget_jobs.rb"
|
12
|
+
copy_file "create_midget_triggers.rb", "db/migrate/#{(Time.now + 1).strftime "%Y%m%d%H%M%S"}_create_midget_triggers.rb"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateMidgetTriggers < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
execute <<-SQL
|
4
|
+
CREATE OR REPLACE FUNCTION notice_midget_job_insert() RETURNS trigger AS $$
|
5
|
+
DECLARE
|
6
|
+
channel_name varchar DEFAULT (TG_TABLE_NAME || '_notices');
|
7
|
+
BEGIN
|
8
|
+
PERFORM pg_notify(channel_name, json_build_object('action', TG_OP, 'id', NEW.id)::text);
|
9
|
+
|
10
|
+
RETURN NEW;
|
11
|
+
END;
|
12
|
+
$$ LANGUAGE plpgsql;
|
13
|
+
|
14
|
+
CREATE TRIGGER notice_on_insert
|
15
|
+
AFTER INSERT ON public.midget_jobs FOR EACH ROW
|
16
|
+
EXECUTE PROCEDURE notice_midget_job_insert();
|
17
|
+
SQL
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'models/midget_job'
|
2
|
+
require 'midget_jobs/scheduler'
|
3
|
+
|
4
|
+
module MidgetJobs
|
5
|
+
class Job
|
6
|
+
class << self
|
7
|
+
attr_reader :scheduler
|
8
|
+
# @param [ActiveJob::Base] job
|
9
|
+
# @param [Time] at
|
10
|
+
def enqueue(job, at: nil)
|
11
|
+
MidgetJob.create!(job_id: job.job_id, queue: job.queue_name, serialized: job.serialize, run_at: (at or 1.second.from_now))
|
12
|
+
end
|
13
|
+
|
14
|
+
def enqueued_jobs
|
15
|
+
MidgetJob.all
|
16
|
+
end
|
17
|
+
|
18
|
+
def schedule
|
19
|
+
@scheduler = MidgetJobs::Scheduler.new.call
|
20
|
+
end
|
21
|
+
|
22
|
+
def process_notification(hash_data)
|
23
|
+
Rails.logger.info "#{self.name}.#{__method__}(#{hash_data})"
|
24
|
+
case hash_data[:action]
|
25
|
+
when 'INSERT'
|
26
|
+
@scheduler.wakeup!
|
27
|
+
else
|
28
|
+
raise "unknown action #{hash_data[:action]}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def run(serialized_job)
|
34
|
+
raise NotImplementedError, "serialized_job: #{serialized_job}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module MidgetJobs
|
2
|
+
class Scheduler
|
3
|
+
def call
|
4
|
+
Rails.logger.info "#{self.class.name} starting"
|
5
|
+
@thread = Thread.new do
|
6
|
+
Rails.logger.info "#{self.class.name} started and waiting for jobs"
|
7
|
+
loop do
|
8
|
+
sleep_till_next_job
|
9
|
+
process_available_jobs
|
10
|
+
end
|
11
|
+
end
|
12
|
+
@thread.abort_on_exception = true
|
13
|
+
self
|
14
|
+
end
|
15
|
+
|
16
|
+
def wakeup!
|
17
|
+
@thread.wakeup
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def process_available_jobs
|
23
|
+
MidgetJob.transaction do
|
24
|
+
MidgetJob.for_processing.limit(Rails.configuration.x.midget_jobs.at_once).lock("FOR UPDATE SKIP LOCKED").each do |midget_job|
|
25
|
+
Rails.logger.info "#{self.class.name} firing midget_job: #{midget_job.id}"
|
26
|
+
midget_job.fire_thread
|
27
|
+
midget_job.destroy!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# interval till next job or 0 if there is no job - meaning sleep for ever or till wakeup
|
33
|
+
def sleep_till_next_job
|
34
|
+
most_current = MidgetJob.order(run_at: :asc).first
|
35
|
+
if most_current
|
36
|
+
sleep [most_current.run_at.to_f - Time.current.to_f, 0.001].max
|
37
|
+
else
|
38
|
+
Thread.stop
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/midget_jobs.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "midget_jobs/version"
|
2
|
+
require 'active_job/queue_adapters/midget_job_adapter'
|
3
|
+
require 'midget_jobs/job'
|
4
|
+
require 'midget_jobs/scheduler'
|
5
|
+
require 'models/midget_job'
|
6
|
+
|
7
|
+
module MidgetJobs
|
8
|
+
class Error < StandardError; end
|
9
|
+
def self.initialize_workers
|
10
|
+
MidgetJobs::Job.schedule
|
11
|
+
MidgetJob.listen_notifications
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PostgresNotificationsListener
|
4
|
+
def listen_notifications
|
5
|
+
Rails.logger.info "#{self.name} listening_job started"
|
6
|
+
Thread.new do
|
7
|
+
Rails.logger.info "#{self.name} listening_job running on #{self.name.pluralize.underscore}_notices"
|
8
|
+
self.connection.execute "LISTEN #{self.name.pluralize.underscore}_notices"
|
9
|
+
loop do
|
10
|
+
Rails.logger.info "#{self.name} listening_job wait_for_notify"
|
11
|
+
begin
|
12
|
+
self.connection.raw_connection.wait_for_notify do |event, pid, payload|
|
13
|
+
data = JSON.parse payload, symbolize_names: true
|
14
|
+
Rails.logger.info "postgres #{event.inspect}, pid: #{pid.inspect}, data: #{data.inspect}"
|
15
|
+
process_notification(data)
|
16
|
+
end
|
17
|
+
rescue StandardError => error
|
18
|
+
Rails.logger.error "-------------Ex #{self.name} listening_job wait_for_notify #{error}----------------"
|
19
|
+
retry
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end.abort_on_exception = true
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'models/concerns/postgres_notifications_listener'
|
2
|
+
|
3
|
+
class MidgetJob < ActiveRecord::Base
|
4
|
+
extend PostgresNotificationsListener
|
5
|
+
|
6
|
+
scope :for_processing, -> { where('run_at < ?', Time.current) }
|
7
|
+
|
8
|
+
validates :job_id, :queue, :serialized, :run_at, presence: true
|
9
|
+
|
10
|
+
def fire_thread
|
11
|
+
Rails.logger.info "#{self.class.name}.fire_thread started"
|
12
|
+
Thread.new do
|
13
|
+
Rails.logger.info "#{self.class.name}.fire_thread execute serialized job"
|
14
|
+
begin
|
15
|
+
ActiveJob::Base.execute serialized
|
16
|
+
rescue => detail
|
17
|
+
Rails.logger.error detail.cause
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.process_notification(hash_data)
|
23
|
+
MidgetJobs::Job.process_notification hash_data
|
24
|
+
end
|
25
|
+
end
|
data/midget_job.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "midget_jobs/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "midget_jobs"
|
7
|
+
spec.version = MidgetJobs::VERSION
|
8
|
+
spec.authors = ["josefchmel"]
|
9
|
+
spec.email = ["chmel@jchsoft.cz"]
|
10
|
+
|
11
|
+
spec.summary = %q{Small background job scheduler closely related with Rails ActiveJob.}
|
12
|
+
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
13
|
+
spec.homepage = "https://github.com/jchsoft/midget_jobs"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/jchsoft/midget_jobs"
|
20
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: midget_jobs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- josefchmel
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- chmel@jchsoft.cz
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.yml"
|
64
|
+
- CODE_OF_CONDUCT.md
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/console
|
70
|
+
- bin/setup
|
71
|
+
- db/database.yml
|
72
|
+
- db/migrate/20191022104513_create_midget_jobs.rb
|
73
|
+
- db/migrate/20191022104514_create_midget_triggers.rb
|
74
|
+
- lib/active_job/queue_adapters/midget_job_adapter.rb
|
75
|
+
- lib/generators/midget_jobs/USAGE
|
76
|
+
- lib/generators/midget_jobs/install_generator.rb
|
77
|
+
- lib/generators/midget_jobs/templates/create_midget_jobs.rb
|
78
|
+
- lib/generators/midget_jobs/templates/create_midget_triggers.rb
|
79
|
+
- lib/generators/midget_jobs/templates/midget_job_initializer.rb
|
80
|
+
- lib/midget_jobs.rb
|
81
|
+
- lib/midget_jobs/job.rb
|
82
|
+
- lib/midget_jobs/scheduler.rb
|
83
|
+
- lib/midget_jobs/version.rb
|
84
|
+
- lib/models/concerns/postgres_notifications_listener.rb
|
85
|
+
- lib/models/midget_job.rb
|
86
|
+
- midget_job.gemspec
|
87
|
+
homepage: https://github.com/jchsoft/midget_jobs
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata:
|
91
|
+
homepage_uri: https://github.com/jchsoft/midget_jobs
|
92
|
+
source_code_uri: https://github.com/jchsoft/midget_jobs
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubygems_version: 3.0.6
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: Small background job scheduler closely related with Rails ActiveJob.
|
112
|
+
test_files: []
|