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 +4 -4
- data/lib/toolrack/password_utils.rb +22 -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: 7a6d6ade6a80e5efb3499f23135144ee8c0f58b53aa98b453981e74cb279237c
|
4
|
+
data.tar.gz: f665002e707b8c53aa855bedefa8c50a18fa9b4a3162cc987cdd0d000f33bd37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/toolrack/version.rb
CHANGED
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.
|
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
|
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
|