cr.rb 3.17.0 → 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cr +16 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e488cf547d684aa64b4ea77581d1dd0fa9bc2203d1d247983ca1758ee23a35fd
|
4
|
+
data.tar.gz: 3d2cb486fc34987e637c40d14ca1a4316ad4a9f8bb2ece1d7443738c036448b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a6c17680a3ff5089c254c854571d6a093e2ccec1af6486a63d79b5d09fd354a1efa111d62749a31ae9a1031c92e2b83daa09cd2d0ca69830efca61f1f6526a8
|
7
|
+
data.tar.gz: 203e97fa322cf3b7568d547ba513c99e55819ae3541ad7df4adac68c53ca33dcf4704955ae3eb5c5bbbc1ebd4152ebe2cee82737b8458612f716acd6eb6261f7
|
data/bin/cr
CHANGED
@@ -26,7 +26,7 @@ CRYPTIC_DEFAULT_DICTS = {
|
|
26
26
|
medicine: "https://github.com/cryptic-resolver/cryptic_medicine.git"
|
27
27
|
}
|
28
28
|
|
29
|
-
CR_GEM_VERSION = "3.
|
29
|
+
CR_GEM_VERSION = "3.18.0"
|
30
30
|
|
31
31
|
|
32
32
|
####################
|
@@ -211,26 +211,26 @@ end
|
|
211
211
|
#
|
212
212
|
# A info looks like this
|
213
213
|
# emacs = {
|
214
|
-
#
|
214
|
+
# name = "Emacs"
|
215
215
|
# desc = "edit macros"
|
216
|
-
#
|
216
|
+
# more = "a feature-rich editor"
|
217
217
|
# see = ["Vim"]
|
218
218
|
# }
|
219
219
|
#
|
220
220
|
# @param info [Hash] the information of the given word (mapped to a keyword in TOML)
|
221
221
|
#
|
222
222
|
def pp_info(info)
|
223
|
-
|
223
|
+
name = info['name'] || red("No name!") # keyword `or` is invalid here in Ruby
|
224
224
|
|
225
225
|
desc = info['desc']
|
226
|
-
|
226
|
+
more = info['more']
|
227
227
|
|
228
228
|
if desc
|
229
|
-
puts "\n #{
|
230
|
-
print "\n ",
|
229
|
+
puts "\n #{name}: #{desc}"
|
230
|
+
print "\n ",more,"\n" if more
|
231
231
|
else
|
232
|
-
puts "\n #{
|
233
|
-
print "\n ",
|
232
|
+
puts "\n #{name}"
|
233
|
+
print "\n ",more,"\n" if more
|
234
234
|
end
|
235
235
|
|
236
236
|
if see_also = info['see']
|
@@ -265,7 +265,7 @@ end
|
|
265
265
|
# same = "XDG downloader <=>xdg.Download" # this is correct
|
266
266
|
#
|
267
267
|
# [blah]
|
268
|
-
#
|
268
|
+
# name = "BlaH" # You may want to display a better name first
|
269
269
|
# same = "XDG downloader <=>xdg.Download" # this is correct
|
270
270
|
#
|
271
271
|
#
|
@@ -342,7 +342,7 @@ def pp_same_info(dict, word, cache_content, same_key, own_name)
|
|
342
342
|
return false
|
343
343
|
# double or more jumps
|
344
344
|
elsif same_key = info['same']
|
345
|
-
own_name = info['
|
345
|
+
own_name = info['name']
|
346
346
|
return pp_same_info(dict, same, cache_content, same_key, own_name)
|
347
347
|
else
|
348
348
|
pp_info(info)
|
@@ -391,7 +391,7 @@ def lookup(dict, file, word)
|
|
391
391
|
|
392
392
|
# synonym info print
|
393
393
|
if same_key = info['same']
|
394
|
-
own_name = info['
|
394
|
+
own_name = info['name']
|
395
395
|
pp_dict(dict)
|
396
396
|
pp_same_info(dict, word, sheet_content, same_key, own_name)
|
397
397
|
# It's also a type 1
|
@@ -401,14 +401,14 @@ def lookup(dict, file, word)
|
|
401
401
|
|
402
402
|
# normal info print
|
403
403
|
# To developer:
|
404
|
-
# The word should at least has one of `desc` and `
|
404
|
+
# The word should at least has one of `desc` and `more`
|
405
405
|
# But when none exists, this may not be considered wrong,
|
406
406
|
# Because the type2 make the case too.
|
407
407
|
#
|
408
408
|
# So, just ignore it, even if it's really a mistake(insignificant)
|
409
409
|
# by dictionary maintainers.
|
410
410
|
#
|
411
|
-
if !is_jump && (info.has_key?('desc') || info.has_key?('
|
411
|
+
if !is_jump && (info.has_key?('desc') || info.has_key?('more'))
|
412
412
|
pp_dict(dict)
|
413
413
|
pp_info(info)
|
414
414
|
type_1_exist_flag = true
|
@@ -416,7 +416,7 @@ def lookup(dict, file, word)
|
|
416
416
|
|
417
417
|
# Meanings with category specifier
|
418
418
|
# We call this meaning as type 2
|
419
|
-
categories = info.keys - ["
|
419
|
+
categories = info.keys - ["name", "desc", "more", "same", "see"]
|
420
420
|
|
421
421
|
if !categories.empty?
|
422
422
|
|
@@ -429,7 +429,7 @@ def lookup(dict, file, word)
|
|
429
429
|
categories.each do |meaning|
|
430
430
|
info0 = sheet_content[word][meaning]
|
431
431
|
if same_key = info0['same']
|
432
|
-
own_name = info0['
|
432
|
+
own_name = info0['name']
|
433
433
|
pp_same_info(dict, word, sheet_content, same_key, own_name)
|
434
434
|
else
|
435
435
|
pp_info(info0)
|