cr.rb 4.0.0.RC.1 → 4.0.0.alpha.1
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/bin/cr +16 -28
- data/lib/cr.rb +1 -1
- 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: cf84244ffcf5db536a394a4c7c6ad9679485be53d56baf821bca8a228dd4241b
|
4
|
+
data.tar.gz: 13393a7e9fd9e86d021ef39e830de56ffa548c8159cf172af61c6631e1d2ee93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e9316fb7d0e073600e815292c6ef3279cec61275a94ded64ddde456784027eb15d62c239ce953f1036212a8429546240af33bba371667d3f4958a71c823afb
|
7
|
+
data.tar.gz: fa316a2e6003409ba527d7ebb86ba474ebc97a3982e79826ed117a4c52b0bb6b3cfaf9b254c135db44484e9faaaee43d7fe6c956dd536dc234a934b38cf3ddc2
|
data/bin/cr
CHANGED
@@ -54,15 +54,6 @@ else
|
|
54
54
|
end
|
55
55
|
|
56
56
|
|
57
|
-
# Prevent runtime error
|
58
|
-
if not CR_EXTRA_LIBRARY.nil?
|
59
|
-
if ! test('d', CR_EXTRA_LIBRARY)
|
60
|
-
puts "FATAL: Your CRYPTIC_RESOLVER_CONFIG's option 'EXTRA_LIBRARY' is NOT a legal directory!"
|
61
|
-
exit 1
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
57
|
# This is used to display what you are pulling when adding dicts
|
67
58
|
CR_DEFAULT_DICTS_USER_AND_NAMES = CR_DEFAULT_DICTS.map do |e|
|
68
59
|
user, repo = e.split('/').last(2)
|
@@ -322,11 +313,11 @@ end
|
|
322
313
|
# # category
|
323
314
|
#
|
324
315
|
# [blah]
|
325
|
-
# same = "XDG downloader
|
316
|
+
# same = "XDG downloader <=>xdg.Download" # this is correct
|
326
317
|
#
|
327
318
|
# [blah]
|
328
319
|
# name = "BlaH" # You may want to display a better name first
|
329
|
-
# same = "XDG downloader
|
320
|
+
# same = "XDG downloader <=>xdg.Download" # this is correct
|
330
321
|
#
|
331
322
|
#
|
332
323
|
def pp_same_info(library, dict, word, cache_content, same_key, own_name)
|
@@ -348,13 +339,13 @@ def pp_same_info(library, dict, word, cache_content, same_key, own_name)
|
|
348
339
|
#
|
349
340
|
# 'jump to' will output to user, so this is important not only inside our sheet.
|
350
341
|
#
|
351
|
-
# same = "XDM downloader
|
342
|
+
# same = "XDM downloader<=>xdm.Download"
|
352
343
|
#
|
353
|
-
# We split 'same' key into two parts via spaceship symbol
|
344
|
+
# We split 'same' key into two parts via spaceship symbol <=>, first part will
|
354
345
|
# output to user, the second part is for internal jump.
|
355
346
|
#
|
356
347
|
|
357
|
-
jump_to, same = same_key.split("
|
348
|
+
jump_to, same = same_key.split("<=>")
|
358
349
|
same = jump_to if same.nil?
|
359
350
|
|
360
351
|
unless own_name
|
@@ -526,7 +517,7 @@ def resolve_word(word)
|
|
526
517
|
index = word.chr
|
527
518
|
case index
|
528
519
|
when '0'..'9'
|
529
|
-
index = '
|
520
|
+
index = '0123456789'
|
530
521
|
end
|
531
522
|
|
532
523
|
# cache lookup's results
|
@@ -725,6 +716,7 @@ def word_count(p:)
|
|
725
716
|
is_there_any_dict?
|
726
717
|
|
727
718
|
default_lib = Dir.children(CR_DEFAULT_LIBRARY)
|
719
|
+
extra_lib = Dir.children(CR_EXTRA_LIBRARY)
|
728
720
|
|
729
721
|
# Count default library
|
730
722
|
unless default_lib.empty?
|
@@ -737,21 +729,17 @@ def word_count(p:)
|
|
737
729
|
end
|
738
730
|
end
|
739
731
|
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
wc =
|
746
|
-
|
747
|
-
|
748
|
-
wc = count_dict_words(CR_EXTRA_LIBRARY,s)
|
749
|
-
$ExtraLibWordCount += wc
|
750
|
-
puts(" #{s.ljust(17)}: #{wc}") if p
|
751
|
-
end
|
732
|
+
# Count extra library
|
733
|
+
unless extra_lib.empty?
|
734
|
+
wc = 0
|
735
|
+
puts(bold(blue("\nExtra library:"))) if p
|
736
|
+
extra_lib.each do |s|
|
737
|
+
wc = count_dict_words(CR_EXTRA_LIBRARY,s)
|
738
|
+
$ExtraLibWordCount += wc
|
739
|
+
puts(" #{s.ljust(17)}: #{wc}") if p
|
752
740
|
end
|
741
|
+
$TwoLibWordCount = $DefaultLibWordCount + $ExtraLibWordCount
|
753
742
|
end
|
754
|
-
$TwoLibWordCount = $DefaultLibWordCount + $ExtraLibWordCount
|
755
743
|
|
756
744
|
if p
|
757
745
|
puts
|
data/lib/cr.rb
CHANGED