eac_ruby_utils 0.113.0 → 0.114.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e7deaaf568625e32fc58c45b43ef41e125924595707b3a2ca2ea394d9dc4393
4
- data.tar.gz: 4af93c26f87f2918f36cc18b2ad5e3cefa8d6fe6a21bb09282f0112bd2138182
3
+ metadata.gz: 5e398a3086c6ea380d47c0ca6d718a4fb0cfe715411a0b1dd3f523858af331c6
4
+ data.tar.gz: a1cc636dd7caefaaa53d08387568ed22e1f4b1ba584eb174beb703c745a6f621
5
5
  SHA512:
6
- metadata.gz: 8144e44599f8dc4b5299a3353e79fc51fa558bcb085e1d8a46d0f40182d06b9c0481f56a4a8b464bddf00a52c67c97d3846875489f90f24d0eba8e87b5ed4384
7
- data.tar.gz: 657df0404c6f3060e756198aeeb1181b210b7d18564e4b58437a5d79601e3c62d1f2d5bdb686b221b434c2ad81322817798ea329b77b94c2b110c189631055e0
6
+ metadata.gz: 2cccfcd642d595d2e8ccbb053f466780c9b5d1952b018c9b4d6e302943ae9985dbdb930fa10190501a41721419c11778d22d67c8e80986f5ddc2f7422d7a587b
7
+ data.tar.gz: a1398db93d9d863a6d3c400bca05e3667d7d99a97dee569cab0ffff6b0e01bc28a252cb56557ca941a4b069a8025080f7a32a0f96dc6cd0392311d53a2587b20
@@ -8,10 +8,10 @@ module EacRubyUtils
8
8
  #
9
9
  # Usage:
10
10
  #
11
- # require 'eac_ruby_utils/abstract_methods'
11
+ # require 'eac_ruby_utils/acts_as_abstract'
12
12
  #
13
13
  # class BaseClass
14
- # include EacRubyUtils::AbstractMethods
14
+ # include EacRubyUtils::ActsAsAbstract
15
15
  #
16
16
  # abstract_methods :mymethod
17
17
  # end
@@ -25,12 +25,12 @@ module EacRubyUtils
25
25
  # end
26
26
  #
27
27
  # SubClass.new.mymethod # return "Implemented"
28
- module AbstractMethods
28
+ module ActsAsAbstract
29
29
  common_concern
30
30
 
31
31
  class << self
32
32
  def abstract?(a_class)
33
- a_class.self_included_modules.include?(::EacRubyUtils::AbstractMethods)
33
+ a_class.self_included_modules.include?(::EacRubyUtils::ActsAsAbstract)
34
34
  end
35
35
  end
36
36
 
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/abstract_methods'
3
+ require 'eac_ruby_utils/acts_as_abstract'
4
4
 
5
5
  class Class
6
6
  def abstract?
7
- ::EacRubyUtils::AbstractMethods.abstract?(self)
7
+ ::EacRubyUtils::ActsAsAbstract.abstract?(self)
8
8
  end
9
9
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/abstract_methods'
3
+ require 'eac_ruby_utils/patches/module/acts_as_abstract'
4
4
 
5
5
  class Module
6
+ # @deprecated Use {#acts_as_abstract} instead.
6
7
  def enable_abstract_methods(*methods)
7
- include ::EacRubyUtils::AbstractMethods
8
- abstract_methods(*methods)
8
+ acts_as_abstract(*methods)
9
9
  end
10
10
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/acts_as_abstract'
4
+
5
+ class Module
6
+ # Include [EacRubyUtils::ActsAsAbstract] and perform EacRubyUtils::ActsAsAbstract.abstract_methods
7
+ # on parameter +methods+.
8
+ # @param methods [Array<Symbol>]
9
+ # @return [void]
10
+ def acts_as_abstract(*methods)
11
+ include ::EacRubyUtils::ActsAsAbstract
12
+ abstract_methods(*methods)
13
+ end
14
+ end
@@ -3,7 +3,11 @@
3
3
  require 'pathname'
4
4
 
5
5
  class Pathname
6
+ # @param suffix [String]
7
+ # @return [Pathname]
6
8
  def basename_sub(suffix = '')
7
- parent.join(yield(basename(suffix)))
9
+ new_basename = basename(suffix)
10
+ new_basename = yield(new_basename) if block_given?
11
+ parent.join(new_basename)
8
12
  end
9
13
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/abstract_methods'
3
+ require 'eac_ruby_utils/acts_as_abstract'
4
4
 
5
5
  module EacRubyUtils
6
6
  module Speaker
7
7
  module Receiver
8
8
  extend ::ActiveSupport::Concern
9
- extend ::EacRubyUtils::AbstractMethods
9
+ extend ::EacRubyUtils::ActsAsAbstract
10
10
 
11
11
  module ClassMethods
12
12
  def on(*args, &block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.113.0'
4
+ VERSION = '0.114.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.113.0
4
+ version: 0.114.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-10 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -128,7 +128,7 @@ extra_rdoc_files: []
128
128
  files:
129
129
  - README.rdoc
130
130
  - lib/eac_ruby_utils.rb
131
- - lib/eac_ruby_utils/abstract_methods.rb
131
+ - lib/eac_ruby_utils/acts_as_abstract.rb
132
132
  - lib/eac_ruby_utils/arguments_consumer.rb
133
133
  - lib/eac_ruby_utils/bit.rb
134
134
  - lib/eac_ruby_utils/bit_array.rb
@@ -234,6 +234,7 @@ files:
234
234
  - lib/eac_ruby_utils/patches/kernel/nyi.rb
235
235
  - lib/eac_ruby_utils/patches/module.rb
236
236
  - lib/eac_ruby_utils/patches/module/abstract_methods.rb
237
+ - lib/eac_ruby_utils/patches/module/acts_as_abstract.rb
237
238
  - lib/eac_ruby_utils/patches/module/common_concern.rb
238
239
  - lib/eac_ruby_utils/patches/module/compare_by.rb
239
240
  - lib/eac_ruby_utils/patches/module/context.rb