universa 3.10.5.1 → 3.10.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/universa/keytool/keytool.rb +42 -5
- data/lib/universa/version.rb +1 -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: bca9c1f302fe4ede2b618ce1c3f4aab1b0333753f85c1ec517fb356ef89d5192
|
4
|
+
data.tar.gz: a9e46778d71229fb9e70346facf95b449de040718619b10c9d10f823accc0ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 112e18a1eacd324186e2d57266d018da82fa95b64c9f67ccbdee98d873db2ba12196ab9f49e98998edbd3c410349e7330bd0261f7172b82e23d3a80622979c18
|
7
|
+
data.tar.gz: af99d73ab560a95b90b64e9c88a71db0ddcf262865320f287731abf7faa54060191172000145e733d93972a06a8bc8bdccb8bdd1835583db3ccae04efb98eea9
|
@@ -71,8 +71,12 @@ class KeyTool
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
def output_file(extension = nil)
|
75
|
-
name = @output_file
|
74
|
+
def output_file(extension = nil, overwrite_existing_name = nil)
|
75
|
+
name = @output_file
|
76
|
+
if !name
|
77
|
+
(overwrite_existing_name && @overwrite) or error "specify output file with -o / --output"
|
78
|
+
name = overwrite_existing_name
|
79
|
+
end
|
76
80
|
extension && !name.end_with?(extension) ? "#{name}#{extension}" : name
|
77
81
|
end
|
78
82
|
|
@@ -166,9 +170,10 @@ class KeyTool
|
|
166
170
|
}
|
167
171
|
}
|
168
172
|
|
169
|
-
opts.on("-u FILE", "--update FILE", "update password on the existing key (also add/remove"
|
173
|
+
opts.on("-u FILE", "--update FILE", "update password on the existing key (also add/remove",
|
174
|
+
"requires -o output_file or --overwrite to change it in place") { |name|
|
170
175
|
task {
|
171
|
-
output = output_file(".private.unikey")
|
176
|
+
output = output_file(".private.unikey", name)
|
172
177
|
check_overwrite output
|
173
178
|
key = load_key(name)
|
174
179
|
puts("\rKey loaded OK ")
|
@@ -194,8 +199,36 @@ class KeyTool
|
|
194
199
|
|
195
200
|
opts.separator ""
|
196
201
|
|
202
|
+
def sample(text)
|
203
|
+
" " + ANSI.bold { ANSI.green { text } }
|
204
|
+
end
|
205
|
+
|
197
206
|
opts.on_tail("-h", "--help", "Show this message") do
|
198
207
|
puts opts
|
208
|
+
puts <<-End
|
209
|
+
|
210
|
+
#{ANSI.bold { "Usage samples:" }}
|
211
|
+
|
212
|
+
Generate new key 'foo.private.unikey' - will ask password from console (notice extension will be added automatically)
|
213
|
+
|
214
|
+
#{sample "unikeys -g 2048 -o foo"}
|
215
|
+
|
216
|
+
Show foo addresses:
|
217
|
+
|
218
|
+
#{sample "unikeys -s foo.private.unikey"}
|
219
|
+
|
220
|
+
Change password of the foo key and save it into new file bar.private.unikey (keeping both for security), will ask
|
221
|
+
new password from console
|
222
|
+
|
223
|
+
#{sample "unikeys -u foo.private.unikey -o bar"}
|
224
|
+
|
225
|
+
Change password in place (overwriting old file)
|
226
|
+
|
227
|
+
#{sample "unikeys -u foo.private.unikey -f"}
|
228
|
+
|
229
|
+
See project home page at #{ANSI.underline { "https://github.com/sergeych/universa" }}
|
230
|
+
|
231
|
+
End
|
199
232
|
exit
|
200
233
|
end
|
201
234
|
|
@@ -211,7 +244,11 @@ class KeyTool
|
|
211
244
|
## D_TIsYOfFQ2WejhG3
|
212
245
|
begin
|
213
246
|
opt_parser.order!
|
214
|
-
@tasks.
|
247
|
+
if @tasks.empty?
|
248
|
+
puts "nothing to do. Please specify one of: -g, -s or -u. See help for more (-h)."
|
249
|
+
else
|
250
|
+
@tasks.each { |t| t.call }
|
251
|
+
end
|
215
252
|
rescue MessageException, OptionParser::ParseError => e
|
216
253
|
STDERR.puts ANSI.red { ANSI.bold { "\nError: #{e}\n" } }
|
217
254
|
exit(1000)
|
data/lib/universa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: universa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.5.
|
4
|
+
version: 3.10.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergeych
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: farcall
|