uhide 0.0.26 → 0.0.27

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/uhide/main.rb +39 -38
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4a06d744fe8a6c1f74e8fd848e74af96ba37d5c377ee3d6b33599f0d38d30c1
4
- data.tar.gz: 94cf1b71fbe3255fa896e25a53fd474e0bdb0e69677a6ef644944972cc452f0a
3
+ metadata.gz: 7549fe073a8fe7084cda772418064c3ae4a6ee461ed3aa366cd1f2e36f35fbf9
4
+ data.tar.gz: 745e42dcf130591deb94f771e5a38ee00201c770d006b13e86ca68c05633d861
5
5
  SHA512:
6
- metadata.gz: 8d6f4416ab7af95df3e132b6651408be6d684847fc2b3740d44e89f28ca717959af688c8043c33782e4fe2dc2142d41121da0bd7f05bb93da47d8bf396fad2da
7
- data.tar.gz: fb0c709b806ce2cef94508141e21dd062c845db86886657ea63e7a4572431bc962126c7d4f3873ec76cf677d594c28930b49dcaa41697e1362ed4ba99bac8d19
6
+ metadata.gz: 91e97dea996846aaa2b82a6166aae57504615119ad89250187c00c6d87e3abe1ac9f8bdcb66c2b9e45f48e75903c99a65377ec05978eb7b2d88212a7dd7c886d
7
+ data.tar.gz: ca79538b4400dfcc213f099ce0c72f1404c7751488f726a0f5e4b00c7d8b1ab04d00cf2f2095feadbc05c6719fe7650f4522587b30385e28d6bc5cb41ed3a4de
data/lib/uhide/main.rb CHANGED
@@ -1,9 +1,10 @@
1
+ INVALID_🔑 = 'invalid key'.colorize(:magenta)
2
+ UNSUPPORTED_👾 = 'unsupported'.colorize(:magenta) + ' 👾'
3
+
1
4
  $☔ = " ☔ > "
2
5
  $🔑 = " 🔑 > "
3
6
  $🧂 = -> { 🗃️ '🧂', SecureRandom.random_bytes }
4
7
  $📏 = -> { 🗃️ '📏', ActiveSupport::MessageEncryptor.key_len }
5
- INVALID_KEY = 'invalid key'.colorize(:magenta)
6
- UNSUPPORTED_👾 = 'unsupported'.colorize(:magenta) + ' 👾'
7
8
  $🗄️ = {}
8
9
 
9
10
  def 🚽
@@ -46,41 +47,6 @@ def 🔒 🏷️, 💎
46
47
  💾
47
48
  end
48
49
 
49
- def 🤖 🗣️
50
- 👾, 🏷️, 💎 = 🗣️.split
51
-
52
- if 👾.nil?
53
- return
54
- end
55
-
56
- case 👾.to_sym
57
- when :get
58
- if 🏷️
59
- 🔓 🏷️: 🏷️
60
- else
61
- 🔓
62
- end
63
-
64
- when :set
65
- 🔒 🏷️, 💎
66
-
67
- when :exit
68
- exit!
69
-
70
- when :reset
71
- if ❓($🔑, simple: false) == $✍️
72
- ['ddllv', '🧂', '📏'].each_entry{ |item| File.delete "./#{item}" }
73
- exit!
74
- else
75
- puts INVALID_KEY
76
- end
77
-
78
- else
79
- puts UNSUPPORTED_👾
80
- end
81
-
82
- end
83
-
84
50
  def 💾
85
51
  ⚛️ = ActiveSupport::MessageEncryptor.new(
86
52
  ActiveSupport::KeyGenerator.new($✍️).generate_key($🧂.call, $📏.call)
@@ -121,7 +87,7 @@ def 🗃️ 🗂️, 💎, ⚛️: false
121
87
  begin
122
88
  📖 = ⚛️.decrypt_and_verify 📕
123
89
  rescue ActiveSupport::MessageVerifier::InvalidSignature
124
- puts INVALID_KEY
90
+ puts INVALID_🔑
125
91
  exit!
126
92
  end
127
93
 
@@ -134,6 +100,41 @@ def 🗃️ 🗂️, 💎, ⚛️: false
134
100
  return $🗄️[🗂️] = 📖
135
101
  end
136
102
 
103
+ def 🤖 🗣️
104
+ 👾, 🏷️, 💎 = 🗣️.split
105
+
106
+ if 👾.nil?
107
+ return
108
+ end
109
+
110
+ case 👾.to_sym
111
+ when :get
112
+ if 🏷️
113
+ 🔓 🏷️: 🏷️
114
+ else
115
+ 🔓
116
+ end
117
+
118
+ when :set
119
+ 🔒 🏷️, 💎
120
+
121
+ when :exit
122
+ exit!
123
+
124
+ when :reset
125
+ if ❓($🔑, simple: false) == $✍️
126
+ ['ddllv', '🧂', '📏'].each_entry { |item| File.delete "./#{item}" }
127
+ exit!
128
+ else
129
+ puts INVALID_🔑
130
+ end
131
+
132
+ else
133
+ puts UNSUPPORTED_👾
134
+ end
135
+
136
+ end
137
+
137
138
  class Uhide::Main
138
139
  class << self
139
140
  def start()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uhide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Keen