apple_core 1.4.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.txt +1 -1
- data/lib/apple_core/action_controller/resource_naming.rb +25 -15
- data/lib/apple_core/action_view/helpers/web_client_url.rb +2 -2
- data/lib/apple_core/extensions/class.rb +75 -0
- data/lib/apple_core/extensions/module.rb +27 -0
- data/lib/apple_core/railtie.rb +1 -1
- data/lib/apple_core/refinements/array.rb +10 -0
- data/lib/apple_core/refinements/hash.rb +30 -2
- data/lib/apple_core/refinements/query_string.rb +2 -3
- data/lib/apple_core/refinements/string.rb +29 -4
- data/lib/apple_core/transforms/enumerable.rb +44 -0
- data/lib/apple_core/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +50 -48
- metadata.gz.sig +3 -3
- data/lib/apple_core/transforms/hash.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c40a5b372905916425dd19e632021cc5765c36cbd770fc871ac4beda6fbb7d88
|
4
|
+
data.tar.gz: f30d36a336ab0e581d90cb9d46d450ac39f60d370ef90197ca4eb1b94c28d63f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72975af18240f6f9b75fbf1be5bffc6242798c048f6c8c76ef43a8e8d4d97cf52daf95d24f7d164bd8eb0768312c36f23c7c18b054781ab107bef7198a72132
|
7
|
+
data.tar.gz: 59382352830dc209dceda921009d4c458f50b580b865abb6894a862496ef02a86963c1cbee8078db665dee4dd0747341f75d8672a80e887f89e563c7d68546a5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/LICENSE.txt
CHANGED
@@ -7,38 +7,48 @@ module ActionController
|
|
7
7
|
module ResourceNaming
|
8
8
|
using ::AppleCore::Refinements::String
|
9
9
|
|
10
|
+
# rubocop:disable Lint/MixedRegexpCaptureTypes
|
10
11
|
CONTROLLER_RESOURCE_NAME_PATTERN = /
|
11
12
|
\A # Beginning of String
|
12
13
|
(?:
|
13
14
|
(?<modules> # Full Modules
|
14
15
|
(?: # Match Root Module (Optional)
|
15
16
|
(?<root_module>
|
16
|
-
[
|
17
|
-
(
|
17
|
+
[^:]+ # The Module Name
|
18
|
+
(?=::) # Which Must Be Followed By '::'
|
18
19
|
)
|
19
|
-
(
|
20
|
+
(?:::)? # Up Through the '::' But Don't
|
20
21
|
# Capture If It's The Sole Module
|
21
22
|
)?
|
23
|
+
( # There Can Be A Version
|
24
|
+
V # A Literal V
|
25
|
+
(?<version>
|
26
|
+
\d+ # The Version Number
|
27
|
+
)
|
28
|
+
(?:::)? # Up Through the '::' But Don't
|
29
|
+
# Capture If It's The Sole Module
|
30
|
+
)?
|
22
31
|
(?<submodules> # Match Submodule List (Optional)
|
23
32
|
( # There May Be Zero or More of These
|
24
|
-
[
|
25
|
-
|
33
|
+
[^:]+ # The Module Name
|
34
|
+
:: # Up Through the '::'
|
26
35
|
)*?
|
27
36
|
(?<last_submodule> # The Final Submodule (Optional)
|
28
|
-
[
|
29
|
-
(
|
37
|
+
[^:]+ # The Module Name
|
38
|
+
(?=::) # Which Must Be Followed By '::'
|
30
39
|
)?
|
31
40
|
)?
|
32
41
|
)
|
33
|
-
|
42
|
+
:: # Required Final Separator
|
34
43
|
)?
|
35
44
|
(?<controller_name>
|
36
|
-
(?<
|
45
|
+
(?<base_resource_name>\w+?) # Base Resource Name
|
37
46
|
(?:Index|Indicies)? # Optional Index Suffix
|
38
47
|
)
|
39
48
|
Controller # Literal 'Controller'
|
40
49
|
\z # End of String
|
41
50
|
/x
|
51
|
+
# rubocop:enable Lint/MixedRegexpCaptureTypes
|
42
52
|
|
43
53
|
def self.included(base)
|
44
54
|
base.extend(self)
|
@@ -62,14 +72,14 @@ module ResourceNaming
|
|
62
72
|
end
|
63
73
|
|
64
74
|
def plural_resource_base_class_name
|
65
|
-
@plural_resource_base_class_name ||=
|
75
|
+
@plural_resource_base_class_name ||= base_resource_name
|
66
76
|
.pluralize
|
67
77
|
end
|
68
78
|
|
69
79
|
def singular_resource_class_name
|
70
80
|
@singular_resource_class_name ||= [
|
71
|
-
name_components['
|
72
|
-
|
81
|
+
name_components['modules'],
|
82
|
+
base_resource_name,
|
73
83
|
]
|
74
84
|
.compact
|
75
85
|
.join('::')
|
@@ -84,9 +94,9 @@ module ResourceNaming
|
|
84
94
|
@name_components ||= name.match(CONTROLLER_RESOURCE_NAME_PATTERN).named_captures
|
85
95
|
end
|
86
96
|
|
87
|
-
def
|
88
|
-
@
|
89
|
-
|
97
|
+
def base_resource_name
|
98
|
+
@base_resource_name ||= name_components['base_resource_name']
|
99
|
+
.singularize
|
90
100
|
end
|
91
101
|
end
|
92
102
|
end
|
@@ -9,7 +9,7 @@ module Helpers
|
|
9
9
|
module WebClientUrl
|
10
10
|
using ::AppleCore::Refinements::QueryString
|
11
11
|
|
12
|
-
# rubocop:disable Metrics/AbcSize
|
12
|
+
# rubocop:disable Metrics/AbcSize
|
13
13
|
def web_client_url(**options)
|
14
14
|
route_name = options.delete(:name)
|
15
15
|
|
@@ -48,7 +48,7 @@ module WebClientUrl
|
|
48
48
|
|
49
49
|
URI::HTTPS.new(*arguments).to_s
|
50
50
|
end
|
51
|
-
# rubocop:enable Metrics/AbcSize
|
51
|
+
# rubocop:enable Metrics/AbcSize
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Stolen from https://github.com/rails/rails/blob/94ca3e0a571dba0fe41ca18d61634c5f3aa11209/activesupport/lib/active_support/core_ext/class/attribute.rb
|
5
|
+
# and https://github.com/rails/rails/blob/94ca3e0a571dba0fe41ca18d61634c5f3aa11209/activesupport/lib/active_support/core_ext/module/remove_method.rb
|
6
|
+
|
7
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
8
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
9
|
+
# rubocop:disable Style/Send, Style/GuardClause, Metrics/BlockNesting
|
10
|
+
# rubocop:disable Style/OptionHash
|
11
|
+
module AppleCore
|
12
|
+
module Extensions
|
13
|
+
module Class
|
14
|
+
module ClassMethods
|
15
|
+
def class_attribute(method_name, options = {})
|
16
|
+
instance_reader = options.fetch(:instance_accessor, true) &&
|
17
|
+
options.fetch(:instance_reader, true)
|
18
|
+
instance_writer = options.fetch(:instance_accessor, true) &&
|
19
|
+
options.fetch(:instance_writer, true)
|
20
|
+
|
21
|
+
remove_possible_singleton_method(method_name)
|
22
|
+
define_singleton_method(method_name) { options[:default] }
|
23
|
+
|
24
|
+
ivar = "@#{method_name}"
|
25
|
+
|
26
|
+
remove_possible_singleton_method("#{method_name}=")
|
27
|
+
define_singleton_method("#{method_name}=") do |val|
|
28
|
+
singleton_class.class_eval do
|
29
|
+
remove_possible_method(method_name)
|
30
|
+
define_method(method_name) { val }
|
31
|
+
end
|
32
|
+
|
33
|
+
if singleton_class?
|
34
|
+
class_eval do
|
35
|
+
remove_possible_method(method_name)
|
36
|
+
define_method(method_name) do
|
37
|
+
if instance_variable_defined? ivar
|
38
|
+
instance_variable_get ivar
|
39
|
+
else
|
40
|
+
singleton_class.send method_name
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
val
|
46
|
+
end
|
47
|
+
|
48
|
+
if instance_reader
|
49
|
+
remove_possible_method method_name
|
50
|
+
define_method(method_name) do
|
51
|
+
if instance_variable_defined?(ivar)
|
52
|
+
instance_variable_get ivar
|
53
|
+
else
|
54
|
+
self.class.public_send method_name
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if instance_writer
|
60
|
+
remove_possible_method "#{method_name}="
|
61
|
+
attr_writer method_name
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.included(base)
|
67
|
+
base.extend(ClassMethods)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
# rubocop:enable Style/OptionHash
|
73
|
+
# rubocop:enable Style/Send, Style/GuardClause, Metrics/BlockNesting
|
74
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
75
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Stolen from https://github.com/rails/rails/blob/94ca3e0a571dba0fe41ca18d61634c5f3aa11209/activesupport/lib/active_support/core_ext/class/attribute.rb
|
5
|
+
# and https://github.com/rails/rails/blob/94ca3e0a571dba0fe41ca18d61634c5f3aa11209/activesupport/lib/active_support/core_ext/module/remove_method.rb
|
6
|
+
|
7
|
+
class Module
|
8
|
+
def remove_possible_method(method)
|
9
|
+
return unless method_defined?(method) || private_method_defined?(method)
|
10
|
+
|
11
|
+
undef_method(method)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Removes the named singleton method, if it exists.
|
15
|
+
def remove_possible_singleton_method(method)
|
16
|
+
singleton_class.instance_eval do
|
17
|
+
remove_possible_method(method)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Replaces the existing method definition, if there is one, with the passed
|
22
|
+
# block as its body.
|
23
|
+
def redefine_method(method, &block)
|
24
|
+
remove_possible_method(method)
|
25
|
+
define_method(method, &block)
|
26
|
+
end
|
27
|
+
end
|
data/lib/apple_core/railtie.rb
CHANGED
@@ -5,7 +5,7 @@ require 'apple_core/action_view/helpers/web_client_url'
|
|
5
5
|
module AppleCore
|
6
6
|
class Railtie < Rails::Railtie
|
7
7
|
initializer 'web_client_url.helper' do |_app|
|
8
|
-
::ActionView::Base.
|
8
|
+
::ActionView::Base.include AppleCore::ActionView::Helpers::WebClientUrl
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'apple_core/transforms/enumerable'
|
4
|
+
|
3
5
|
module AppleCore
|
4
6
|
module Refinements
|
5
7
|
module Array
|
@@ -33,6 +35,14 @@ refine ::Array do
|
|
33
35
|
{}
|
34
36
|
end
|
35
37
|
end
|
38
|
+
|
39
|
+
def deep_transform_keys(&block)
|
40
|
+
Transforms::Enumerable.deep_transform_keys(self, &block)
|
41
|
+
end
|
42
|
+
|
43
|
+
def deep_transform_values(&block)
|
44
|
+
Transforms::Enumerable.deep_transform_values(nil, self, &block)
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|
38
48
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'apple_core/transforms/
|
3
|
+
require 'apple_core/transforms/enumerable'
|
4
4
|
|
5
5
|
module AppleCore
|
6
6
|
module Refinements
|
@@ -17,7 +17,35 @@ refine ::Hash do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def deep_underscore_keys
|
20
|
-
Transforms::
|
20
|
+
Transforms::Enumerable.deep_underscore_keys(self)
|
21
|
+
end
|
22
|
+
|
23
|
+
def deep_transform_keys(&block)
|
24
|
+
Transforms::Enumerable.deep_transform_keys(self, &block)
|
25
|
+
end
|
26
|
+
|
27
|
+
def deep_transform_values(&block)
|
28
|
+
Transforms::Enumerable.deep_transform_values(nil, self, &block)
|
29
|
+
end
|
30
|
+
|
31
|
+
unless method_defined?(:deep_merge)
|
32
|
+
def deep_merge(other, &block)
|
33
|
+
dup.deep_merge!(other, &block)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
unless method_defined?(:deep_merge!)
|
38
|
+
def deep_merge!(other, &block)
|
39
|
+
merge!(other) do |key, value_1, value_2|
|
40
|
+
if value_1.is_a?(::Hash) && value_2.is_a?(::Hash)
|
41
|
+
value_1.deep_merge(value_2, &block)
|
42
|
+
elsif block
|
43
|
+
yield(key, value_1, value_2)
|
44
|
+
else
|
45
|
+
value_2
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
21
49
|
end
|
22
50
|
|
23
51
|
unless method_defined?(:slice)
|
@@ -29,12 +29,11 @@ end
|
|
29
29
|
refine ::Hash do
|
30
30
|
unless method_defined?(:to_param)
|
31
31
|
def to_param(namespace = nil)
|
32
|
-
|
33
|
-
|
32
|
+
filter_map { |key, value|
|
33
|
+
if (!value.is_a?(Hash) && !value.is_a?(Array)) || !value.empty?
|
34
34
|
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
35
35
|
end
|
36
36
|
}
|
37
|
-
.compact
|
38
37
|
.sort!
|
39
38
|
.join('&')
|
40
39
|
end
|
@@ -12,6 +12,16 @@ refine ::String do
|
|
12
12
|
only_digits? ? to_i(base) : nil
|
13
13
|
end
|
14
14
|
|
15
|
+
def indent(*args)
|
16
|
+
dup.tap { |v| v.indent!(*args) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def indent!(amount, indent_string = nil, indent_empty_lines = false) # rubocop:disable Style/OptionalBooleanParameter
|
20
|
+
indent_string = indent_string || self[/^[ \t]/] || ' '
|
21
|
+
regex = indent_empty_lines ? /^/ : /^(?!$)/
|
22
|
+
gsub!(regex, indent_string * amount)
|
23
|
+
end
|
24
|
+
|
15
25
|
unless defined?(ActiveSupport::Inflector)
|
16
26
|
# rubocop:disable Style/PerlBackrefs
|
17
27
|
def camelize(first_letter_casing = :upper)
|
@@ -33,7 +43,23 @@ refine ::String do
|
|
33
43
|
end
|
34
44
|
# rubocop:enable Style/PerlBackrefs
|
35
45
|
|
36
|
-
|
46
|
+
def constantize
|
47
|
+
names = split('::')
|
48
|
+
names.shift if names.empty? || names.first.empty?
|
49
|
+
|
50
|
+
constant = Object
|
51
|
+
|
52
|
+
names.each do |name|
|
53
|
+
constant = if constant.const_defined?(name)
|
54
|
+
constant.const_get(name)
|
55
|
+
else
|
56
|
+
constant.const_missing(name)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
constant
|
61
|
+
end
|
62
|
+
|
37
63
|
def pluralize
|
38
64
|
result = to_s.dup
|
39
65
|
|
@@ -73,9 +99,8 @@ refine ::String do
|
|
73
99
|
|
74
100
|
result
|
75
101
|
end
|
76
|
-
# rubocop:enable Metrics/MethodLength
|
77
102
|
|
78
|
-
# rubocop:disable
|
103
|
+
# rubocop:disable Layout/HashAlignment
|
79
104
|
def singularize
|
80
105
|
result = to_s.dup
|
81
106
|
|
@@ -127,7 +152,7 @@ refine ::String do
|
|
127
152
|
|
128
153
|
result
|
129
154
|
end
|
130
|
-
# rubocop:enable
|
155
|
+
# rubocop:enable Layout/HashAlignment
|
131
156
|
|
132
157
|
def underscore
|
133
158
|
word = gsub('::', '/')
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'apple_core/refinements/string'
|
4
|
+
|
5
|
+
module AppleCore
|
6
|
+
module Transforms
|
7
|
+
class Enumerable
|
8
|
+
using ::AppleCore::Refinements::String
|
9
|
+
|
10
|
+
def self.deep_underscore_keys(other)
|
11
|
+
deep_transform_keys(other, &:underscore)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.deep_transform_keys(object, &block)
|
15
|
+
case object
|
16
|
+
when ::Hash
|
17
|
+
object.each_with_object({}) do |(key, value), result|
|
18
|
+
result[yield(key)] = deep_transform_keys(value, &block)
|
19
|
+
end
|
20
|
+
when ::Array
|
21
|
+
object.map { |e| deep_transform_keys(e, &block) }
|
22
|
+
else
|
23
|
+
object
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.deep_transform_values(key, value, &block)
|
28
|
+
case value
|
29
|
+
when ::Hash
|
30
|
+
value.each_with_object({}) do |(k, v), memo|
|
31
|
+
memo[k] = deep_transform_values(k, v, &block)
|
32
|
+
end
|
33
|
+
when ::Array
|
34
|
+
yield(
|
35
|
+
key,
|
36
|
+
value.map { |v| deep_transform_values(nil, v, &block) }
|
37
|
+
)
|
38
|
+
else
|
39
|
+
yield(key, value)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/apple_core/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -10,83 +10,77 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEyjCCAzKgAwIBAgIBATANBgkqhkiG9w0BAQsFADBVMSIwIAYDVQQDDBlsb2Nh
|
14
|
+
bGV1bmtub3duODEwX3J1YnlnZW1zMRowGAYKCZImiZPyLGQBGRYKcHJvdG9ubWFp
|
15
|
+
bDETMBEGCgmSJomT8ixkARkWA2NvbTAeFw0yMjA3MDkwNTMxMjJaFw0yMzA3MDkw
|
16
|
+
NTMxMjJaMFUxIjAgBgNVBAMMGWxvY2FsZXVua25vd244MTBfcnVieWdlbXMxGjAY
|
17
|
+
BgoJkiaJk/IsZAEZFgpwcm90b25tYWlsMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
|
18
|
+
ojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0otlhSPyU7jLLW1p786Mo/pV
|
19
|
+
5cJ1Ed8D/bJK78PqGFO2h0ZUefupxT5PRMokLYNNGRPopnAAxZ0zVxJ68aOyYCBW
|
20
|
+
Wk3/XFcXCrtk/OcFwLTltgeMjyqCBd/zRRx6CCjY4uOfH0E3n1gQ6Fbmewjg83XJ
|
21
|
+
nOs7Gu/hzj5+feEQ1Exmg6z1oCM/8BTIBtK+p++HvcDK3AhJ7x3fc6P9WS+22w6j
|
22
|
+
7jpi3p9YtoAjrXIzw3lsobiX+bEt+N+T47e8gOATVgapuZ/QmJzNU6LWepehs4V1
|
23
|
+
8J+FUaIMV7nAMKmpkbYL51uHEiGV+HDx1HUdOsCFx8zD4h49KRT2t6AcumJ5P1Cj
|
24
|
+
c7NX2xl85ShHDNNFkozuC2c5cwj6F20EVaVjGwv2OFq0S2tUw9EJXHTN9RpfRUmn
|
25
|
+
IHwS9M4gcJO7IzV39a1YL6+9hrabF4+JTSYDehq8oxTdcOPLYyvH54aJWVqCrnLO
|
26
|
+
KNa/p6hMmwxTWNS5Vz0uxuEGyE9E0tHbtjIs2XX5AgMBAAGjgaQwgaEwCQYDVR0T
|
27
|
+
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFAK3RicwO0f6+puFN6lRVMOKMJuu
|
28
|
+
MDMGA1UdEQQsMCqBKGxvY2FsZXVua25vd244MTArcnVieWdlbXNAcHJvdG9ubWFp
|
29
|
+
bC5jb20wMwYDVR0SBCwwKoEobG9jYWxldW5rbm93bjgxMCtydWJ5Z2Vtc0Bwcm90
|
30
|
+
b25tYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAQwV6pOp5gm8141pyXeQFI/5E
|
31
|
+
rZYO3MvdyZM8O3HMD51LDS8mtMURceaKZM6WTambe2RVX4A++0qUiEnn9K4Fexm/
|
32
|
+
SEGaC/Gp+Fg9D1SKfkdq9bgdIhOEUwiGqjczgzNC806AtWZ+awI940oydFYZlpo0
|
33
|
+
jMQihPPJEqF1U6JBDMZYV5tX/dJYSGRl9L3s1k2tjoN98q+beNaZQDn21Amml4eK
|
34
|
+
KEkMeTTJ2E4GVzR9eKEETLq2LygdUWWZ5NdWOYTxJMdg1GZp3b6X8hJrwfOiizqt
|
35
|
+
/ANlIEh11/pOnWa6WPUVpGIMpYdquvmJXnF2LX6zxkKK1hbrebt+vAEAGczgw1Ri
|
36
|
+
rkLM6y+BHQdkOTj3VG4MjIU8D4h1Z73Exzxds/VbVKMEz+8JrFjGJ/tYa0PZ8U5p
|
37
|
+
3yXL4G6eW3rdBW/OiLF7GgG2o26d02OMzf4+ubUVS5LQDOcd4vgNPLWzJSBt1YIh
|
38
|
+
TgBsED7Me5YdMVXxtTWYsF1VMzaL9hReD3UXGcxe
|
33
39
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
40
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
35
41
|
dependencies:
|
36
42
|
- !ruby/object:Gem::Dependency
|
37
43
|
name: activemodel
|
38
44
|
requirement: !ruby/object:Gem::Requirement
|
39
45
|
requirements:
|
40
|
-
- - "
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '6.0'
|
43
|
-
- - ">="
|
46
|
+
- - "~>"
|
44
47
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
48
|
+
version: '7.0'
|
46
49
|
type: :development
|
47
50
|
prerelease: false
|
48
51
|
version_requirements: !ruby/object:Gem::Requirement
|
49
52
|
requirements:
|
50
|
-
- - "
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '6.0'
|
53
|
-
- - ">="
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '7.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activerecord
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '6.0'
|
63
|
-
- - ">="
|
60
|
+
- - "~>"
|
64
61
|
- !ruby/object:Gem::Version
|
65
|
-
version: '
|
62
|
+
version: '7.0'
|
66
63
|
type: :development
|
67
64
|
prerelease: false
|
68
65
|
version_requirements: !ruby/object:Gem::Requirement
|
69
66
|
requirements:
|
70
|
-
- - "
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '6.0'
|
73
|
-
- - ">="
|
67
|
+
- - "~>"
|
74
68
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
69
|
+
version: '7.0'
|
76
70
|
- !ruby/object:Gem::Dependency
|
77
71
|
name: rspec
|
78
72
|
requirement: !ruby/object:Gem::Requirement
|
79
73
|
requirements:
|
80
74
|
- - "~>"
|
81
75
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
76
|
+
version: '3.11'
|
83
77
|
type: :development
|
84
78
|
prerelease: false
|
85
79
|
version_requirements: !ruby/object:Gem::Requirement
|
86
80
|
requirements:
|
87
81
|
- - "~>"
|
88
82
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
83
|
+
version: '3.11'
|
90
84
|
- !ruby/object:Gem::Dependency
|
91
85
|
name: rspeckled
|
92
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +110,8 @@ files:
|
|
116
110
|
- lib/apple_core/active_model/errors.rb
|
117
111
|
- lib/apple_core/active_model/validations/inclusion_validator.rb
|
118
112
|
- lib/apple_core/active_record/base.rb
|
113
|
+
- lib/apple_core/extensions/class.rb
|
114
|
+
- lib/apple_core/extensions/module.rb
|
119
115
|
- lib/apple_core/railtie.rb
|
120
116
|
- lib/apple_core/refinements/array.rb
|
121
117
|
- lib/apple_core/refinements/deep_dup.rb
|
@@ -123,13 +119,20 @@ files:
|
|
123
119
|
- lib/apple_core/refinements/integer.rb
|
124
120
|
- lib/apple_core/refinements/query_string.rb
|
125
121
|
- lib/apple_core/refinements/string.rb
|
126
|
-
- lib/apple_core/transforms/
|
122
|
+
- lib/apple_core/transforms/enumerable.rb
|
127
123
|
- lib/apple_core/version.rb
|
128
|
-
homepage: https://
|
124
|
+
homepage: https://github.com/thekompanee/apple_core
|
129
125
|
licenses:
|
130
126
|
- MIT
|
131
127
|
metadata:
|
132
128
|
allowed_push_host: https://rubygems.org
|
129
|
+
bug_tracker_uri: https://github.com/thekompanee/apple_core/issues
|
130
|
+
changelog_uri: https://github.com/thekompanee/apple_core/blob/master/CHANGELOG.md
|
131
|
+
documentation_uri: https://github.com/thekompanee/apple_core/tree/releases/v1.5.0
|
132
|
+
homepage_uri: https://github.com/thekompanee/apple_core
|
133
|
+
source_code_uri: https://github.com/thekompanee/apple_core
|
134
|
+
wiki_uri: https://github.com/thekompanee/apple_core/wiki
|
135
|
+
rubygems_mfa_required: 'true'
|
133
136
|
post_install_message:
|
134
137
|
rdoc_options: []
|
135
138
|
require_paths:
|
@@ -145,8 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
148
|
- !ruby/object:Gem::Version
|
146
149
|
version: '0'
|
147
150
|
requirements: []
|
148
|
-
|
149
|
-
rubygems_version: 2.7.7
|
151
|
+
rubygems_version: 3.3.7
|
150
152
|
signing_key:
|
151
153
|
specification_version: 4
|
152
154
|
summary: Non-Active Support
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
wŰmh�[�TO5���[����X���KY��>Č#�pv?��G��G����M=���찝������,��<��8�����
|
2
|
+
l�`��%��B�
|
3
|
+
��k�����B�P9���/�S��l1�1o�9����è�lCŔ���AVwK����g�\&N���׃�wͦ�~缗Y�`Od9��t棗f�QጤG�4�M��b���tV����4N̒CiIL�u]����"B��_w'h���%S��ŞD��w/�t�ޑ��&T<0�{�K�HZ�ʒF�b�(���f!��^R.9l���Bkۅ��4I�O?."�H�Q�����k�dyEň�#�m,ӝw<_K��c�\�J�*
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'apple_core/refinements/string'
|
4
|
-
|
5
|
-
module AppleCore
|
6
|
-
module Transforms
|
7
|
-
class Hash
|
8
|
-
using ::AppleCore::Refinements::String
|
9
|
-
|
10
|
-
def self.deep_underscore_keys(other)
|
11
|
-
return other unless other.is_a? ::Hash
|
12
|
-
|
13
|
-
other.each_with_object({}) do |(key, value), hash|
|
14
|
-
value = case value
|
15
|
-
when ::Hash
|
16
|
-
deep_underscore_keys(value)
|
17
|
-
when ::Array
|
18
|
-
value.map do |item|
|
19
|
-
deep_underscore_keys(item)
|
20
|
-
end
|
21
|
-
else
|
22
|
-
value
|
23
|
-
end
|
24
|
-
|
25
|
-
hash[key.to_s.underscore] = value
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|