program_information 1.2.7 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53e8bc28a72a4c97854d6ae0a999ea70bba84d0ceff8811c767afdbbdaa8db99
4
- data.tar.gz: c4ea22bf184c5eb7a5a356a68106d49d2174a25e0fff0e687f1efb832b13c543
3
+ metadata.gz: 44a1cdd118c88db33f2fb7d541fcc93d943574a3efbc41b08c1b417695ed20f9
4
+ data.tar.gz: e9105429084c89cad854eba8b7287e90548439863c2e0d2a9065c9fee0171388
5
5
  SHA512:
6
- metadata.gz: 239b16d41362f0ae71f4628f150d1f549f41d5bdccb9301135ab145308d6a6ceaeccb6b9e4db36d9c86d95c2e28fdfc241cf43ba602b886518c2355284f3a33c
7
- data.tar.gz: 97c9ac8257aaf588d403094da235de5706cc9187df0139dd88f04d0f7629f1c50535c971c02d408669a71c9dbc935033871252dab17566819dcd9097c932ef2b
6
+ metadata.gz: e0405d209a987e34a5dcd5074287d8eba54c7d78e5788f9475aa561ac88abfd851027662005932723ea414cf822d3934d637d8bd406c30a2956911fab5dfb394
7
+ data.tar.gz: 95b49abdb03d5eee681ca82cf8f97f46110b479ba7e227db4b6f4179d55347cd358ed16f6a337948f966b36568232989390d0b1a5bcf78767335d232e7a6c326
@@ -378,7 +378,8 @@ class ProgramInformation # === ProgramInformation::ProgramInformation
378
378
  # ======================================================================= #
379
379
  # i.delete!('_') if i.include? '_'
380
380
  return [
381
- @short_name, @program_version
381
+ @short_name,
382
+ @program_version
382
383
  ]
383
384
  end; alias rnav return_name_and_version # === rnav
384
385
 
@@ -456,23 +457,6 @@ class ProgramInformation # === ProgramInformation::ProgramInformation
456
457
  end
457
458
  end; alias determine_name_and_program_version determine_the_three_main_variables # === determine_name_and_program_version
458
459
 
459
- # ========================================================================== #
460
- # === set_real_short_name
461
- #
462
- # The instance variable @real_short_name is not allowed to include any
463
- # '-' characters. It may also not include any '_' characters.
464
- #
465
- # The latter could be found as part of program names such as "SDL_image".
466
- # The @short_name variant may include these '_' tokens.
467
- #
468
- # Note that as of September 2017, we also disallow '.' tokens, such as
469
- # may occur accidentally in input like "sendmail.5.8.2".
470
- # ========================================================================== #
471
- def set_real_short_name(i = @short_name)
472
- i = i.to_s.dup.delete('-_.').rstrip
473
- @real_short_name = i
474
- end
475
-
476
460
  # ========================================================================== #
477
461
  # === set_short_name
478
462
  #
@@ -694,6 +678,25 @@ class ProgramInformation # === ProgramInformation::ProgramInformation
694
678
  @input = i
695
679
  end
696
680
 
681
+ # ========================================================================== #
682
+ # === set_real_short_name
683
+ #
684
+ # The instance variable @real_short_name is not allowed to include any
685
+ # '-' characters. It may also not include any '_' characters.
686
+ #
687
+ # The latter could be found as part of program names such as "SDL_image".
688
+ # The @short_name variant may include these '_' tokens.
689
+ #
690
+ # Note that as of September 2017, we also disallow '.' tokens, such as
691
+ # may occur accidentally in input like "sendmail.5.8.2".
692
+ # ========================================================================== #
693
+ def set_real_short_name(
694
+ i = @short_name
695
+ )
696
+ i = i.to_s.dup.delete('-_.').rstrip
697
+ @real_short_name = i
698
+ end
699
+
697
700
  # ========================================================================== #
698
701
  # === run (run tag)
699
702
  # ========================================================================== #
@@ -43,6 +43,7 @@ module ProgramInformation
43
43
  self.instance_eval { alias return_version_of return_program_version } # === ProgramInformation.return_version_of
44
44
  self.instance_eval { alias program_version return_program_version } # === ProgramInformation.program_version
45
45
  self.instance_eval { alias program_version? return_program_version } # === ProgramInformation.program_version?
46
+ self.instance_eval { alias version_of? return_program_version } # === ProgramInformation.version_of?
46
47
 
47
48
  # ========================================================================= #
48
49
  # === ProgramInformation.return_real_short_name
@@ -55,7 +56,9 @@ module ProgramInformation
55
56
  #
56
57
  # The above would return "isocodes".
57
58
  # ========================================================================= #
58
- def self.return_real_short_name(of_this_program = '')
59
+ def self.return_real_short_name(
60
+ of_this_program = ''
61
+ )
59
62
  if of_this_program.nil? or of_this_program.empty?
60
63
  opnn; e 'Please provide some input to the method '\
61
64
  'ProgramInformation.return_real_short_name.'
@@ -96,6 +99,18 @@ module ProgramInformation
96
99
  return array
97
100
  end; self.instance_eval { alias return_short_name_and_version return_short_name_and_program_version } # === ProgramInformation.return_short_name_and__version
98
101
 
102
+ # ========================================================================= #
103
+ # === ProgramInformation.long_program_name?
104
+ #
105
+ # Usage example:
106
+ #
107
+ # ProgramInformation.long_program_name?('man-pages-6.7')
108
+ #
109
+ # ========================================================================= #
110
+ def self.long_program_name?(i)
111
+ return_short_name_and_version(i).first
112
+ end
113
+
99
114
  # ========================================================================= #
100
115
  # === ProgramInformation.return_array_name_and_version
101
116
  #
@@ -11,7 +11,7 @@ class ProgramInformation
11
11
  # ========================================================================= #
12
12
  # === VERSION
13
13
  # ========================================================================= #
14
- VERSION = '1.2.7'
14
+ VERSION = '1.2.9'
15
15
  DEFAULT_VERSION = VERSION # Use an "alias" to the above constant.
16
16
 
17
17
  # ========================================================================= #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: program_information
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert A. Heiler