program_information 1.1.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of program_information might be problematic. Click here for more details.

Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +9 -0
  3. data/bin/program_information +14 -0
  4. data/doc/CONVENTIONS.md +22 -0
  5. data/doc/README.gen +9 -0
  6. data/lib/program_information/constants/array_test_with_this_as_input.rb +120 -0
  7. data/lib/program_information/constants/colours.rb +42 -0
  8. data/lib/program_information/constants/constants.rb +55 -0
  9. data/lib/program_information/constants/regex.rb +85 -0
  10. data/lib/program_information/initialize.rb +34 -0
  11. data/lib/program_information/menu.rb +29 -0
  12. data/lib/program_information/program_information.rb +568 -0
  13. data/lib/program_information/project/project_base_directory.rb +22 -0
  14. data/lib/program_information/report.rb +48 -0
  15. data/lib/program_information/requires/require_the_program_information_project.rb +9 -0
  16. data/lib/program_information/reset.rb +46 -0
  17. data/lib/program_information/run.rb +18 -0
  18. data/lib/program_information/toplevel_methods/e.rb +14 -0
  19. data/lib/program_information/toplevel_methods/opnn.rb +27 -0
  20. data/lib/program_information/toplevel_methods/remove_archive_type.rb +32 -0
  21. data/lib/program_information/toplevel_methods/return_proper_pipe_token_to_this_input.rb +167 -0
  22. data/lib/program_information/toplevel_methods/return_short_name.rb +38 -0
  23. data/lib/program_information/toplevel_methods.rb +159 -0
  24. data/lib/program_information/version/version.rb +22 -0
  25. data/lib/program_information/www/embeddable_interface.rb +61 -0
  26. data/lib/program_information.rb +5 -0
  27. data/program_information.gemspec +50 -0
  28. data/test/testing_program_information.rb +49 -0
  29. metadata +115 -0
