toolrack 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release_history.yml +2 -0
- data/lib/toolrack/block_params_utils.rb +40 -0
- data/lib/toolrack/runtime_utils.rb +4 -0
- data/lib/toolrack/version.rb +1 -1
- data/lib/toolrack.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5610441ad91a23021d614e6098082c39f2ed065f3cd8b41d9f1baa450578008e
|
4
|
+
data.tar.gz: 8e9d4a84aa5042b118b53e10e52d5acadf9d51f95da7f5ee86eb37b6d705ff2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a22d8044d9e1a0336348d15f693c8536b3bbaacbd609f6ccac74183273631e930d120705b4d290c70d0bc24ff97e34ba09786c2023b8aa3e93f1b29ced4f8c55
|
7
|
+
data.tar.gz: 63d84fb30698e89db3b1cd1f38c46589aa038ea416ae00c9e02ee12891288b7c228cb2d69d289cf6cd735f95827b7fb84dca27d75c8f5adf151e452854a78087
|
data/.release_history.yml
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
module Antrapol
|
5
|
+
module ToolRack
|
6
|
+
module BlockParamsUtils
|
7
|
+
include ConditionUtils
|
8
|
+
|
9
|
+
def value_from_block(blockKey, defValue, opts = { }, &block)
|
10
|
+
if block
|
11
|
+
blockParams = nil
|
12
|
+
if not_empty?(opts)
|
13
|
+
blockParams = opts[:blockArgs]
|
14
|
+
end
|
15
|
+
|
16
|
+
value = nil
|
17
|
+
if blockParams.nil?
|
18
|
+
value = block.call(blockKey)
|
19
|
+
value = defValue if is_empty?(value)
|
20
|
+
else
|
21
|
+
value = block.call(blockKey, *blockParams)
|
22
|
+
value = defValue if is_empty?(value)
|
23
|
+
end
|
24
|
+
|
25
|
+
value
|
26
|
+
else
|
27
|
+
defValue
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
def self.included(klass)
|
33
|
+
klass.class_eval <<-END
|
34
|
+
extend Antrapol::ToolRack::BlockParamsUtils
|
35
|
+
END
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/toolrack/version.rb
CHANGED
data/lib/toolrack.rb
CHANGED
@@ -17,6 +17,7 @@ require_relative 'toolrack/cli_utils'
|
|
17
17
|
require_relative 'toolrack/null_output'
|
18
18
|
require_relative 'toolrack/version_utils'
|
19
19
|
require_relative 'toolrack/file_utils'
|
20
|
+
require_relative 'toolrack/block_params_utils'
|
20
21
|
|
21
22
|
module Antrapol
|
22
23
|
module ToolRack
|
@@ -62,3 +63,5 @@ TR::VUtils = TR::VerUtils
|
|
62
63
|
|
63
64
|
TR::FileUtils = ToolRack::FileUtils
|
64
65
|
|
66
|
+
TR::BlockParamsUtils = ToolRack::BlockParamsUtils
|
67
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toolrack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tlogger
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
86
|
- lib/toolrack.rb
|
87
|
+
- lib/toolrack/block_params_utils.rb
|
87
88
|
- lib/toolrack/cli_utils.rb
|
88
89
|
- lib/toolrack/condition_utils.rb
|
89
90
|
- lib/toolrack/data_conversion_utils.rb
|