toolrack 0.7.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toolrack/condition_utils.rb +4 -4
- data/lib/toolrack/data_conversion_utils.rb +24 -0
- data/lib/toolrack/version.rb +1 -1
- data/toolrack.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d2de080a19bcf745dd39bc1125df5cbc061ca67af65a1068847fe01c4c7af6a
|
4
|
+
data.tar.gz: 45ab47d974811ea0c491bdc592e743c2b1e5afa3f7b74b3141c3b3bf6d1fb3c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a7ebfc77d5319f7d3b768d7c27c213b858a414663f1bfa5992fa8c2ac0b8f775348a2298618cc7d84141269c383be0390c3bfe00fafe5a8c377cc67b89066c
|
7
|
+
data.tar.gz: a9a4d41057b2328f03e407d84ef1350ee8a1ad575d2c80c7b166d818c6172ec92fb338a22726acdd27dc99ab5d0098a4ccfe2f620b1d7de4a3a8a475f14ba076
|
@@ -15,10 +15,10 @@ module Antrapol
|
|
15
15
|
else
|
16
16
|
obj.empty?
|
17
17
|
end
|
18
|
-
elsif obj.respond_to?(:length)
|
19
|
-
|
20
|
-
elsif obj.respond_to?(:size)
|
21
|
-
|
18
|
+
#elsif obj.respond_to?(:length)
|
19
|
+
# obj.length == 0
|
20
|
+
#elsif obj.respond_to?(:size)
|
21
|
+
# obj.size == 0
|
22
22
|
else
|
23
23
|
false
|
24
24
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
require 'base64'
|
3
|
+
require 'base58'
|
3
4
|
|
4
5
|
module Antrapol
|
5
6
|
module ToolRack
|
@@ -41,6 +42,27 @@ module Antrapol
|
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
45
|
+
def to_b58(val)
|
46
|
+
return "" if is_empty?(val)
|
47
|
+
|
48
|
+
case val
|
49
|
+
when Integer
|
50
|
+
Base58.int_to_base58(val)
|
51
|
+
else
|
52
|
+
Base58.binary_to_base58(val.force_encoding('BINARY'))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def from_b58(str)
|
57
|
+
return "" if is_empty?(str)
|
58
|
+
Base58.base58.to_binary(str)
|
59
|
+
end
|
60
|
+
|
61
|
+
def b58_to_number(str)
|
62
|
+
return 0 if is_empty?(str)
|
63
|
+
Base58.base58_to_int(str)
|
64
|
+
end
|
65
|
+
|
44
66
|
def from_hex(str)
|
45
67
|
if not_empty?(str)
|
46
68
|
str.scan(/../).map { |x| x.hex.chr }.join
|
@@ -90,6 +112,8 @@ module Antrapol
|
|
90
112
|
nil
|
91
113
|
end
|
92
114
|
end
|
115
|
+
alias_method :str_to_bool, :string_to_bool
|
116
|
+
alias_method :string_to_boolean, :string_to_bool
|
93
117
|
|
94
118
|
end
|
95
119
|
end
|
data/lib/toolrack/version.rb
CHANGED
data/toolrack.gemspec
CHANGED
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.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tlogger
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.21'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: base58
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: devops_helper
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|