sonic_pass 0.2.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +51 -16
- data/bin/sonic_pass +2 -2
- data/lib/sonic_pass/version.rb +1 -1
- data/lib/sonic_pass.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2458e31ed5dacfe4ea786518af9263e3f7201e4fa3796defb99f45503f9e61b3
|
4
|
+
data.tar.gz: e0d9c54cfead25c7ac837a73cdc3c134a7a1c02d996c1ce9f8096699c440cef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de39af42150ca51471aaef119a60f81bd761add3ba9226bed5590605309f96fed4c32713ba09fc7fb6fcb71481b8b659db9d1f5cd3ba03ab8fc90c402ba63806
|
7
|
+
data.tar.gz: 74fcf7d2699ead5d9eb03939093adae22fd4206d5463b8948ae16e7c6c9b8046a7e18bf5f01a4616a002457a3df31d219baf54d77094d30ae078e15efde7aaf4
|
data/README.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+

|
2
|
+

|
3
|
+

|
4
|
+

|
5
|
+
|
1
6
|
Table of Contents
|
2
7
|
-----------------
|
3
8
|
|
4
9
|
* [Overview](#overview)
|
5
10
|
* [Installation](#installation)
|
6
11
|
* [Usage](#usage)
|
7
|
-
* [Configuration](#configuration)
|
8
|
-
* [Methods](#methods)
|
9
12
|
* [Contributing](#contributing)
|
10
13
|
* [License](#license)
|
11
14
|
|
@@ -40,31 +43,63 @@ require 'sonic_pass'
|
|
40
43
|
You can then generate a password using the `SonicPass.generate` method:
|
41
44
|
|
42
45
|
```ruby
|
43
|
-
password = SonicPass.generate
|
46
|
+
password = SonicPass.generate
|
44
47
|
puts password
|
48
|
+
# cpzmh3OV\",C7
|
45
49
|
```
|
46
50
|
|
47
|
-
|
51
|
+
Or you can generate multiple passwords, using `count > 1` params
|
48
52
|
|
49
|
-
|
53
|
+
```ruby
|
54
|
+
passwords = SonicPass.generate(12, 5)
|
55
|
+
puts passwords
|
56
|
+
# ,Y36.9H-XqS;
|
57
|
+
# vRzCyIq.=$W5
|
58
|
+
# 1}-'D*'ya$Vg
|
59
|
+
# %66db&y$rjhU
|
60
|
+
# x';2I7y$<&5f
|
61
|
+
```
|
50
62
|
|
51
|
-
|
63
|
+
### How to use CLI command `sonic_pass`
|
52
64
|
|
53
|
-
|
54
|
-
* `SPECIAL_CHARSETS`: A set of special characters.
|
65
|
+
- Put executable path into `PATH` directly
|
55
66
|
|
56
|
-
|
67
|
+
```bash
|
68
|
+
gem_bin_path=$(gem env | grep "EXECUTABLE DIRECTORY" | awk -F ': ' '{print $2}')
|
69
|
+
export PATH="$PATH:$gem_bin_path"
|
70
|
+
```
|
57
71
|
|
58
|
-
|
59
|
-
|
60
|
-
|
72
|
+
- Put executable path into `PATH` in the appropriate configuration file
|
73
|
+
|
74
|
+
Assume executable path is: `/home/user/.asdf/installs/ruby/3.0.0/bin`
|
75
|
+
|
76
|
+
For bash (usually ~/.bashrc or ~/.bash_profile):
|
77
|
+
|
78
|
+
```bash
|
79
|
+
echo 'export PATH="$PATH:/home/user/.asdf/installs/ruby/3.0.0/bin"' >> ~/.bashrc
|
80
|
+
source ~/.bashrc
|
61
81
|
```
|
62
82
|
|
63
|
-
### Methods
|
64
83
|
|
65
|
-
|
84
|
+
For zsh (usually ~/.zshrc):
|
66
85
|
|
67
|
-
|
86
|
+
```bash
|
87
|
+
echo 'export PATH="$PATH:/home/user/.asdf/installs/ruby/3.0.0/bin"' >> ~/.zshrc
|
88
|
+
source ~/.zshrc
|
89
|
+
```
|
90
|
+
|
91
|
+
Verify the change: After updating your configuration file, you can check if the new path has been added by running:
|
92
|
+
|
93
|
+
```bash
|
94
|
+
echo $PATH
|
95
|
+
```
|
96
|
+
|
97
|
+
Finally, run CLI command:
|
98
|
+
|
99
|
+
```bash
|
100
|
+
sonic_pass
|
101
|
+
# Password: mM>]3ERLlD5L copied to clipboard
|
102
|
+
```
|
68
103
|
|
69
104
|
### Contributing
|
70
105
|
|
@@ -72,4 +107,4 @@ Contributions to the Sonic Pass gem are welcome. To contribute, please fork the
|
|
72
107
|
|
73
108
|
### License
|
74
109
|
|
75
|
-
The Sonic Pass gem is released under the MIT License. See the LICENSE file for details.
|
110
|
+
The Sonic Pass gem is released under the MIT License. See the LICENSE file for details.
|
data/bin/sonic_pass
CHANGED
@@ -11,8 +11,8 @@ passwords = SonicPass.generate(length, count)
|
|
11
11
|
|
12
12
|
# Copy the generated password to the clipboard
|
13
13
|
if count == 1
|
14
|
-
Clipboard.copy(passwords
|
15
|
-
puts "Password: #{passwords
|
14
|
+
Clipboard.copy(passwords)
|
15
|
+
puts "Password: #{passwords} copied to clipboard"
|
16
16
|
else
|
17
17
|
puts passwords.join("\n")
|
18
18
|
end
|
data/lib/sonic_pass/version.rb
CHANGED
data/lib/sonic_pass.rb
CHANGED
@@ -20,6 +20,8 @@ module SonicPass
|
|
20
20
|
# @param count [Integer] The number of passwords to generate. Defaults to 1.
|
21
21
|
# @return [Array<String>] An array of strong passwords of the specified length.
|
22
22
|
def self.generate(length = 12, count = 1)
|
23
|
-
Array.new(count) { (Array.new(length) { CHARSETS.sample }).join }
|
23
|
+
passwords = Array.new(count) { (Array.new(length) { CHARSETS.sample }).join }
|
24
|
+
|
25
|
+
count == 1 ? passwords[0] : passwords
|
24
26
|
end
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonic_pass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- papakvy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|