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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cr +16 -28
  3. data/lib/cr.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ce431672d430390ccfd417228f9c503c2d76ff8b34ac6b5f9af767f6412fcaa
4
- data.tar.gz: 51aa033e497ffa0a6e4c56cf29430951ddb756d1b21511b62cfa3dbd97719681
3
+ metadata.gz: cf84244ffcf5db536a394a4c7c6ad9679485be53d56baf821bca8a228dd4241b
4
+ data.tar.gz: 13393a7e9fd9e86d021ef39e830de56ffa548c8159cf172af61c6631e1d2ee93
5
5
  SHA512:
6
- metadata.gz: 6d8ddb4c90f742da36e3602444e1fc146080b6f73419d5688496d5414ffb0f54838f2ee6d3eeec3cce36cdf4bcb8d7ca46ac44f527772f54f19b5e0f05db795c
7
- data.tar.gz: '029a468f7a80d22b1596be5a284f7e0e98cdf886b9543434720e9f3ad454bfcef29cfe8ddad3f8e66195d4c151ddf7f41ce0d7aa699916d36efb7e17af92178d'
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 =>xdg.Download" # this is correct
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 =>xdg.Download" # this is correct
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=>xdm.Download"
342
+ # same = "XDM downloader<=>xdm.Download"
352
343
  #
353
- # We split 'same' key into two parts via spaceship symbol `=>`, first part will
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 = '0-9'
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
- if CR_EXTRA_LIBRARY
742
- extra_lib = Dir.children(CR_EXTRA_LIBRARY)
743
- # Count extra library
744
- unless extra_lib.empty?
745
- wc = 0
746
- puts(bold(blue("\nExtra library:"))) if p
747
- extra_lib.each do |s|
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
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # ------------------------------------------------------
12
12
 
13
- CR_GEM_VERSION = "4.0.0.RC.1"
13
+ CR_GEM_VERSION = "4.0.0.alpha.1"
14
14
 
15
15
 
16
16
  CR_OFFICIAL_DICTS = <<-EOF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cr.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.RC.1
4
+ version: 4.0.0.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ccmywish