toolrack 0.8.2 → 0.9.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: 82f8e6d4659caa4af54db81593a98505aeb00348e104bc796fe6acf4278f7ca6
4
- data.tar.gz: a3fed1a24257ac29df830858a03a7c41c575b31407b90f8414e73324d890a094
3
+ metadata.gz: 7a6d6ade6a80e5efb3499f23135144ee8c0f58b53aa98b453981e74cb279237c
4
+ data.tar.gz: f665002e707b8c53aa855bedefa8c50a18fa9b4a3162cc987cdd0d000f33bd37
5
5
  SHA512:
6
- metadata.gz: 61304df1637d1c47f49612361a26a7bed6e7b79243c5769546104a3aec5c5517c95a09e6dc8da339f92c75de932d6db9240d2ba0d01bc86d6fa0eedf6e690af0
7
- data.tar.gz: 670b9c3ee72b20e470b1ba1f1850b58765072712b6dda0049e712cf7217244882696f4b7bb8e41195a240aa6bb8ec2cf7a87fe7ed0b81777b3303961574b3b5b
6
+ metadata.gz: eab1c799dc27d82fb55006baba5943bada9f9234d4e78266f8564638b86286129f5fd3938d42be729a62044411bcb686fc75bc59d127e106a6245d9fb85e11a8
7
+ data.tar.gz: bf908f5e105b9e096b779de8c1e63d66057e8034c9a7eb996c6a01c1aca7e1e941f5cad68d6dedf329d26b49a6ec45fb121e33d2d452342c511ddc96f35b06bc
@@ -0,0 +1,22 @@
1
+
2
+ require 'securerandom'
3
+
4
+ module Antrapol
5
+ module ToolRack
6
+ module PasswordUtils
7
+ include Antrapol::ToolRack::ConditionUtils
8
+
9
+ def generate_random_password(length = 12)
10
+ length = 12 if is_empty?(length)
11
+ length = length.to_i
12
+ length = 12 if length <= 0
13
+
14
+ antropy = ('!'..'~').to_a
15
+ antropy.sort_by { SecureRandom.random_number }.join[0...length]
16
+ end
17
+ alias_method :gen_rand_pass, :generate_random_password
18
+ alias_method :gen_pass, :generate_random_password
19
+
20
+ end
21
+ end
22
+ end
@@ -1,6 +1,6 @@
1
1
  module Antrapol
2
2
  module ToolRack
3
- VERSION = "0.8.2"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end
6
6
 
data/lib/toolrack.rb CHANGED
@@ -11,6 +11,7 @@ require_relative 'toolrack/condition_utils'
11
11
  require_relative 'toolrack/process_utils'
12
12
  require_relative 'toolrack/runtime_utils'
13
13
  require_relative 'toolrack/data_conversion_utils'
14
+ require_relative 'toolrack/password_utils'
14
15
 
15
16
  module Antrapol
16
17
  module ToolRack
@@ -22,5 +23,7 @@ end
22
23
 
23
24
  ToolRack = Antrapol::ToolRack
24
25
  ToolRack::DataConv = Antrapol::ToolRack::DataConversionUtils
26
+ ToolRack::CondUtils = ToolRack::ConditionUtils
27
+ ToolRack::PassUtils = ToolRack::PasswordUtils
25
28
 
26
29
 
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.8.2
4
+ version: 0.9.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-08-31 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tlogger
@@ -73,6 +73,7 @@ files:
73
73
  - lib/toolrack/data_conversion_utils.rb
74
74
  - lib/toolrack/exception_utils.rb
75
75
  - lib/toolrack/global.rb
76
+ - lib/toolrack/password_utils.rb
76
77
  - lib/toolrack/process_utils.rb
77
78
  - lib/toolrack/runtime_utils.rb
78
79
  - lib/toolrack/utils.rb