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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b5c17ec1e90be20f1ec19300d51804183a44223b5b761bdb00475ed7d930063
4
- data.tar.gz: b7776ecbd1cbad8a7541f32085d3db57a24867ef6ed2d0f9b98f5ad724e3d1a4
3
+ metadata.gz: 6d2de080a19bcf745dd39bc1125df5cbc061ca67af65a1068847fe01c4c7af6a
4
+ data.tar.gz: 45ab47d974811ea0c491bdc592e743c2b1e5afa3f7b74b3141c3b3bf6d1fb3c1
5
5
  SHA512:
6
- metadata.gz: 835aa468defaf9c46aae59586c1ae1315c9112b5e116846be4f5f63661faff5d2cf1977082c313768434b6af2a8b82429db8b438a44aaf100e386dbfa2628e1b
7
- data.tar.gz: 70ab89133d5088f7a04fd167a2dd9e402368323fc29bbbbeb55266bcf1d5abb84fc847bbd8ab470a0ec56afe6c83281fab174d4a2d0c98151d61c8ce0822fb8f
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
- obj.length == 0
20
- elsif obj.respond_to?(:size)
21
- obj.size == 0
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
@@ -1,6 +1,6 @@
1
1
  module Antrapol
2
2
  module ToolRack
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.1"
4
4
  end
5
5
  end
6
6
 
data/toolrack.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
 
29
29
  spec.add_dependency "tlogger", "~> 0.21"
30
+ spec.add_dependency "base58"
30
31
 
31
32
  spec.add_development_dependency "devops_helper", "~> 0.1.0"
32
33
  end
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.7.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-17 00:00:00.000000000 Z
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