masked-pass 1.1.0 → 1.2.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/VERSION +1 -0
- data/bin/masked-pass +45 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32657b06985233183a4bfe730903f9edfa950aba1147ca93dcaed3e4f0aef5ae
|
4
|
+
data.tar.gz: 6f82a0c75b42c391f69ca21d02b99c56c0c6256b720ac55a7461852e1425f22b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5359b0affa3f58f59e29c77f3feb53f94f861203f26575a386cc96fdfbbf6cec322f31528205497cebed971547fc52b96c20b9cf17135961badb5dd8e817877
|
7
|
+
data.tar.gz: 8ef9ec980da1d4b6a08c4fd1793c0ddfae4b2f98cb7923d4b5dfbd6b8853b9883bb937ed4ebd1f33f6d9bc15a6b2a4d88827d2122a01a37fed2273dbd0c3ba13
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.2.0
|
data/bin/masked-pass
CHANGED
@@ -2,14 +2,50 @@
|
|
2
2
|
|
3
3
|
require 'io/console'
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
def read_indexes
|
6
|
+
STDIN.gets.chomp.split(/\s|,/).map(&:to_i)
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
pass
|
9
|
+
def masked_chars(pass, indexes)
|
10
|
+
indexes.map { |i| pass[i-1] }
|
11
|
+
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if ARGV.include?('-v') || ARGV.include?('--version')
|
14
|
+
version = File.read(File.expand_path('../VERSION', File.dirname(__FILE__)))
|
15
|
+
puts "masked-pass #{version}"
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
|
19
|
+
if ARGV.include?('-h') || ARGV.include?('--help')
|
20
|
+
puts <<~HELP
|
21
|
+
Usage:
|
22
|
+
masked-pass [options]
|
23
|
+
|
24
|
+
Options:
|
25
|
+
-v, --version Show version and exit
|
26
|
+
-h, --help Show help message and exit
|
27
|
+
-c, --clipboard Use clipboard for input and output (MacOS only)
|
28
|
+
HELP
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
|
32
|
+
if ARGV.include?('-c') || ARGV.include?('--clipboard')
|
33
|
+
puts 'Copy password to clipboard then type character indexes:'
|
34
|
+
indexes = read_indexes
|
35
|
+
pass = `pbpaste`
|
36
|
+
chars = masked_chars(pass, indexes)
|
37
|
+
chars_string = chars.join
|
38
|
+
system("echo '#{chars_string}\\c' | pbcopy")
|
39
|
+
puts 'Characters copied to clipboard'
|
40
|
+
else
|
41
|
+
puts 'Character indexes:'
|
42
|
+
indexes = read_indexes
|
43
|
+
puts 'Now paste the password'
|
44
|
+
pass = STDIN.noecho(&:gets).chomp
|
45
|
+
puts 'Your characters:'
|
46
|
+
chars = masked_chars(pass, indexes)
|
47
|
+
chars_string = chars.join(' ')
|
48
|
+
print chars_string
|
49
|
+
sleep 10
|
50
|
+
puts "\r#{'*' * chars_string.size}"
|
51
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masked-pass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Mateja
|
@@ -18,6 +18,7 @@ executables:
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- VERSION
|
21
22
|
- bin/masked-pass
|
22
23
|
homepage: https://github.com/mmateja/masked-pass
|
23
24
|
licenses:
|
@@ -38,8 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
39
|
- !ruby/object:Gem::Version
|
39
40
|
version: '0'
|
40
41
|
requirements: []
|
41
|
-
|
42
|
-
rubygems_version: 2.7.6
|
42
|
+
rubygems_version: 3.0.3.1
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: Small program helping with masked passwords
|