active_job-rnf 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 21ab1c45c17d498f4c8e3691f28179b626cb4c6a
4
+ data.tar.gz: 610bf0b1deb7c8b2556f2daeace5717c8231c9f1
5
+ SHA512:
6
+ metadata.gz: c709417d241d7baaf98a49eafadb842e19d52cbd23b3d404aea7879e174b1be654fd3564190ff3e457fe8c933417fb274cddad7a91dae00ef75a31a15b51a9ab
7
+ data.tar.gz: 03ee8976803b7851ae709cb00d39c34fecf848bfa816d0573ab3283c70205d1eaaaa6cec3da70f9515b12604e6d7e88c7d05c919c842b93082bc1c498c4a0aa8
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015
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 ADDED
@@ -0,0 +1,19 @@
1
+ # ActiveJob::RNF [![Build Status](https://travis-ci.org/Absolventa/active_job-rnf.svg?branch=master)](https://travis-ci.org/Absolventa/active_job-rnf)
2
+
3
+ Based on the assumption that a queued job has lost its raison d'être when
4
+ its argument had been deleted, **ActiveJob::RNF** ignores deserialization errors
5
+ originating from a failed attempt to load that resource.
6
+
7
+ ## Usage
8
+
9
+ Add this to your Gemfile:
10
+
11
+ ```
12
+ gem 'active_job-rnf'
13
+ ```
14
+
15
+ It will automatically infect ActiveJob::Base.
16
+
17
+ ## Changelog
18
+
19
+ See [releases](https://github.com/Absolventa/active_job-rnf/releases).
data/Rakefile ADDED
@@ -0,0 +1,33 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'ActiveJobRnf'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+
31
+ RSpec::Core::RakeTask.new(:spec)
32
+
33
+ task default: :spec
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,10 @@
1
+ module ActiveJob
2
+ module RNF
3
+ class Engine < ::Rails::Engine
4
+
5
+ config.to_prepare do
6
+ ActiveJob::Base.send :include, ActiveJob::RNF
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module ActiveJob
2
+ module RNF
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,19 @@
1
+ require "active_job/rnf/engine"
2
+
3
+ module ActiveJob
4
+ module RNF
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ rescue_from ActiveJob::DeserializationError do |exception|
9
+ case exception.original_exception
10
+ when ActiveRecord::RecordNotFound
11
+ # NOOP
12
+ else
13
+ raise exception
14
+ end
15
+ end
16
+ end
17
+
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_job-rnf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Carsten Zimmermann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.3
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 4.2.3
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: sqlite3
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ description: |
62
+ Assuming that a queued job has lost its raison d'être when its argument had been deleted, ActiveJob::RNF ignores deserialization errors originating from a failed attempt to load that resource.
63
+ email:
64
+ - cz@aegisnet.de
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - MIT-LICENSE
70
+ - README.md
71
+ - Rakefile
72
+ - config/routes.rb
73
+ - lib/active_job/rnf.rb
74
+ - lib/active_job/rnf/engine.rb
75
+ - lib/active_job/rnf/version.rb
76
+ homepage:
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.8
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Silently ignores ActiveRecord::RecordNotFound errors for ActiveJob deserialization
100
+ test_files: []