cr.rb 4.0.0.alpha.2 → 4.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cr +24 -12
  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: 86ac16436cda04a1ca727329c6508f8c228d5049beb47ba02da193a684b1174d
4
- data.tar.gz: f303ed5311033dbcab4a66eec6ad786633c02e4967e286711681b77b4a01a726
3
+ metadata.gz: 1cab1b378efd946710c171f3dc45c994c5cc76a3b6672fc25fc696aa017dbb29
4
+ data.tar.gz: b7e9b9e5d3834ac18e898e9024cf4573f15197d00cc746f50685ea30f68efc9e
5
5
  SHA512:
6
- metadata.gz: 52f6b13011db64ac7c439e323ccf2093656b6dcc2e337815f68323a9bd5f79f3d33f0a2f1f2f6906c7d3d6e4e954c8a8573884268990c99ad7bd6426682de21e
7
- data.tar.gz: 1474e51ef60c31035104a0c66b168a1545f90085b13d3d8e468aa182f67885b8af3dbd7f1ed462b7b1251f847240255f8e0bf817bf2b94c1fbf88a3ef15ff0c2
6
+ metadata.gz: f75f57865bd0651a336d2ca553c5745974f892ffa5841fb4a3420efd1714ae1e08835632f77c45f5610002cae1190dc1d9e49c68a46865d576f91b114a56b134
7
+ data.tar.gz: 422bc7721e40f6878bea1f47c7781e0a8fa81e982eb9dfd1fdb9e766ea4bca753c84203c231aa96b04c0de083ca711a9c4d738ed94ee08dd79b66084e3b103e7
data/bin/cr CHANGED
@@ -54,6 +54,15 @@ 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
+
57
66
  # This is used to display what you are pulling when adding dicts
58
67
  CR_DEFAULT_DICTS_USER_AND_NAMES = CR_DEFAULT_DICTS.map do |e|
59
68
  user, repo = e.split('/').last(2)
@@ -313,11 +322,11 @@ end
313
322
  # # category
314
323
  #
315
324
  # [blah]
316
- # same = "XDG downloader <=>xdg.Download" # this is correct
325
+ # same = "XDG downloader =>xdg.Download" # this is correct
317
326
  #
318
327
  # [blah]
319
328
  # name = "BlaH" # You may want to display a better name first
320
- # same = "XDG downloader <=>xdg.Download" # this is correct
329
+ # same = "XDG downloader =>xdg.Download" # this is correct
321
330
  #
322
331
  #
323
332
  def pp_same_info(library, dict, word, cache_content, same_key, own_name)
@@ -339,13 +348,13 @@ def pp_same_info(library, dict, word, cache_content, same_key, own_name)
339
348
  #
340
349
  # 'jump to' will output to user, so this is important not only inside our sheet.
341
350
  #
342
- # same = "XDM downloader<=>xdm.Download"
351
+ # same = "XDM downloader=>xdm.Download"
343
352
  #
344
- # We split 'same' key into two parts via spaceship symbol <=>, first part will
353
+ # We split 'same' key into two parts via spaceship symbol `=>`, first part will
345
354
  # output to user, the second part is for internal jump.
346
355
  #
347
356
 
348
- jump_to, same = same_key.split("<=>")
357
+ jump_to, same = same_key.split("=>")
349
358
  same = jump_to if same.nil?
350
359
 
351
360
  unless own_name
@@ -517,7 +526,7 @@ def resolve_word(word)
517
526
  index = word.chr
518
527
  case index
519
528
  when '0'..'9'
520
- index = '0123456789'
529
+ index = '0-9'
521
530
  end
522
531
 
523
532
  # cache lookup's results
@@ -543,9 +552,12 @@ cr: Not found anything.
543
552
 
544
553
  You may
545
554
  1. Use `cr -u` to update all dicts
546
- 2. Use `cr -a user/repo` to add more available dicts
547
-
548
- See: https://github.com/cryptic-resolver
555
+
556
+ 2. Use
557
+
558
+ `cr -l` to list available official dicts
559
+
560
+ `cr -a repo` to add some dicts
549
561
 
550
562
  3. Contribute to theses dicts
551
563
 
@@ -634,11 +646,11 @@ Usage:
634
646
  cr emacs => Edit macros: A feature-rich editor
635
647
  cr -c => Print word count
636
648
  cr -l => List local dicts and official dicts
637
- cr -u => Update all dicts in default library
649
+ cr -u => Update all dicts in Default library
638
650
 
639
651
  cr -a repo.git => Add a new dict
640
652
  cr -a user/repo => Add a new dict from Github
641
- cr -a reponame => Add an official dict from Github
653
+ cr -a repo => Add an official dict from Github
642
654
 
643
655
  cr -d cryptic_xx => Delete a dict
644
656
  cr -s pattern => Search words matched with pattern
@@ -728,7 +740,7 @@ def word_count(p:)
728
740
  end
729
741
  end
730
742
 
731
-
743
+
732
744
  if CR_EXTRA_LIBRARY
733
745
  extra_lib = Dir.children(CR_EXTRA_LIBRARY)
734
746
  # Count extra library
data/lib/cr.rb CHANGED
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # ------------------------------------------------------
12
12
 
13
- CR_GEM_VERSION = "4.0.0.alpha.2"
13
+ CR_GEM_VERSION = "4.0.0.alpha.3"
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.alpha.2
4
+ version: 4.0.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ccmywish