remove_reserved_keywords_extension 1.0.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: 1f6f4bd52009c7cb64a5db80a97d04e5b65695d91cd50d18a1603a8a57d29871
4
+ data.tar.gz: 5f8b0fcdcd0372ad99a639156a4d7d2c33bf2e351d00153254393482aaf0524c
5
+ SHA512:
6
+ metadata.gz: bccc90dbb11a93087b190f3baef88ff389de0d5e1526c00d3f8df1888204b17e5adb20fc3d1bc98a9be7b09643363ba7b7211e2f914f7a6d18a6dd8690f6c37e
7
+ data.tar.gz: 33c69746888e2ecf61117c28281816ef89c5cb2cdc47142520e9acbd9decec4fac6115dfef42d43858f4799791ce05c87dd4ba7025587a7ea2d2c28bf695ee59
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ Unreleased Changes
2
+ ------------------
3
+
4
+ 1.0.0 (2023-05-16)
5
+ ------------------
6
+
7
+ * 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
+ 1.0.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: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcus Wyatt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-05-16 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: 3.0.1
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.2.15
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Add `remove_reserved_keywords` to ActiveJob::Base
49
+ test_files: []