active_model_jobs 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f45912ed69143a659a4f549b0324cb5e46a7d74b
4
- data.tar.gz: bf47d5d940ff43438e7bad79db0dd948a821988c
2
+ SHA256:
3
+ metadata.gz: 3d5d51b121fac8f97da88d4fde106b161c028597720c796389b268a5f3708576
4
+ data.tar.gz: 6d918ba5a66c5894e02d9039dfc898ed83d8cd3a732ce792f95e14a740078167
5
5
  SHA512:
6
- metadata.gz: 0c0f3e14db842962bda4b337a6e194d2a96671cd99e045b46cf2179ab8beb49b667f898da97e3d67b2a9ff24d67b3d0ab54e1d29cc3aa2d07d3b2f073643cff5
7
- data.tar.gz: eeae0f59463f7496ff4440ed24b2b15052300143a245e46435a05bccc099fabd1aa52cf008725af96b50615065fa7732c7d5fd4a3d8ade2059d9a10135305fe6
6
+ metadata.gz: 4ba71525672b619b49f2353f6ad22efebd21dd2b1905fd7dd02cd30606e0be0f9efbe457c9afce2e643bd119458451e896b6857a0ed495ea8cb421e787ab1f79
7
+ data.tar.gz: 9aa14ac5cf1656a7dfdb9d57891d797c8ba6117045d98e78442b6fc523023ad1ba714036256c7d51b9b373d054e8861ae293116952ecccf9f208442e78cbd1f3
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.3.8
data/README.md CHANGED
@@ -20,12 +20,23 @@ Add this line to your application's Gemfile:
20
20
  gem 'active_model-jobs'
21
21
  ```
22
22
 
23
- And then execute:
23
+ And then run:
24
24
 
25
25
  ```bash
26
26
  $ bundle
27
27
  ```
28
28
 
29
+ If you're using ActiveRecord, the `ActiveModel::Jobs` module will be
30
+ included in your models by default. For other ORMs or POROs that use
31
+ ActiveModel, you'll need to include the module yourself:
32
+
33
+ ```ruby
34
+ class Model
35
+ include ActiveModel::Model
36
+ include ActiveModel::Jobs
37
+ end
38
+ ```
39
+
29
40
  ## Usage
30
41
 
31
42
  Given we already have a model called **Track**, generate a job
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'active_model/jobs/version'
@@ -8,9 +10,9 @@ Gem::Specification.new do |spec|
8
10
  spec.authors = ["Tom Scott"]
9
11
  spec.email = ["tscott@weblinc.com"]
10
12
 
11
- spec.summary = "Enqueue ActiveJobs in your ActiveModel."
12
- spec.description = "#{spec.summary} Helps you call background jobs."
13
- spec.homepage = "http://github.com/tubbo/active_model-jobs"
13
+ spec.summary = 'Enqueue background jobs from model classes'
14
+ spec.description = spec.summary
15
+ spec.homepage = "http://github.com/tubbo/active_model_jobs"
14
16
  spec.license = "MIT"
15
17
 
16
18
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/all"
2
4
  require "active_model"
3
5
  require "active_model/jobs/version"
@@ -17,7 +19,7 @@ module ActiveModel
17
19
  # end
18
20
  module Jobs
19
21
  # Method suffix for actions.
20
- ACTION_SUFFIX = '!'.freeze
22
+ ACTION_SUFFIX = '!'
21
23
 
22
24
  # Call +perform_later+ on an ActiveJob class corresponding to an
23
25
  # undefined action method name. Most of the work here is done in the
@@ -33,6 +35,7 @@ module ActiveModel
33
35
  performer = Performer.new method, model_name
34
36
  return super unless respond_to?(method) && performer.job?
35
37
 
38
+ self.class.define_method(method) { performer.call self }
36
39
  performer.call self
37
40
  end
38
41
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActiveModel
2
4
  module Jobs
3
5
  # Automatically includes ActiveModel::Jobs into a Rails app
@@ -2,6 +2,6 @@
2
2
  module ActiveModel
3
3
  module Jobs
4
4
  # @type [String]
5
- VERSION = "0.2.1".freeze
5
+ VERSION = "0.2.2".freeze
6
6
  end
7
7
  end
@@ -0,0 +1 @@
1
+ require 'active_model/jobs'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Scott
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: 5.0.0
125
- description: Enqueue ActiveJobs in your ActiveModel. Helps you call background jobs.
125
+ description: Enqueue background jobs from model classes
126
126
  email:
127
127
  - tscott@weblinc.com
128
128
  executables: []
@@ -159,7 +159,8 @@ files:
159
159
  - lib/active_model/jobs/engine.rb
160
160
  - lib/active_model/jobs/performer.rb
161
161
  - lib/active_model/jobs/version.rb
162
- homepage: http://github.com/tubbo/active_model-jobs
162
+ - lib/active_model_jobs.rb
163
+ homepage: http://github.com/tubbo/active_model_jobs
163
164
  licenses:
164
165
  - MIT
165
166
  metadata: {}
@@ -178,9 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
179
  - !ruby/object:Gem::Version
179
180
  version: '0'
180
181
  requirements: []
181
- rubyforge_project:
182
- rubygems_version: 2.4.5
182
+ rubygems_version: 3.0.4
183
183
  signing_key:
184
184
  specification_version: 4
185
- summary: Enqueue ActiveJobs in your ActiveModel.
185
+ summary: Enqueue background jobs from model classes
186
186
  test_files: []