ex_aequo_base 0.1.7 → 0.1.9
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/ex_aequo/base/all.rb +2 -1
- data/lib/ex_aequo/base/fn/curry.rb +1 -0
- data/lib/ex_aequo/base/forwarder.rb +16 -0
- data/lib/ex_aequo/base/import_all.rb +10 -0
- data/lib/ex_aequo/base/kernel/kernel_helper.rb +46 -0
- data/lib/ex_aequo/base/kernel.rb +1 -44
- data/lib/ex_aequo/base/open_struct.rb +2 -2
- data/lib/ex_aequo/base/version.rb +1 -1
- metadata +5 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e92467b526715617cfc4936b88dbdd843195e0ddd474a94da9c52650fb7e6d4a
|
4
|
+
data.tar.gz: 8545cb2f614673f13250d4deea5338baed5e78a7ccd1c89a9d6712527368029d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934cec29d13da31c801ab3901e9484bafbcf48b2cc0dd47e22cbd850f48bfb382d529bba2b18a20a433d3c5cebab2c7824ce8c612dfcdd96b76cdb2390c5b8ef
|
7
|
+
data.tar.gz: 05db10e7a72ea3140345cca0d480a4e8b927752f3760484cf87fcf5f0e152da62f51fc938e10055d65dd538819a94f500b1eb7bbee5a1071443b90326bc93fde
|
data/lib/ex_aequo/base/all.rb
CHANGED
@@ -2,9 +2,10 @@
|
|
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'
|
8
9
|
# require_relative 'match_data'
|
9
|
-
Colorize = ExAequo::Base::Colorize
|
10
|
+
# Colorize = ExAequo::Base::Colorize
|
10
11
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
@@ -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
|
data/lib/ex_aequo/base/kernel.rb
CHANGED
@@ -1,49 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
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
|
-
|
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
|
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.
|
4
|
+
version: 0.1.9
|
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,10 @@ 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
|
61
|
+
- lib/ex_aequo/base/import_all.rb
|
74
62
|
- lib/ex_aequo/base/kernel.rb
|
63
|
+
- lib/ex_aequo/base/kernel/kernel_helper.rb
|
75
64
|
- lib/ex_aequo/base/match_data.rb
|
76
65
|
- lib/ex_aequo/base/open_struct.rb
|
77
66
|
- lib/ex_aequo/base/regexp.rb
|
@@ -100,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
89
|
- !ruby/object:Gem::Version
|
101
90
|
version: '0'
|
102
91
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
92
|
+
rubygems_version: 3.7.1
|
104
93
|
specification_version: 4
|
105
94
|
summary: The code I use all the time
|
106
95
|
test_files: []
|