@@ -0,0 +1,568 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === ProgramInformation::ProgramInformation
6
+ #
7
+ # The main class will reside here.
8
+ #
9
+ # This class can provide us with the proper name, and the proper version
10
+ # for any given program.
11
+ #
12
+ # We simply take the given input and use three components for it:
13
+ #
14
+ # (1) real_short_name
15
+ # (2) short_name
16
+ # (3) program_version
17
+ #
18
+ # Note that real_short_name depends on short_name. It simply is short_name
19
+ # with all instances of the '_' character removed. It is thus a dependent
20
+ # variable.
21
+ #
22
+ # The three numbers above also correspond to respective @instance_variables,
23
+ # so in other words we have @real_short_name, @short_name and
24
+ # @program_version.
25
+ #
26
+ # The input can be a bit "unclean". The class will try to get the "best"
27
+ # result out of any given input, no matter how unclean it is.
28
+ #
29
+ # It is recommended to use this class when wanting to determine the
30
+ # short_name and the program version of any given program.
31
+ # =========================================================================== #
32
+ # require 'program_information/program_information.rb'
33
+ # =========================================================================== #
34
+ require 'remove_file_suffix'
35
+ require 'program_information/project/project_base_directory.rb'
36
+ require 'program_information/toplevel_methods/e.rb'
37
+ require 'program_information/toplevel_methods/return_proper_pipe_token_to_this_input.rb'
38
+ require 'program_information/toplevel_methods/remove_archive_type.rb'
39
+ require 'program_information/constants/constants.rb'
40
+ require 'program_information/version/version.rb'
41
+ require 'program_information/initialize.rb'
42
+ require 'program_information/menu.rb'
43
+ require 'program_information/reset.rb'
44
+ require 'program_information/report.rb'
45
+ require 'program_information/run.rb'
46
+
47
+ module ProgramInformation
48
+
49
+ class ProgramInformation # === ProgramInformation::ProgramInformation
50
+
51
+ # ========================================================================= #
52
+ # === return_proper_pipe_token_to_this_input
53
+ # ========================================================================= #
54
+ def return_proper_pipe_token_to_this_input(i)
55
+ ::ProgramInformation.return_proper_pipe_token_to_this_input(i)
56
+ end
57
+
58
+ # ========================================================================= #
59
+ # === remove_file_suffix
60
+ #
61
+ # Delegate towards class RemoveFileSuffix. This is easier to handle
62
+ # Archive.
63
+ # ========================================================================= #
64
+ def remove_file_suffix(i)
65
+ RemoveFileSuffix[i.to_s]
66
+ end
67
+
68
+ # ========================================================================= #
69
+ # === do_not_replace_plus
70
+ # ========================================================================= #
71
+ def do_not_replace_plus
72
+ @replace_plus_with_long_name = false
73
+ end; alias do_not_replace_anything do_not_replace_plus # === do_not_replace_anything
74
+
75
+ # ========================================================================= #
76
+ # === set_program_version
77
+ #
78
+ # Use this method whenever you wish to assign to the @program_version
79
+ # variable.
80
+ #
81
+ # The input to this method may include stuff such as ".tar.xz", which
82
+ # should be chopped off, as it is not part of the program version.
83
+ #
84
+ # Keep in mind that we may also return nil.
85
+ #
86
+ # Until March 2015 we also replaced all '_' with '.' characters,
87
+ # but input such as "ncbi_cxx--12_0_0.tar.gz" would break as a
88
+ # consequence, so this was disabled again.
89
+ # ========================================================================= #
90
+ def set_program_version(i)
91
+ i = remove_file_suffix(i) unless i.nil? # Disallow archive-types here.
92
+ # ======================================================================= #
93
+ # The following check is not good at all because we may have input
94
+ # such as "1-0.112.0". Polkitqt has this, for instance.
95
+ # Thus, the following line was disabled on Feb 2016.
96
+ # ======================================================================= #
97
+ # if i.include? '-' # In this case, we use only the last part.
98
+ # i = i.split('-').last
99
+ # end
100
+ # ======================================================================= #
101
+ # And if result is actually an empty String, but the original input
102
+ # has included at the least one number, such as in "3.3.6-pl1",
103
+ # then we will simply use that instead.
104
+ # ======================================================================= #
105
+ if i.is_a?(String) and i.empty? and
106
+ @input =~ /\d+/ # <- If the input has at the least one Number.
107
+ i = @input.dup
108
+ end
109
+ @program_version = i
110
+ end; alias set_version set_program_version # === set_version
111
+
112
+ # ========================================================================= #
113
+ # === be_verbose?
114
+ # ========================================================================= #
115
+ def be_verbose?
116
+ @be_verbose
117
+ end
118
+
119
+ # ========================================================================= #
120
+ # === remove_plus_token?
121
+ # ========================================================================= #
122
+ def remove_plus_token?
123
+ @remove_plus_token
124
+ end
125
+
126
+ # ========================================================================= #
127
+ # === input?
128
+ # ========================================================================= #
129
+ def input?
130
+ @input
131
+ end
132
+
133
+ # ========================================================================= #
134
+ # === return_array
135
+ #
136
+ # This method will return a composite, 3-member Array that will hold the
137
+ # short_name, the real_short_name, and the program_version.
138
+ # ========================================================================= #
139
+ def return_array
140
+ [ short_name?, real_short_name?, program_version? ]
141
+ end; alias array? return_array # === array?
142
+
143
+ # ========================================================================= #
144
+ # === remove_plus_and_minus?
145
+ # ========================================================================= #
146
+ def remove_plus_and_minus?
147
+ @remove_plus_and_minus
148
+ end; alias remove_plus_and_minus remove_plus_and_minus? # === remove_plus_and_minus
149
+
150
+ # ========================================================================= #
151
+ # === apostroph?
152
+ # ========================================================================= #
153
+ def apostroph?
154
+ APOSTROPH
155
+ end
156
+
157
+ # ========================================================================= #
158
+ # === replace_plus_with_long_name?
159
+ # ========================================================================= #
160
+ def replace_plus_with_long_name?
161
+ @replace_plus_with_long_name
162
+ end
163
+
164
+ # ========================================================================= #
165
+ # === short_name_and_version?
166
+ #
167
+ # This method returns an aggregated @short_name+'-'+@program_version
168
+ # string.
169
+ # ========================================================================= #
170
+ def short_name_and_version?
171
+ "#{short_name?}-#{program_version?}"
172
+ end; alias short_name_and_version short_name_and_version? # === short_name_and_version
173
+
174
+ # ========================================================================= #
175
+ # === set_short_name_then_version
176
+ #
177
+ # This method will combine two other methods.
178
+ # ========================================================================= #
179
+ def set_short_name_then_version(a, b)
180
+ set_short_name(a)
181
+ set_program_version(b)
182
+ end; alias set_name_then_version set_short_name_then_version # === set_name_then_version
183
+
184
+ # ========================================================================= #
185
+ # === return_real_short_name_and_version
186
+ #
187
+ # We delegate to the module-method here.
188
+ # ========================================================================= #
189
+ def return_real_short_name_and_version(i)
190
+ ::ProgramInformation.return_real_short_name_and_version(i)
191
+ end
192
+
193
+ # ========================================================================= #
194
+ # === return_name_and_version
195
+ #
196
+ # This method will return an array with two elements:
197
+ #
198
+ # (1) The first element is the name of the program in question.
199
+ # (2) The second element is the version of the program in question.
200
+ #
201
+ # The input can be rather tricky and complicated.
202
+ #
203
+ # Consider the following examples:
204
+ #
205
+ # 'libunwind-1.0-rc1'
206
+ # 'htop-1.0.0'
207
+ # 'WebKit-r93670'
208
+ # 'xfce4-dev-tools-4.8.0'
209
+ # 'e_dbus-1.7.10.tar.gz'
210
+ # 'boost_1_54_0.tar.bz2'
211
+ # 'short-mime-1.0.0-rc1'
212
+ #
213
+ # This can all be valid input.
214
+ #
215
+ # Which are the key-assumptions that we can do here?
216
+ #
217
+ # I think the best assumption we can do is to find the first NUMBER in
218
+ # the given string, and then group the rest of the data according to
219
+ # this NUMBER. This will not work in the case of something such as
220
+ # WebKit-r93, as there is a 'r' character before that number.
221
+ # So we will have to make a second assumption: if the character preceding
222
+ # the first found integer is NOT a '-' character, we will instead split
223
+ # on that character instead. This will however lead to a problem for
224
+ # something like "xfce4-dev-tools-4.8.0". So, in case there is a '-'
225
+ # character immediately after the pos variable, we assume we have such
226
+ # a special case.
227
+ #
228
+ # On Sep 2011, I came up with a far simpler idea. We simply have to
229
+ # find the most important '-' and then split accordingly. As long as
230
+ # we can identify the most important '-' correctly, so long will
231
+ # everything else "just work". This also did not work out, so I
232
+ # switched to a regex instead. Since then it has worked very fine.
233
+ #
234
+ # Take input such as:
235
+ #
236
+ # "font-bitstream-75dpi-1.0.0"
237
+ #
238
+ # Note though that this approach does not work with input like:
239
+ # "CrownCutlass-Alpha1.4"
240
+ # unless we assume that alpha is a part of the version,
241
+ # which is possibly correct.
242
+ # ========================================================================= #
243
+ def return_name_and_version(i = nil)
244
+ if i
245
+ determine_the_three_main_variables(i)
246
+ end
247
+ # ======================================================================= #
248
+ # We must consider what we wish to do about the '_' characters. We could
249
+ # remove them, but certain programs such as e_dbus may require it as
250
+ # part of their name. Also, Version entries such as '1_2_3' will become
251
+ # '123' rather than '1.2.3'. Thus, on Jan 2014 I have disabled the
252
+ # following line.
253
+ # ======================================================================= #
254
+ # i.delete!('_') if i.include? '_'
255
+ return [
256
+ @short_name, @program_version
257
+ ]
258
+ end; alias rnav return_name_and_version # === rnav
259
+
260
+ # ========================================================================= #
261
+ # === set_shall_we_downcase
262
+ # ========================================================================= #
263
+ def set_shall_we_downcase(
264
+ i = SHALL_WE_DOWNCASE
265
+ )
266
+ @shall_we_downcase = i
267
+ end
268
+
269
+ # ========================================================================= #
270
+ # === do_not_downcase
271
+ # ========================================================================= #
272
+ def do_not_downcase
273
+ @shall_we_downcase = false
274
+ end
275
+
276
+ # ========================================================================= #
277
+ # === set_be_verbose
278
+ #
279
+ # Set to report in a verbose way here.
280
+ # ========================================================================= #
281
+ def set_be_verbose(i = BE_VERBOSE)
282
+ case i
283
+ when :be_verbose
284
+ i = true
285
+ end
286
+ @be_verbose = i
287
+ end
288
+
289
+ # ========================================================================= #
290
+ # === determine_the_three_main_variables
291
+ #
292
+ # This method will determine the three main instance variables:
293
+ #
294
+ # - @short_name
295
+ # - @real_short_name
296
+ # - @program_version
297
+ #
298
+ # We must be careful, as the input may not include any '-' or '_' token,
299
+ # and then the regex would fail. Hence, the behaviour of this method
300
+ # will depend on whether the input includes a '-' or whether it
301
+ # does not.
302
+ #
303
+ # Note that presently, set_input() will modify the given input and
304
+ # ensure that there will be a '-' token, even in input that does
305
+ # not have any '-' or '_' such as in 'sendmail.8.15.2'.
306
+ # ========================================================================= #
307
+ def determine_the_three_main_variables(i = @input)
308
+ if i
309
+ if i.include? '|'
310
+ splitted = i.split('|')
311
+ short_name = splitted.first.to_s.dup
312
+ program_version = splitted.last.to_s.dup
313
+ set_short_name(short_name)
314
+ set_program_version(program_version)
315
+ else
316
+ opn; e "The input `#{i}` does not include a | character."
317
+ end
318
+ end
319
+ end; alias determine_name_and_program_version determine_the_three_main_variables # === determine_name_and_program_version
320
+
321
+ # ========================================================================= #
322
+ # === set_real_short_name
323
+ #
324
+ # The instance variable @real_short_name is not allowed to include any
325
+ # '-' characters. It may also not include any '_' characters.
326
+ #
327
+ # The latter could be found as part of program names such as "SDL_image".
328
+ # The @short_name variant may include these '_' tokens.
329
+ #
330
+ # Note that as of September 2017, we also disallow '.' tokens, such as
331
+ # may occur accidentally in input like "sendmail.5.8.2".
332
+ # ========================================================================= #
333
+ def set_real_short_name(i = @short_name)
334
+ i = i.to_s.dup.delete('-_.').rstrip
335
+ @real_short_name = i
336
+ end
337
+
338
+ # ========================================================================= #
339
+ # === set_short_name
340
+ #
341
+ # Use this method whenever you wish to assign to the @short_name variable.
342
+ #
343
+ # This variable is allowed to keep '-' and '_' entries, but some
344
+ # settings may also modify this.
345
+ # ========================================================================= #
346
+ def set_short_name(i)
347
+ i = i.dup
348
+ # ======================================================================= #
349
+ # First, consider getting rid of '+' and '-' tokens in the
350
+ # @short_name variant of the program name.
351
+ # For this to work, @remove_plus_and_minus has to be set to true.
352
+ # ======================================================================= #
353
+ if remove_plus_and_minus?
354
+ i.delete!('+') if i.include? '+'
355
+ i.delete!('-') if i.include? '-'
356
+ end
357
+ # ======================================================================= #
358
+ # === Get rid of '+' tokens, if they are included.
359
+ # ======================================================================= #
360
+ if remove_plus_token?
361
+ i.delete!('+') if i.include? '+'
362
+ # ======================================================================= #
363
+ # === Alternatively, replace '+' with the string 'plus' should it
364
+ # exist there.
365
+ # ======================================================================= #
366
+ elsif replace_plus_with_long_name?
367
+ i.gsub!(/\+/, 'plus') if i.include? '+'
368
+ end
369
+ @short_name = i
370
+ set_real_short_name(i) # We will also sync towards @real_short_name.
371
+ end; alias set_name set_short_name # === set_name
372
+ alias set_program_name set_short_name # === set_program_name
373
+
374
+ # ========================================================================= #
375
+ # === remove_source_like_strings
376
+ # ========================================================================= #
377
+ def remove_source_like_strings(i)
378
+ # ======================================================================= #
379
+ # i.gsub!(/--/,'-') if i.include? '--' # Replace '--' with '-'.
380
+ # ^^^ May not be good, depending on the input.
381
+ # ======================================================================= #
382
+ i.sub!(/-src/,'') if i.include? '-src' # Get rid of -src entries.
383
+ i.sub!(/\.source/,'') if i.include? '.source'
384
+ i.sub!(/-source$/,'') if i.end_with? '-source'
385
+ return i
386
+ end
387
+
388
+ # ========================================================================= #
389
+ # === remove_archive_type
390
+ # ========================================================================= #
391
+ def remove_archive_type(i)
392
+ ::ProgramInformation.remove_archive_type(i)
393
+ return i
394
+ end
395
+
396
+ # ========================================================================= #
397
+ # === e
398
+ # ========================================================================= #
399
+ def e(i = '')
400
+ ::ProgramInformation.e(i)
401
+ end
402
+
403
+ # ========================================================================= #
404
+ # === real_short_name?
405
+ #
406
+ # Keep in mind that @real_short_name does not have any '-' tokens.
407
+ # ========================================================================= #
408
+ def real_short_name?
409
+ @real_short_name
410
+ end; alias real_name? real_short_name? # === real_name?
411
+ alias real_program_name? real_short_name? # === real_program_name?
412
+ alias real_short_name real_short_name? # === real_short_name
413
+ alias name_of_the_program? real_short_name? # === name_of_the_program?
414
+
415
+ # ========================================================================= #
416
+ # === short_name?
417
+ #
418
+ # Reader method for the @short_name instance variable.
419
+ #
420
+ # short_name is an alias to @short_name.
421
+ # ========================================================================= #
422
+ def short_name?
423
+ @short_name
424
+ end; alias program_name short_name? # === program_name
425
+ alias program_name? short_name? # === program_name?
426
+ alias name short_name? # === name
427
+ alias name? short_name? # === name?
428
+ alias return_short_name short_name? # === return_short_name
429
+ alias short_name short_name? # === short_name
430
+ alias return_name short_name? # === return_name
431
+ alias first short_name? # === first
432
+ alias return_program_real_name short_name? # === return_program_real_name
433
+
434
+ # ========================================================================= #
435
+ # === program_version?
436
+ #
437
+ # Getter method for the @program_version variable.
438
+ # ========================================================================= #
439
+ def program_version?
440
+ @program_version
441
+ end; alias program_version program_version? # === program_version
442
+ alias version program_version? # === version
443
+ alias version? program_version? # === version?
444
+ alias last? program_version? # === last?
445
+ alias last program_version? # === last?
446
+ alias version_of_the_program? program_version? # === version_of_the_program?
447
+
448
+ # ========================================================================= #
449
+ # === set_input
450
+ #
451
+ # This method will, after performing some sanitize-operations, assign
452
+ # to the @input variable.
453
+ # ========================================================================= #
454
+ def set_input(i)
455
+ if i.is_a? Array
456
+ menu(i)
457
+ i = i.join(' ').strip
458
+ end
459
+ i = i.to_s.dup if i.frozen?
460
+ i = File.basename(i)
461
+ # ======================================================================= #
462
+ # We .squeeze away '--' tokens.
463
+ # ======================================================================= #
464
+ i.squeeze!('-')
465
+ i.strip!
466
+ # ======================================================================= #
467
+ # Next, some simple replacements without any method.
468
+ # ======================================================================= #
469
+ i.sub!(/-paco/,'') if i.include? '-paco'
470
+ i.sub!(/\/Programs\//,'') if i.include? '/Programs'
471
+ # ======================================================================= #
472
+ # The following must not conflict with i.e. "pkgconfig", hence why we
473
+ # also include a '/' character.
474
+ # ======================================================================= #
475
+ i.gsub!(/\/pkg/,'') if i.include? '/pkg'
476
+ # ======================================================================= #
477
+ # i.gsub!(/\//,'-') # Controversial. Disabled for now as of Jan 2014.
478
+ # ======================================================================= #
479
+ # We don't want either { or }.
480
+ # ======================================================================= #
481
+ i.delete!('{') if i.include? '{'
482
+ i.delete!('}') if i.include? '}'
483
+ # ======================================================================= #
484
+ # As of July 2016, we get rid of all tokens that follow a '#' character.
485
+ # We also will get rid of the '#' as well. Must come before we call
486
+ # remove_archive_type().
487
+ # ======================================================================= #
488
+ if i.include? '#'
489
+ i = i[0...i.index('#')]
490
+ end
491
+ i = remove_archive_type(i)
492
+ i = remove_source_like_strings(i)
493
+ # ======================================================================= #
494
+ # Next, we correct for input such as "nana%201.5.4". This one has no
495
+ # '-' token and no '_' token, but a '%' token. This '%' token will be
496
+ # replaced.
497
+ # ======================================================================= #
498
+ if i.include? '%'
499
+ unless i.include?('_') or i.include?('-')
500
+ i.tr!('%','-')
501
+ end
502
+ end
503
+ # ======================================================================= #
504
+ # Leading '-' will be removed.
505
+ # ======================================================================= #
506
+ i[0,1] = '' if i.start_with? '-'
507
+ # ======================================================================= #
508
+ # === Handle downcasing of the given input
509
+ #
510
+ # This will consider downcasing the input. The reason as to why this is
511
+ # necessary is so that input such as "Libgnome" can become "libgnome".
512
+ # ======================================================================= #
513
+ i.downcase! if @shall_we_downcase
514
+ # ======================================================================= #
515
+ # === Handle '+' tokens
516
+ # ======================================================================= #
517
+ if REMOVE_PLUS_TOKEN
518
+ i.delete!('+') if i.include? '+'
519
+ end
520
+ i = return_proper_pipe_token_to_this_input(i)
521
+ @input = i
522
+ end
523
+
524
+ # ========================================================================= #
525
+ # === show_help (help tag)
526
+ #
527
+ # To invoke this method, try:
528
+ #
529
+ # pinfo --show-help
530
+ #
531
+ # ========================================================================= #
532
+ def show_help
533
+ e
534
+ e 'This class is able to split a given input (a string) into'
535
+ e 'the inferred program-name, and associated program version '\
536
+ 'of said string.'
537
+ e
538
+ e 'For example, if you have this input string:'
539
+ e
540
+ e ' gobject-introspection-1.52.1'
541
+ e
542
+ e 'then this class can split this into these constituents:'
543
+ e
544
+ e ' @real_short_name: gobjectintrospection'
545
+ e ' @short_name: gobject-introspection'
546
+ e ' @program_version: 1.52.1'
547
+ e
548
+ e 'This is especially useful for other projects that require this'
549
+ e 'functionality, such as the rbt gem.'
550
+ e
551
+ end
552
+
553
+ end
554
+
555
+ # =========================================================================== #
556
+ # === ProgramInformation[]
557
+ # =========================================================================== #
558
+ def self.[](i)
559
+ ::ProgramInformation::ProgramInformation.new(i)
560
+ end; self.instance_eval { alias new [] } # === ProgramInformation.new
561
+ self.instance_eval { alias parse [] } # === ProgramInformation.parse
562
+ self.instance_eval { alias combined [] } # === ProgramInformation.combined
563
+
564
+ end
565
+
566
+ if __FILE__ == $PROGRAM_NAME
567
+ ProgramInformation::ProgramInformation.new(ARGV)
568
+ end # pinfo /Users/x/SRC/gobjectintrospection/gobject-introspection-1.52.1.tar.xz
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'program_information/project/project_base_directory.rb'
6
+ # =========================================================================== #
7
+ module ProgramInformation
8
+
9
+ # ========================================================================= #
10
+ # === ProgramInformation::PROJECT_BASE_DIRECTORY
11
+ # ========================================================================= #
12
+ PROJECT_BASE_DIRECTORY =
13
+ "#{RbConfig::CONFIG['sitelibdir']}/program_information/"
14
+
15
+ # ========================================================================= #
16
+ # === ProgramInformation.project_base_dir?
17
+ # ========================================================================= #
18
+ def self.project_base_dir?
19
+ PROJECT_BASE_DIRECTORY
20
+ end
21
+
22
+ end
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ module ProgramInformation
6
+
7
+ class ProgramInformation
8
+
9
+ # ========================================================================= #
10
+ # === report (debug tag, report tag)
11
+ # ========================================================================= #
12
+ def report(
13
+ be_verbose = be_verbose?
14
+ )
15
+ case be_verbose
16
+ when :do_report, :be_verbose
17
+ be_verbose = true
18
+ end
19
+ lpad = 90
20
+ rpad = 49
21
+ if be_verbose
22
+ inner_ljust = 28
23
+ # ===================================================================== #
24
+ # === real short name
25
+ # ===================================================================== #
26
+ e (NAME_OF_CLASS+(' Program real short name ').ljust(inner_ljust)+'('+
27
+ yellow?+'@real_short_name'+rev+') is: ').ljust(lpad)+
28
+ (apostroph?+real_short_name?+apostroph?).
29
+ ljust(rpad)
30
+ # ===================================================================== #
31
+ # === short name
32
+ # ===================================================================== #
33
+ e (
34
+ NAME_OF_CLASS+(' Program name').ljust(inner_ljust)+'('+
35
+ yellow?+'@short_name'+rev+' ) is: '
36
+ ).ljust(lpad)+(apostroph?+short_name?+apostroph?).
37
+ ljust(rpad)
38
+ # ===================================================================== #
39
+ # === program version
40
+ # ===================================================================== #
41
+ e (NAME_OF_CLASS+(' Program version ').ljust(inner_ljust)+'('+
42
+ yellow?+'@program_version'+rev+') is: ').ljust(lpad)+
43
+ (apostroph?+version?+apostroph?).
44
+ ljust(rpad)
45
+ end
46
+ end; alias report_result report # === report_result
47
+
48
+ end; end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'program_information/requires/require_the_program_information_project.rb'
6
+ # =========================================================================== #
7
+ require 'program_information/toplevel_methods.rb'
8
+ require 'program_information/constants/array_test_with_this_as_input.rb'
9
+ require 'program_information/www/embeddable_interface.rb'