cr.rb 3.17.0 → 3.18.0

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cr +16 -16
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bcff493846a9384661cdbeccdb88a225d5f0a7b180f97e04feeda0ba3e1c5e4
4
- data.tar.gz: a4916f5e641026b1905ccd88c3e7f4ab94f55aff93be0caca2b2a4e6cc75cbc6
3
+ metadata.gz: e488cf547d684aa64b4ea77581d1dd0fa9bc2203d1d247983ca1758ee23a35fd
4
+ data.tar.gz: 3d2cb486fc34987e637c40d14ca1a4316ad4a9f8bb2ece1d7443738c036448b5
5
5
  SHA512:
6
- metadata.gz: 100baa0634561310d3cbaa612b3cebb2b22d59215bdb4c0f19d74bbf6c5517fc10f80c75b289dd1fe3e2c3b1583a2198f5413a0018e8d9b135bbe0b65f23db45
7
- data.tar.gz: 90a547412b1a4139dd49e93459ef0873501a3b796fee0b616922532746bdaec43d5eec8caca3820e9c3f5233c6fd826e452494952b7f1253d45cac76f1d6f6f3
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.17.0"
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
- # disp = "Emacs"
214
+ # name = "Emacs"
215
215
  # desc = "edit macros"
216
- # full = "a feature-rich editor"
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
- disp = info['disp'] || red("No name!") # keyword `or` is invalid here in Ruby
223
+ name = info['name'] || red("No name!") # keyword `or` is invalid here in Ruby
224
224
 
225
225
  desc = info['desc']
226
- full = info['full']
226
+ more = info['more']
227
227
 
228
228
  if desc
229
- puts "\n #{disp}: #{desc}"
230
- print "\n ",full,"\n" if full
229
+ puts "\n #{name}: #{desc}"
230
+ print "\n ",more,"\n" if more
231
231
  else
232
- puts "\n #{disp}"
233
- print "\n ",full,"\n" if full
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
- # disp = "BlaH" # You may want to display a better name first
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['disp']
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['disp']
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 `full`
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?('full'))
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 - ["disp", "desc", "full", "same", "see"]
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['disp']
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)
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: 3.17.0
4
+ version: 3.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ccmywish