ex_aequo_base 0.1.7 → 0.1.8

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: 924bbe0dc0445b557f63850ebfd7650b3f41216d52789a48e0701ebe6afe7b3a
4
- data.tar.gz: ec3e3ff23194b4d3de28190ca34cfba950460e1df1b778421733ecca6f2b2327
3
+ metadata.gz: b7be94a3d045e4154e3e27b72c7e1a6234ea4d9230d2cd21ba3cefa09e2980bf
4
+ data.tar.gz: cb28876bfb5512ff06482c92a15369294744626f3b606f9076c90ef5d222cce5
5
5
  SHA512:
6
- metadata.gz: 543c0c2a5159d23e0ceab290888bad113373c38c3b28c5c197e7a4a4ab10dfc7ee35a2b4034b7a442c4e88a8a0623654612b8130cb05ab26f22ba13db68e95ba
7
- data.tar.gz: e0f75b5c0e3479d0d876236c35e481ac8d74e32bb14813d73532b72c63cfa79905c51945ba79f0100a04e1703ceb11f2b027a6618284fdb7cd3eee9b77848ed0
6
+ metadata.gz: e0f99f3fb9db02de91db98649948eacfe1a248044190c0b6b422c02e44bc57165c6618a96a3f615c4efe70afa14abcd5e5f3edb4bfcd192ddf33c40a536685d3
7
+ data.tar.gz: efe7bde37b17b0f65aba95bf789288699a21be322cd82e0ccf6a2e9d0fcf25f3b8c4ad90ac10add31c53a50901cc9e099570dedb43d2c65b29d6267b2e946006
@@ -2,6 +2,7 @@
2
2
  require_relative 'colorize'
3
3
  require_relative 'enumerable'
4
4
  require_relative 'fn'
5
+ require_relative 'forwarder'
5
6
  require_relative 'kernel'
6
7
  require_relative 'open_struct'
7
8
  require_relative 'regexp'
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'helpers'
4
+ require_relative '../forwarder'
4
5
  module ExAequo
5
6
  module Base
6
7
  module Fn extend self
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+ module ExAequo
5
+ module Base
6
+ module Forwarder
7
+ include Forwardable
8
+
9
+ def forward_all(*messages, to:)
10
+ def_delegators(to, *messages)
11
+ end
12
+
13
+ end
14
+ end
15
+ end
16
+ # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../constants'
4
+ module ExAequo::Base::KernelHelper extend self
5
+
6
+ def require_subdir(*files, descend:, &blk)
7
+ raise ArgumentError, "must not provide positional file parameter #{files} and a block" if !files.empty? && blk
8
+ raise ArgumentError, "must provide file or block" unless !files.empty? || blk
9
+ if files.empty?
10
+ req_subdir_blk(descend:, &blk)
11
+ else
12
+ req_subdir_file(File.join(files), descend:)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def check_file(file)
19
+ return file if File.directory?(file)
20
+
21
+ file = file.sub(ExAequo::Base::RbExtensionRgx, '')
22
+ return file if File.directory?(file)
23
+
24
+ raise ArgumentError, "#{file} is not a directory nor does a subdirectory named after this ruby file ('.rb' removed) exist"
25
+ end
26
+
27
+ def req_subdir_blk(descend:, &blk)
28
+ subdir = blk.()
29
+ blk.source_location => src, _
30
+ if subdir
31
+ dir = File.dirname(src)
32
+ req_subdir_file(File.join(dir, subdir), descend:, exclude: src)
33
+ else
34
+ req_subdir_file(src, descend:, exclude: src)
35
+ end
36
+ end
37
+
38
+ def req_subdir_file(file, descend:, exclude: nil)
39
+ dir = check_file(file)
40
+ wc = descend ? '/**/*.rb' : '/*.rb'
41
+ Dir.glob(File.join(dir, wc)).each do |f|
42
+ require f.sub(ExAequo::Base::RbExtensionRgx, '') unless f == exclude
43
+ end
44
+ end
45
+ end
46
+ # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -1,49 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'constants'
4
- module ExAequo::Base::KernelHelper extend self
5
-
6
- def require_subdir(*files, descend:, &blk)
7
- raise ArgumentError, "must not provide positional file parameter #{files} and a block" if !files.empty? && blk
8
- raise ArgumentError, "must provide file or block" unless !files.empty? || blk
9
- if files.empty?
10
- req_subdir_blk(descend:, &blk)
11
- else
12
- req_subdir_file(File.join(files), descend:)
13
- end
14
- end
15
-
16
- private
17
-
18
- def check_file(file)
19
- return file if File.directory?(file)
20
-
21
- file = file.sub(ExAequo::Base::RbExtensionRgx, '')
22
- return file if File.directory?(file)
23
-
24
- raise ArgumentError, "#{file} is not a directory nor does a subdirectory named after this ruby file ('.rb' removed) exist"
25
- end
26
-
27
- def req_subdir_blk(descend:, &blk)
28
- subdir = blk.()
29
- blk.source_location => src, _
30
- if subdir
31
- dir = File.dirname(src)
32
- req_subdir_file(File.join(dir, subdir), descend:, exclude: src)
33
- else
34
- req_subdir_file(src, descend:, exclude: src)
35
- end
36
- end
37
-
38
- def req_subdir_file(file, descend:, exclude: nil)
39
- dir = check_file(file)
40
- wc = descend ? '/**/*.rb' : '/*.rb'
41
- Dir.glob(File.join(dir, wc)).each do |f|
42
- require f.sub(ExAequo::Base::RbExtensionRgx, '') unless f == exclude
43
- end
44
- end
45
- end
46
-
3
+ require_relative 'kernel/kernel_helper'
47
4
  module Kernel
48
5
  def require_subdir(*files, descend: false, &blk)
49
6
  ExAequo::Base::KernelHelper.require_subdir(*files, descend:, &blk)
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'ostruct'
4
- require 'forwarder'
4
+ require_relative 'forwarder'
5
5
  class OpenStruct
6
- extend Forwarder
6
+ extend ExAequo::Base::Forwarder
7
7
  forward_all :deconstruct_keys, :empty?, :fetch, :has_key?, to: :to_h
8
8
 
9
9
  def self.to_proc
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module Base
5
- VERSION = '0.1.7'
5
+ VERSION = '0.1.8'
6
6
  end
7
7
  end
8
8
  # SPDX-License-Identifier: AGPL-3.0-or-later
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ex_aequo_base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober
@@ -9,20 +9,6 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: forwarder
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: 0.1.0
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - "~>"
24
- - !ruby/object:Gem::Version
25
- version: 0.1.0
26
12
  - !ruby/object:Gem::Dependency
27
13
  name: ostruct
28
14
  requirement: !ruby/object:Gem::Requirement
@@ -71,7 +57,9 @@ files:
71
57
  - lib/ex_aequo/base/fn/all.rb
72
58
  - lib/ex_aequo/base/fn/curry.rb
73
59
  - lib/ex_aequo/base/fn/helpers.rb
60
+ - lib/ex_aequo/base/forwarder.rb
74
61
  - lib/ex_aequo/base/kernel.rb
62
+ - lib/ex_aequo/base/kernel/kernel_helper.rb
75
63
  - lib/ex_aequo/base/match_data.rb
76
64
  - lib/ex_aequo/base/open_struct.rb
77
65
  - lib/ex_aequo/base/regexp.rb
@@ -100,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  requirements: []
103
- rubygems_version: 3.6.9
91
+ rubygems_version: 3.7.1
104
92
  specification_version: 4
105
93
  summary: The code I use all the time
106
94
  test_files: []