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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e388520a9fb400d5dd814ccbdcad3930b33f7f320179e4eee7595339d2efedd7
4
- data.tar.gz: e8eff7fab3d9d62dd451bb371a8bcd7aaf817fc9c25b83955a1e9854413d1fcc
3
+ metadata.gz: 5610441ad91a23021d614e6098082c39f2ed065f3cd8b41d9f1baa450578008e
4
+ data.tar.gz: 8e9d4a84aa5042b118b53e10e52d5acadf9d51f95da7f5ee86eb37b6d705ff2a
5
5
  SHA512:
6
- metadata.gz: 7dd4df7a2dd222f941b3ee4283f84fdf88c26da9583e6d2d716299df365597224b793e5cddc9f895bcef50bd96b10d7280c7724703a69214a83c536268a22a1e
7
- data.tar.gz: 3b72652967903812e39e124f60ea6488f1acc33d56fdbea42daba1c2a3c11be82f75512d7e5e30c40e6bea00eec8d241d2c7bb521d3946c396f22d5234c30347
6
+ metadata.gz: a22d8044d9e1a0336348d15f693c8536b3bbaacbd609f6ccac74183273631e930d120705b4d290c70d0bc24ff97e34ba09786c2023b8aa3e93f1b29ced4f8c55
7
+ data.tar.gz: 63d84fb30698e89db3b1cd1f38c46589aa038ea416ae00c9e02ee12891288b7c228cb2d69d289cf6cd735f95827b7fb84dca27d75c8f5adf151e452854a78087
data/.release_history.yml CHANGED
@@ -4,3 +4,5 @@ toolrack:
4
4
  :timestamp: 1635759283.7389827
5
5
  - :version: 0.16.2
6
6
  :timestamp: 1636343293.571501
7
+ - :version: 0.17.0
8
+ :timestamp: 1636636596.4561074
@@ -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
@@ -16,6 +16,10 @@ module Antrapol
16
16
  (RbConfig::CONFIG['host_os'] =~ /linux/) != nil
17
17
  end
18
18
 
19
+ def RuntimeUtils.os_string
20
+ RbConfig::CONFIG['host_os']
21
+ end
22
+
19
23
  def RuntimeUtils.on_ruby?
20
24
  not on_jruby?
21
25
  end
@@ -1,6 +1,6 @@
1
1
  module Antrapol
2
2
  module ToolRack
3
- VERSION = "0.17.0"
3
+ VERSION = "0.18.0"
4
4
  end
5
5
  end
6
6
 
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.17.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 00:00:00.000000000 Z
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