eac_ruby_utils 0.134.1 → 0.135.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 +4 -4
- data/lib/eac_ruby_utils/acts_as_static_method.rb +12 -0
- data/lib/eac_ruby_utils/patches/{module → class}/acts_as_instance_method.rb +1 -1
- data/lib/eac_ruby_utils/patches/class/acts_as_static_method.rb +11 -0
- data/lib/eac_ruby_utils/patches/class/method_class.rb +4 -3
- data/lib/eac_ruby_utils/patches/class/static_method_class.rb +6 -3
- data/lib/eac_ruby_utils/root_module_setup/ignore.rb +1 -1
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +4 -4
- data/lib/eac_ruby_utils/method_class.rb +0 -32
- data/lib/eac_ruby_utils/static_method_class.rb +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc1e150b4e8ed829455992df481d412ab8c9a5c76a64447ab33ee309fa424c9e
|
|
4
|
+
data.tar.gz: a8702f9113ebdaf78780a693bdbf2c4081222770add23c68a9155e60dbe11ba7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2a40c816b22aeb22a475e217f3e5319b88482f6a6370f3af634caacb4571bfa8c4159daf15c5402685c50dad513b262b258f0a92ff857496423e60e0dbde365
|
|
7
|
+
data.tar.gz: 539c73fb55b97e18f64d2f8409ae759c743d1fd326aa0b853f7868dddb71dede562707797378c42b4a9e3588fb2d3ea4f1c9fb8dc3f370a1f51ef9390b628b85
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/acts_as_instance_method'
|
|
4
|
+
|
|
5
|
+
module EacRubyUtils
|
|
6
|
+
class ActsAsStaticMethod < ::EacRubyUtils::ActsAsInstanceMethod
|
|
7
|
+
# @return [Module]
|
|
8
|
+
def default_sender_module
|
|
9
|
+
method_class.module_parent.singleton_class
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/acts_as_static_method'
|
|
4
|
+
|
|
5
|
+
class Class
|
|
6
|
+
# @param options [Hash]
|
|
7
|
+
# @return [EacRubyUtils::ActsAsStaticMethod]
|
|
8
|
+
def acts_as_static_method(**options)
|
|
9
|
+
::EacRubyUtils::ActsAsStaticMethod.new(self, options).setup
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'eac_ruby_utils/
|
|
3
|
+
require 'eac_ruby_utils/acts_as_instance_method'
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class Class
|
|
6
|
+
# @deprecated Use {#acts_as_instance_method} instead.
|
|
6
7
|
def enable_method_class
|
|
7
|
-
|
|
8
|
+
acts_as_instance_method
|
|
8
9
|
end
|
|
9
10
|
end
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'eac_ruby_utils/
|
|
3
|
+
require 'eac_ruby_utils/patches/class/acts_as_static_method'
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class Class
|
|
6
|
+
# @return [EacRubyUtils::ActsAsStaticMethod]
|
|
7
|
+
# @deprecated Use {#acts_as_static_method} instead.
|
|
6
8
|
def enable_static_method_class
|
|
7
|
-
::EacRubyUtils.
|
|
9
|
+
::EacRubyUtils::ActsAsStaticMethod.new(self).setup
|
|
10
|
+
acts_as_static_method
|
|
8
11
|
end
|
|
9
12
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'eac_ruby_utils/patches/
|
|
3
|
+
require 'eac_ruby_utils/patches/class/acts_as_instance_method'
|
|
4
4
|
require 'eac_ruby_utils/patches/object/to_pathname'
|
|
5
5
|
require 'eac_ruby_utils/patches/pathname/basename_sub'
|
|
6
6
|
require 'memoized'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_ruby_utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.135.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esquilo Azul Company
|
|
@@ -185,6 +185,7 @@ files:
|
|
|
185
185
|
- lib/eac_ruby_utils/acts_as_immutable/instance_methods.rb
|
|
186
186
|
- lib/eac_ruby_utils/acts_as_immutable/set_accessor.rb
|
|
187
187
|
- lib/eac_ruby_utils/acts_as_instance_method.rb
|
|
188
|
+
- lib/eac_ruby_utils/acts_as_static_method.rb
|
|
188
189
|
- lib/eac_ruby_utils/arguments_consumer.rb
|
|
189
190
|
- lib/eac_ruby_utils/bit.rb
|
|
190
191
|
- lib/eac_ruby_utils/bit_array.rb
|
|
@@ -258,7 +259,6 @@ files:
|
|
|
258
259
|
- lib/eac_ruby_utils/locales/from_all_gems.rb
|
|
259
260
|
- lib/eac_ruby_utils/locales/from_gem.rb
|
|
260
261
|
- lib/eac_ruby_utils/locales/module_i18n_translate.rb
|
|
261
|
-
- lib/eac_ruby_utils/method_class.rb
|
|
262
262
|
- lib/eac_ruby_utils/module_ancestors_variable.rb
|
|
263
263
|
- lib/eac_ruby_utils/module_ancestors_variable/base.rb
|
|
264
264
|
- lib/eac_ruby_utils/module_ancestors_variable/hash.rb
|
|
@@ -272,6 +272,8 @@ files:
|
|
|
272
272
|
- lib/eac_ruby_utils/patches/addressable/uri/query_value.rb
|
|
273
273
|
- lib/eac_ruby_utils/patches/class.rb
|
|
274
274
|
- lib/eac_ruby_utils/patches/class/abstract.rb
|
|
275
|
+
- lib/eac_ruby_utils/patches/class/acts_as_instance_method.rb
|
|
276
|
+
- lib/eac_ruby_utils/patches/class/acts_as_static_method.rb
|
|
275
277
|
- lib/eac_ruby_utils/patches/class/common_constructor.rb
|
|
276
278
|
- lib/eac_ruby_utils/patches/class/method_class.rb
|
|
277
279
|
- lib/eac_ruby_utils/patches/class/self_included_modules.rb
|
|
@@ -296,7 +298,6 @@ files:
|
|
|
296
298
|
- lib/eac_ruby_utils/patches/module/abstract_methods.rb
|
|
297
299
|
- lib/eac_ruby_utils/patches/module/acts_as_abstract.rb
|
|
298
300
|
- lib/eac_ruby_utils/patches/module/acts_as_immutable.rb
|
|
299
|
-
- lib/eac_ruby_utils/patches/module/acts_as_instance_method.rb
|
|
300
301
|
- lib/eac_ruby_utils/patches/module/common_concern.rb
|
|
301
302
|
- lib/eac_ruby_utils/patches/module/compare_by.rb
|
|
302
303
|
- lib/eac_ruby_utils/patches/module/context.rb
|
|
@@ -366,7 +367,6 @@ files:
|
|
|
366
367
|
- lib/eac_ruby_utils/speaker.rb
|
|
367
368
|
- lib/eac_ruby_utils/speaker/receiver.rb
|
|
368
369
|
- lib/eac_ruby_utils/speaker/sender.rb
|
|
369
|
-
- lib/eac_ruby_utils/static_method_class.rb
|
|
370
370
|
- lib/eac_ruby_utils/string_delimited.rb
|
|
371
371
|
- lib/eac_ruby_utils/struct.rb
|
|
372
372
|
- lib/eac_ruby_utils/unimplemented_method_error.rb
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils/acts_as_instance_method'
|
|
4
|
-
require 'eac_ruby_utils/patches/class/common_constructor'
|
|
5
|
-
require 'eac_ruby_utils/patches/module/common_concern'
|
|
6
|
-
|
|
7
|
-
module EacRubyUtils
|
|
8
|
-
module MethodClass
|
|
9
|
-
common_concern do
|
|
10
|
-
::EacRubyUtils::MethodClass::Setup.new(self)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
class Setup < ::EacRubyUtils::ActsAsInstanceMethod
|
|
14
|
-
common_constructor :method_class, :static_method, :options, default: [false, {}],
|
|
15
|
-
super_args: lambda {
|
|
16
|
-
[method_class, options]
|
|
17
|
-
} do
|
|
18
|
-
perform
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def perform
|
|
22
|
-
setup
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def default_sender_module
|
|
26
|
-
r = super
|
|
27
|
-
r = r.singleton_class if static_method
|
|
28
|
-
r
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'eac_ruby_utils/method_class'
|
|
4
|
-
require 'eac_ruby_utils/patches/module/common_concern'
|
|
5
|
-
|
|
6
|
-
module EacRubyUtils
|
|
7
|
-
module StaticMethodClass
|
|
8
|
-
common_concern do
|
|
9
|
-
::EacRubyUtils::MethodClass::Setup.new(self, true)
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|