remove_reserved_keywords_extension 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 79865973d119e57a8753e4933a9610f3ffd01061d247aecc864b71b0eb29bad2
4
+ data.tar.gz: 9015e771bf3fed6793c413ae4106dcfa175a40c0682a19eb81531f5d34cd1db2
5
+ SHA512:
6
+ metadata.gz: a292ef42e47d41b89e8f2d9f355bcb5e14ef7a212da82f57cbd4dd4e7cc6aa814059bb79a3d209679188ec6e57f4a8a9193bbf968192fe42afcb0e6df05f3e2b
7
+ data.tar.gz: 5ab7e5b1e1b1da7bee75055562029deadfed899f8126a05bcb2fe114920c0df338c24c14d4b827c641df9139440e03ba275ede815a2b5d75ed303b435c4df061
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ Unreleased Changes
2
+ ------------------
3
+
4
+ 0.1.0 (2023-09-21)
5
+ ------------------
6
+
7
+ * Add support for ruby 2.5.3
8
+
9
+ 1.0.0 (2023-05-16)
10
+ ------------------
11
+
12
+ * Inital release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Marcus Wyatt
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/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ if defined?(ActiveJob::Base)
4
+ ActiveJob::Base.class_eval do
5
+ # Removes any reserved keywords that can't be passed along.
6
+ #
7
+ # @param arguments [...]
8
+ #
9
+ # @return [String, Numeric, Hash, Array, nil]
10
+ #
11
+ def remove_reserved_keywords(arguments)
12
+ case arguments
13
+ when String, Numeric
14
+ arguments
15
+ when Hash
16
+ arguments.each_with_object({}) do |(key, value), obj|
17
+ next if key.start_with?('_aj')
18
+
19
+ obj[key] = remove_reserved_keywords(value)
20
+ end
21
+ when Array
22
+ arguments.map do |arg|
23
+ remove_reserved_keywords(arg)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: remove_reserved_keywords_extension
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcus Wyatt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - mwyatt@brandsinsurance.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - CHANGELOG.md
21
+ - LICENSE.txt
22
+ - VERSION
23
+ - lib/remove_reserved_keywords_extension.rb
24
+ homepage: https://github.com/BrandsInsurance/rails-extensions
25
+ licenses:
26
+ - MIT
27
+ metadata:
28
+ rubygems_mfa_required: 'true'
29
+ source_code_uri: https://github.com/BrandsInsurance/rails-extensions/tree/main/gems/remove_reserved_keywords_extension
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: 2.5.3
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubygems_version: 3.0.3
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Add `remove_reserved_keywords` to ActiveJob::Base
49
+ test_files: []