active_model-jobs 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.codeclimate.yml +3 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +17 -3
- data/README.md +1 -1
- data/Rakefile +7 -4
- data/{active_model-jobs.gemspec → active_model_jobs.gemspec} +11 -13
- data/bin/htmldiff +18 -5
- data/bin/ldiff +18 -5
- data/bin/rake +18 -5
- data/bin/rspec +18 -5
- data/bin/rubocop +18 -5
- data/bin/ruby-parse +18 -5
- data/bin/ruby-rewrite +18 -5
- data/bin/yard +18 -5
- data/bin/yardoc +18 -5
- data/bin/yri +18 -5
- data/lib/active_model/jobs.rb +11 -9
- data/lib/active_model/jobs/engine.rb +6 -12
- data/lib/active_model/jobs/performer.rb +2 -14
- data/lib/active_model/jobs/version.rb +2 -2
- metadata +58 -43
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MmQ4ZWRiYTg3OTlhZWZlZGY4YzlmMTU2Mzc4Y2YxMTdlZDQyMWZkMA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8d4ac2e6f2909a4836d007ecaa3f525f9dc73706
|
4
|
+
data.tar.gz: c4b257e6d3970b61274cffd8a2d9483f01c38c77
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
M2NkMjI1NTg3ZGI5ODFjN2JiMjk1MDc1ZjViMTFlNjU5YjYwMTdkYTZiMTY2
|
11
|
-
NmE1OGJkNDBlYWFjZmU0NDBmNDgzMDNjNmQ2OTAxMzI1MzI5YWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YmNiZGIyOWM3MzI3OTYzNWJmYjIyY2E2NzM3NTU5NzE5Njk0NjM5ZTdjYmU0
|
14
|
-
NzljNTIyNGNiMGE1NWNkMGFmYjI3ZGYxMmUyNDkzYjE2NmEzNjNkN2ZkNTY0
|
15
|
-
MDRmMjdkMDFmOWViMjczZWIyZjFhODA3ZDVlMjkzMDEyZGRmMzM=
|
6
|
+
metadata.gz: 67b0b1224b2ae6b2364964e9625f79dcee2db7791bdd8dfef7c0f97c150b22bbbf0d6921bb87d832c48e6aa6b618b6a5915092a9c8a6b2755415b03860e2637d
|
7
|
+
data.tar.gz: 54cde3d9223bd7e86b5d36d1cbaf351fc63a3f7cd619844ac50252188cc2e7f9a11f06f59836c10518e30eafa37cc4b031234f04203b74afbe3c5c190b04cb45
|
data/.codeclimate.yml
ADDED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.2
|
3
|
+
- 2.2
|
4
|
+
- 2.3
|
5
|
+
- 2.4
|
6
|
+
- 2.5
|
7
|
+
- 2.6
|
8
|
+
cache: bundler
|
9
|
+
before_script:
|
10
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
+
- chmod +x ./cc-test-reporter
|
12
|
+
- "./cc-test-reporter before-build"
|
13
|
+
after_script:
|
14
|
+
- "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
|
4
15
|
deploy:
|
5
16
|
provider: rubygems
|
6
17
|
api_key:
|
7
18
|
secure: JQWmjd5/4zPBjt33e+ZF5+lmz7nsek6X6Q5Er06q/Qbaeak/uxCd/7hW8mP6mesh6p/OOBIYlRBOxN/GHf7/TWd+n5LrmCye18iyqGQlgwrB3ULoDqSh/GBBLp4u4zI6oBZJA3GoC5mDyDg5Mdf5ye0yVBhbfT3D9+VUyq53xrKI3B3pKztTgvZ/KzF4Gsb3UrN5R0E9Q4NZLrkIlApM517BXKnDTpk1DYZGe12FYZtgZMCkSPtiohZ5qizHDq6HK8ZgPPZ970QEu1jIFUs4luF0qKOCYhO9Yq9UWL1m+eRwa/s/j8Vyww9dPg2x9yReDWcIf0gZMKPBMgVQrnfT/YER5L0cee2XbxI6LdPwkvrx7EQwb5e2z/bzVr7IuiZrewWUTNaO7v9NnKSnS3smfbtu9gK5AYzf0X1z42vWCnCwJNYGAJd2sD1dw80zBtWf0YlonrRnXTUTdapSV3FAZBLFNHL9YNldZ9bjT3cPLhZv/ajk9eL7wOWGVRzghfUTYkTdIGQtH1nasVj99b9cuENj8HEJbnh7r8CgkpyuyZ5YjyZt+VCwCxeImPYv7uJbUlChFipdhC5NTvfIkcsDuXWWP+Va67MTchCnf+chCFD4oRLKuc9atkpSdawpvQ4T5tYiqa5nhscLm79bE2Md/VYqdgWo+JzbPOHq4MqAg4Q=
|
8
|
-
gem:
|
19
|
+
gem: active_model_jobs
|
9
20
|
on:
|
10
21
|
tags: true
|
11
|
-
repo: tubbo/
|
22
|
+
repo: tubbo/active_model_jobs
|
23
|
+
env:
|
24
|
+
global:
|
25
|
+
secure: CP6t3YPR9xPYjbvKLpr+I0esOLdurqDeGCffWV0hga1CH+y3U6+S/+ui+F3APQKO9ct8XSZ6pYvZJVUow6o/VJ++e4hFadR3TbToWvjBv6EOUjnREQ6w78eS4JmhpXgSvrZB5SLFNZLUpXoJcxhVRTcA1qBR5oOc5PocuSMvOHGWK0znOqupp1K/46UEouBdwRmty8eKC2UgIxE/jyuBhnkyiUNiLUD13lbnQLnM25MikYd5sPmZPFDWRqwqvWD8j3ZPJjA/WH/+1fkhZbA7HPFCkBWn8lnSO/z8GzGwq/OeEFQvACdiCVBezC5ut0ais9ztIvZloAJL1Dk8AF5eSZLM0gXhhjV9ikWHq5EzM/FVK+haQhF09zRInEYjTEt3XERVmH6geE4qCPm/8sWH9K+sD6norPRoIwdI0cGIfmbzSQmWZXH3afJh3qn1iOuOqKh6F/LrEbmJSArs1FFfxbKjxppAqgi4drmdkgDbNTpEwfMlv9Q7V7ECrCgdXJyG9rVUEGGonWkuHSsDuwiJgEzSdp+KpWvasM5OP1/qBsUV8qqO9uRbh9OtOiMWlxk1j1c2j6oQfTQpPr27iQtD3QwDyhndFv0oY8ksgtDbfJwTCzJzeYtCH+A6Jtrb90PcJpGu6dDFl0B09jnR/8rT38Osnmti7Ghv1lpgJz3Fgvc=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveModel::Jobs
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/tubbo/
|
3
|
+
[![Build Status](https://travis-ci.org/tubbo/active_model_jobs.svg?branch=master)](https://travis-ci.org/tubbo/active_model_jobs)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/tubbo/active_model-jobs/badges/gpa.svg)](https://codeclimate.com/github/tubbo/active_model-jobs)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/tubbo/active_model-jobs/badges/coverage.svg)](https://codeclimate.com/github/tubbo/active_model-jobs/coverage)
|
6
6
|
[![Inline docs](http://inch-ci.org/github/tubbo/active_model-jobs.svg?branch=master)](http://inch-ci.org/github/tubbo/active_model-jobs)
|
data/Rakefile
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
require "bundler/setup"
|
2
|
-
require "bundler/gem_tasks"
|
3
2
|
require "rspec/core/rake_task"
|
4
3
|
require "rubocop/rake_task"
|
5
4
|
require "yard"
|
5
|
+
require "active_model/jobs"
|
6
6
|
|
7
|
-
RSpec::Core::RakeTask.new :
|
7
|
+
RSpec::Core::RakeTask.new :test
|
8
8
|
|
9
9
|
RuboCop::RakeTask.new :lint
|
10
10
|
|
11
11
|
YARD::Rake::YardocTask.new :doc
|
12
12
|
|
13
|
-
desc "
|
14
|
-
task
|
13
|
+
desc "Create tag and push tags to GitHub"
|
14
|
+
task :release do
|
15
|
+
sh "git tag v#{ActiveModel::Jobs::VERSION}"
|
16
|
+
sh "git push --tags"
|
17
|
+
end
|
15
18
|
|
16
19
|
# CI task.
|
17
20
|
task default: :test
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'active_model/jobs/version'
|
5
4
|
|
@@ -9,11 +8,9 @@ Gem::Specification.new do |spec|
|
|
9
8
|
spec.authors = ["Tom Scott"]
|
10
9
|
spec.email = ["tscott@weblinc.com"]
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
Helper module for initiating ActiveJobs through an ActiveRecord model.
|
14
|
-
)
|
11
|
+
spec.summary = 'This gem has been renamed active_model_jobs.'
|
15
12
|
spec.description = spec.summary
|
16
|
-
spec.homepage = "http://github.com/tubbo/
|
13
|
+
spec.homepage = "http://github.com/tubbo/active_model_jobs"
|
17
14
|
spec.license = "MIT"
|
18
15
|
|
19
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -24,12 +21,13 @@ Gem::Specification.new do |spec|
|
|
24
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
22
|
spec.require_paths = ["lib"]
|
26
23
|
|
27
|
-
spec.add_development_dependency "bundler"
|
28
|
-
spec.add_development_dependency "rake"
|
29
|
-
spec.add_development_dependency "rspec"
|
30
|
-
spec.add_development_dependency "rubocop"
|
31
|
-
spec.add_development_dependency "
|
24
|
+
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency "rspec"
|
27
|
+
spec.add_development_dependency "rubocop", ">= 0.49.0"
|
28
|
+
spec.add_development_dependency "simplecov"
|
29
|
+
spec.add_development_dependency "yard", ">= 0.9.20"
|
32
30
|
|
33
|
-
spec.add_dependency "
|
34
|
-
spec.add_dependency "
|
31
|
+
spec.add_dependency "activejob", ">= 5.0.0"
|
32
|
+
spec.add_dependency "activemodel", ">= 5.0.0"
|
35
33
|
end
|
data/bin/htmldiff
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("diff-lcs", "htmldiff")
|
data/bin/ldiff
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("diff-lcs", "ldiff")
|
data/bin/rake
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/ruby-parse
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("parser", "ruby-parse")
|
data/bin/ruby-rewrite
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("parser", "ruby-rewrite")
|
data/bin/yard
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("yard", "yard")
|
data/bin/yardoc
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("yard", "yardoc")
|
data/bin/yri
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# This file was generated by Bundler.
|
4
6
|
#
|
@@ -6,11 +8,22 @@
|
|
6
8
|
# this file is here to facilitate running it.
|
7
9
|
#
|
8
10
|
|
9
|
-
require
|
10
|
-
ENV[
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
11
13
|
Pathname.new(__FILE__).realpath)
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
15
28
|
|
16
|
-
load Gem.bin_path(
|
29
|
+
load Gem.bin_path("yard", "yri")
|
data/lib/active_model/jobs.rb
CHANGED
@@ -2,9 +2,8 @@ require "active_support/all"
|
|
2
2
|
require "active_model"
|
3
3
|
require "active_model/jobs/version"
|
4
4
|
require "active_model/jobs/performer"
|
5
|
-
require "active_model/jobs/engine"
|
5
|
+
require "active_model/jobs/engine" if defined? Rails
|
6
6
|
|
7
|
-
# :nodoc:
|
8
7
|
module ActiveModel
|
9
8
|
# Include this module into your model to take advantage of
|
10
9
|
# automatically-generated +:job_name!+ action methods for any
|
@@ -17,6 +16,9 @@ module ActiveModel
|
|
17
16
|
# after_commit :deploy!
|
18
17
|
# end
|
19
18
|
module Jobs
|
19
|
+
# Method suffix for actions.
|
20
|
+
ACTION_SUFFIX = '!'.freeze
|
21
|
+
|
20
22
|
# Call +perform_later+ on an ActiveJob class corresponding to an
|
21
23
|
# undefined action method name. Most of the work here is done in the
|
22
24
|
# +Performer+ class, which takes care of discoevering whether the
|
@@ -28,16 +30,16 @@ module ActiveModel
|
|
28
30
|
#
|
29
31
|
# @throws NoMethodError if no job matches the action method
|
30
32
|
def method_missing(method, *arguments)
|
31
|
-
performer =
|
32
|
-
return super unless
|
33
|
+
performer = Performer.new method, model_name
|
34
|
+
return super unless respond_to?(method) && performer.job?
|
35
|
+
|
33
36
|
performer.call self
|
34
37
|
end
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
def
|
39
|
-
|
40
|
-
Performer.new method, model_name
|
39
|
+
# Allow the model to respond to all "action" methods (methods
|
40
|
+
# suffixed by +!+)
|
41
|
+
def respond_to_missing?(method, include_private = true)
|
42
|
+
method.to_s.end_with?(ACTION_SUFFIX) || super
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
@@ -1,15 +1,9 @@
|
|
1
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
class Engine < Rails::Engine
|
8
|
-
initializer 'active_model_jobs.setup' do
|
9
|
-
ActiveSupport.on_load :active_model do
|
10
|
-
ActiveModel::Model.send :include, ActiveModel::Jobs
|
11
|
-
end
|
12
|
-
end
|
1
|
+
module ActiveModel
|
2
|
+
module Jobs
|
3
|
+
# Automatically includes ActiveModel::Jobs into a Rails app
|
4
|
+
class Engine < Rails::Engine
|
5
|
+
ActiveSupport.on_load :active_record do
|
6
|
+
include ActiveModel::Jobs
|
13
7
|
end
|
14
8
|
end
|
15
9
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module ActiveModel
|
2
|
-
#
|
3
2
|
module Jobs
|
4
3
|
# A support class for finding the +ActiveJob::Base+ that corresponds
|
5
4
|
# to a given action method on a given model. When the job class is
|
@@ -7,9 +6,6 @@ module ActiveModel
|
|
7
6
|
#
|
8
7
|
# @private
|
9
8
|
class Performer
|
10
|
-
# Regular expression for finding a '!' at the end of a String.
|
11
|
-
BANG = /!\Z/
|
12
|
-
|
13
9
|
# The method name given to the class as a String.
|
14
10
|
#
|
15
11
|
# @attr_reader [String]
|
@@ -28,19 +24,12 @@ module ActiveModel
|
|
28
24
|
@model_name = model_name.to_s
|
29
25
|
end
|
30
26
|
|
31
|
-
# Tests whether the given method name ends with a '!'.
|
32
|
-
#
|
33
|
-
# @return [Boolean]
|
34
|
-
def self.action?(method)
|
35
|
-
method =~ BANG
|
36
|
-
end
|
37
|
-
|
38
27
|
# Tests whether this method name corresponds to a job class in the
|
39
28
|
# application.
|
40
29
|
#
|
41
30
|
# @return [Boolean] whether this job exists or not
|
42
31
|
def job?
|
43
|
-
|
32
|
+
job_class.present?
|
44
33
|
end
|
45
34
|
|
46
35
|
# Attempts to find the job class for this method and return it,
|
@@ -65,7 +54,7 @@ module ActiveModel
|
|
65
54
|
#
|
66
55
|
# @return [String] '!'-stripped version of the method name.
|
67
56
|
def action_name
|
68
|
-
method_name.gsub
|
57
|
+
method_name.gsub ACTION_SUFFIX, ''
|
69
58
|
end
|
70
59
|
|
71
60
|
# Perform this action on the given model.
|
@@ -75,7 +64,6 @@ module ActiveModel
|
|
75
64
|
# @return [TrueClass, FalseClass] whether the job succeeded to
|
76
65
|
# enqueue.
|
77
66
|
def call(model)
|
78
|
-
return false unless job?
|
79
67
|
job_class.perform_later model
|
80
68
|
end
|
81
69
|
end
|
metadata
CHANGED
@@ -1,133 +1,148 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.49.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.49.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: yard
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
89
|
+
version: 0.9.20
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
96
|
+
version: 0.9.20
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: activejob
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 5.0.0
|
90
104
|
type: :runtime
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 5.0.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: activemodel
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 5.0.0
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
description:
|
124
|
+
version: 5.0.0
|
125
|
+
description: This gem has been renamed active_model_jobs.
|
112
126
|
email:
|
113
127
|
- tscott@weblinc.com
|
114
128
|
executables: []
|
115
129
|
extensions: []
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
118
|
-
- .bundle/config
|
119
|
-
- .
|
120
|
-
- .
|
121
|
-
- .
|
122
|
-
- .
|
123
|
-
- .
|
124
|
-
- .
|
132
|
+
- ".bundle/config"
|
133
|
+
- ".codeclimate.yml"
|
134
|
+
- ".env"
|
135
|
+
- ".gitignore"
|
136
|
+
- ".rspec"
|
137
|
+
- ".rubocop.yml"
|
138
|
+
- ".ruby-version"
|
139
|
+
- ".travis.yml"
|
125
140
|
- CODE_OF_CONDUCT.md
|
126
141
|
- Gemfile
|
127
142
|
- LICENSE.txt
|
128
143
|
- README.md
|
129
144
|
- Rakefile
|
130
|
-
-
|
145
|
+
- active_model_jobs.gemspec
|
131
146
|
- bin/console
|
132
147
|
- bin/htmldiff
|
133
148
|
- bin/ldiff
|
@@ -144,7 +159,7 @@ files:
|
|
144
159
|
- lib/active_model/jobs/engine.rb
|
145
160
|
- lib/active_model/jobs/performer.rb
|
146
161
|
- lib/active_model/jobs/version.rb
|
147
|
-
homepage: http://github.com/tubbo/
|
162
|
+
homepage: http://github.com/tubbo/active_model_jobs
|
148
163
|
licenses:
|
149
164
|
- MIT
|
150
165
|
metadata: {}
|
@@ -154,12 +169,12 @@ require_paths:
|
|
154
169
|
- lib
|
155
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
171
|
requirements:
|
157
|
-
- -
|
172
|
+
- - ">="
|
158
173
|
- !ruby/object:Gem::Version
|
159
174
|
version: '0'
|
160
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
176
|
requirements:
|
162
|
-
- -
|
177
|
+
- - ">="
|
163
178
|
- !ruby/object:Gem::Version
|
164
179
|
version: '0'
|
165
180
|
requirements: []
|
@@ -167,5 +182,5 @@ rubyforge_project:
|
|
167
182
|
rubygems_version: 2.4.5
|
168
183
|
signing_key:
|
169
184
|
specification_version: 4
|
170
|
-
summary:
|
185
|
+
summary: This gem has been renamed active_model_jobs.
|
171
186
|
test_files: []
|