environment_information 1.4.29

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

Potentially problematic release.


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

Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1061 -0
  3. data/bin/envi +7 -0
  4. data/bin/fast_envi +7 -0
  5. data/doc/README.gen +893 -0
  6. data/doc/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +54 -0
  7. data/environment_information.gemspec +130 -0
  8. data/lib/environment_information/base/base.rb +113 -0
  9. data/lib/environment_information/class/add.rb +186 -0
  10. data/lib/environment_information/class/colours.rb +283 -0
  11. data/lib/environment_information/class/constants.rb +35 -0
  12. data/lib/environment_information/class/environment_information.rb +51 -0
  13. data/lib/environment_information/class/help.rb +86 -0
  14. data/lib/environment_information/class/html.rb +78 -0
  15. data/lib/environment_information/class/initialize.rb +178 -0
  16. data/lib/environment_information/class/menu.rb +436 -0
  17. data/lib/environment_information/class/misc.rb +821 -0
  18. data/lib/environment_information/class/opn.rb +33 -0
  19. data/lib/environment_information/class/register_sigint.rb +20 -0
  20. data/lib/environment_information/class/reset.rb +213 -0
  21. data/lib/environment_information/class/ruby.rb +79 -0
  22. data/lib/environment_information/class/run.rb +61 -0
  23. data/lib/environment_information/class/show_display_and_report.rb +310 -0
  24. data/lib/environment_information/colours/colours.rb +150 -0
  25. data/lib/environment_information/colours/sfancy.rb +19 -0
  26. data/lib/environment_information/colours/simp.rb +19 -0
  27. data/lib/environment_information/constants/array_tracked_components.rb +207 -0
  28. data/lib/environment_information/constants/constants.rb +17 -0
  29. data/lib/environment_information/constants/encoding.rb +21 -0
  30. data/lib/environment_information/constants/error_line.rb +17 -0
  31. data/lib/environment_information/constants/file_constants.rb +102 -0
  32. data/lib/environment_information/constants/misc.rb +86 -0
  33. data/lib/environment_information/constants/namespace.rb +14 -0
  34. data/lib/environment_information/constants/newline.rb +16 -0
  35. data/lib/environment_information/constants/regex.rb +30 -0
  36. data/lib/environment_information/constants/temp_directory.rb +52 -0
  37. data/lib/environment_information/gui/gtk/bindings.rb +300 -0
  38. data/lib/environment_information/misc_components/README.md +3 -0
  39. data/lib/environment_information/misc_components/cflags.rb +36 -0
  40. data/lib/environment_information/misc_components/cpuinfo.rb +64 -0
  41. data/lib/environment_information/misc_components/operating_system.rb +54 -0
  42. data/lib/environment_information/misc_components/operating_system_bit_type.rb +42 -0
  43. data/lib/environment_information/misc_components/ram.rb +30 -0
  44. data/lib/environment_information/misc_components/rubygems_installation_directory.rb +54 -0
  45. data/lib/environment_information/misc_components/screen_resolution.rb +50 -0
  46. data/lib/environment_information/project/project.rb +27 -0
  47. data/lib/environment_information/queries/README.md +2 -0
  48. data/lib/environment_information/queries/complex_version.rb +263 -0
  49. data/lib/environment_information/queries/pkg_config.rb +125 -0
  50. data/lib/environment_information/queries/simple_version.rb +211 -0
  51. data/lib/environment_information/requires/require_asciitable.rb +15 -0
  52. data/lib/environment_information/requires/require_the_constants.rb +7 -0
  53. data/lib/environment_information/requires/require_the_environment_information_project.rb +23 -0
  54. data/lib/environment_information/requires/require_the_individual_misc_components.rb +30 -0
  55. data/lib/environment_information/requires/require_the_toplevel_methods.rb +22 -0
  56. data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +152 -0
  57. data/lib/environment_information/toplevel_methods/cd.rb +16 -0
  58. data/lib/environment_information/toplevel_methods/e.rb +30 -0
  59. data/lib/environment_information/toplevel_methods/hash.rb +60 -0
  60. data/lib/environment_information/toplevel_methods/internet_is_available.rb +30 -0
  61. data/lib/environment_information/toplevel_methods/is_on_roebe.rb +16 -0
  62. data/lib/environment_information/toplevel_methods/menu.rb +90 -0
  63. data/lib/environment_information/toplevel_methods/misc.rb +264 -0
  64. data/lib/environment_information/toplevel_methods/n_subcommands.rb +31 -0
  65. data/lib/environment_information/toplevel_methods/prefix_to_use.rb +39 -0
  66. data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +61 -0
  67. data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +45 -0
  68. data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +84 -0
  69. data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +28 -0
  70. data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +54 -0
  71. data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +28 -0
  72. data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +186 -0
  73. data/lib/environment_information/toplevel_methods/show_all_available_components.rb +192 -0
  74. data/lib/environment_information/toplevel_methods/write_what_into.rb +24 -0
  75. data/lib/environment_information/version/version.rb +25 -0
  76. data/lib/environment_information/www/sinatra_interface.rb +213 -0
  77. data/lib/environment_information/www/webobject_interface.cgi +29 -0
  78. data/lib/environment_information/yaml/array_default_programs_on_linux.yml +14 -0
  79. data/lib/environment_information/yaml/array_lfs_core_programs.yml +35 -0
  80. data/lib/environment_information/yaml/array_science_cluster.yml +12 -0
  81. data/lib/environment_information/yaml/array_tracked_non_programs.yml +13 -0
  82. data/lib/environment_information/yaml/array_tracked_programs.yml +165 -0
  83. data/lib/environment_information/yaml/array_tracked_xorg_components.yml +34 -0
  84. data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +215 -0
  85. data/lib/environment_information.rb +5 -0
  86. data/test/testing_environment_information.rb +26 -0
  87. data/test/testing_missing_components.rb +9 -0
  88. data/test/testing_prefix_for_the_environment_information_project.rb +20 -0
  89. metadata +195 -0
@@ -0,0 +1,821 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/misc.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ require 'environment_information/constants/array_tracked_components.rb'
14
+ require 'environment_information/constants/misc.rb'
15
+ require 'environment_information/class/add.rb'
16
+ require 'environment_information/class/show_display_and_report.rb'
17
+ require 'environment_information/toplevel_methods/misc.rb'
18
+ require 'environment_information/toplevel_methods/write_what_into.rb'
19
+ require 'environment_information/version/version.rb'
20
+
21
+ # ========================================================================= #
22
+ # === return_default_programs_on_linux
23
+ #
24
+ # This method should return the "main" programs on a linux computer,
25
+ # the most important entries.
26
+ # ========================================================================= #
27
+ def return_default_programs_on_linux
28
+ ARRAY_DEFAULT_PROGRAMS_ON_LINUX
29
+ end; alias return_default_programs_on_a_linux_computer return_default_programs_on_linux # === return_default_programs_on_a_linux_computer
30
+ alias return_default_programs return_default_programs_on_linux # === return_default_programs
31
+
32
+ # ========================================================================= #
33
+ # === do_show_almost_everything_excluding_the_default_linux_programs
34
+ #
35
+ # This is similar to do_show_everything() but it will not show
36
+ # the default linux programs.
37
+ # ========================================================================= #
38
+ def do_show_almost_everything_excluding_the_default_linux_programs
39
+ these_programs = return_every_registered_component
40
+ default_programs = return_default_programs
41
+ # ======================================================================= #
42
+ # Next subtract those that are part in the default_programs.
43
+ # ======================================================================= #
44
+ these_programs.reject! {|entry|
45
+ default_programs.include? entry
46
+ }
47
+ add(these_programs)
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === do_show_everything (everything tag, full tag)
52
+ #
53
+ # This method can be used when the user wishes to enable seeing
54
+ # full information about his local environment (on the computer).
55
+ #
56
+ # This will always display EVERY registered component.
57
+ #
58
+ # Commandline invocation:
59
+ #
60
+ # envi --everything
61
+ #
62
+ # ========================================================================= #
63
+ def do_show_everything
64
+ add(:everything) # Simply add everything.
65
+ end; alias do_show_full_information do_show_everything # === do_show_full_information
66
+ alias show_full_information do_show_everything # === show_full_information
67
+
68
+ # ========================================================================= #
69
+ # === consider_storing_the_components_that_were_displayed
70
+ # ========================================================================= #
71
+ def consider_storing_the_components_that_were_displayed
72
+ if store_the_results_into_local_files?
73
+ ::EnvironmentInformation.consider_storing_these_results_into_a_local_file
74
+ end
75
+ end; alias consider_storing_which_components_were_displayed consider_storing_the_components_that_were_displayed # === consider_storing_which_components_were_displayed
76
+
77
+ # ========================================================================= #
78
+ # === store_the_results_into_local_files?
79
+ # ========================================================================= #
80
+ def store_the_results_into_local_files?
81
+ @internal_hash[:store_the_results_into_local_files]
82
+ end
83
+
84
+ # ========================================================================= #
85
+ # === do_not_save_anything
86
+ # ========================================================================= #
87
+ def do_not_save_anything
88
+ @shall_the_results_be_saved = false
89
+ # ======================================================================= #
90
+ # We will also avoid saving the results into a local yaml file.
91
+ # ======================================================================= #
92
+ @internal_hash[:store_the_results_into_local_files] = false
93
+ end
94
+
95
+ # ========================================================================= #
96
+ # === do_show_only_the_operating_system
97
+ #
98
+ # To invoke this method, try:
99
+ #
100
+ # envi --os?
101
+ #
102
+ # ========================================================================= #
103
+ def do_show_only_the_operating_system
104
+ clear_old_dataset
105
+ add(:operating_system)
106
+ end
107
+
108
+ # ========================================================================= #
109
+ # === can_we_query_the_mate_desktop?
110
+ # ========================================================================= #
111
+ def can_we_query_the_mate_desktop?
112
+ is_rbt_available? and RBT.const_defined?(:ReportMateDesktopVersion)
113
+ end
114
+
115
+ # ========================================================================= #
116
+ # === show_n_registered_entries
117
+ #
118
+ # Invoke this via:
119
+ #
120
+ # envi --n_entries
121
+ #
122
+ # ========================================================================= #
123
+ def show_n_registered_entries
124
+ e "#{true_rev}The EnvironmentInformation project contains "\
125
+ "#{sfancy(::EnvironmentInformation.tracked_programs?.size)} "\
126
+ "#{true_rev}registered entries."
127
+ end
128
+
129
+ # ========================================================================= #
130
+ # === assign_components_for_the_short_format
131
+ #
132
+ # We will only display 6 components when we use the short variant.
133
+ # ========================================================================= #
134
+ def assign_components_for_the_short_format
135
+ clear_old_dataset
136
+ dont_show_ruby_stuff
137
+ add(%i(
138
+ operating_system
139
+ operating_system_bit_type
140
+ cpuinfo
141
+ cflags
142
+ RAM
143
+ screen_resolution
144
+ ))
145
+ end
146
+
147
+ # ========================================================================= #
148
+ # === may_we_try_to_use_rbt?
149
+ # ========================================================================= #
150
+ def may_we_try_to_use_rbt?
151
+ @may_we_try_to_use_rbt
152
+ end
153
+
154
+ # ========================================================================= #
155
+ # === write_what_into
156
+ # ========================================================================= #
157
+ def write_what_into(what, into)
158
+ ::EnvironmentInformation.write_what_into(what, into)
159
+ end
160
+
161
+ # ========================================================================= #
162
+ # === do_sort_alphabetically (sort tag)
163
+ # ========================================================================= #
164
+ def do_sort_alphabetically
165
+ _ = display_which_components?.sort_by {|name, version| name }
166
+ set_main_array(_)
167
+ end
168
+
169
+ # ========================================================================= #
170
+ # === enable_sort_alphabetically
171
+ # ========================================================================= #
172
+ def enable_sort_alphabetically
173
+ @sort_alphabetically = true
174
+ end
175
+
176
+ # ========================================================================= #
177
+ # === do_display_in_a_short_format
178
+ #
179
+ # The short-format means that we will use only a compact set of
180
+ # programs to display. For example, "make" and "bash" will not be
181
+ # displayed, neither "binutils" or "ruby".
182
+ # ========================================================================= #
183
+ def do_display_in_a_short_format
184
+ @display_everything_in_short_format = true
185
+ end
186
+
187
+ # ========================================================================= #
188
+ # === show_the_registered_components
189
+ # ========================================================================= #
190
+ def show_the_registered_components(
191
+ i = ARRAY_TRACKED_PROGRAMS
192
+ )
193
+ e
194
+ e 'The following programs will be tracked:'
195
+ e
196
+ i.each_with_index {|this_program, index| index += 1
197
+ padded_index = ' '+(index.to_s+') ').rjust(5)
198
+ colourized_and_padded_index = seagreen(padded_index)
199
+ e colourized_and_padded_index+
200
+ steelblue(this_program)
201
+ }
202
+ e
203
+ end
204
+
205
+ # ========================================================================= #
206
+ # === work_on_the_programs_directory_only
207
+ #
208
+ # This works on the /home/Programs/ directory directly.
209
+ #
210
+ # Invocation example:
211
+ #
212
+ # envi --work-on-programs-directory-only
213
+ #
214
+ # ========================================================================= #
215
+ def work_on_the_programs_directory_only(
216
+ use_this_as_programs_directory = '/home/Programs/'
217
+ )
218
+ # ======================================================================= #
219
+ # 1) First, we have to determine which programs are available.
220
+ # ======================================================================= #
221
+ e "#{rev}Determining which programs are available at the prefix "\
222
+ "#{steelblue(use_this_as_programs_directory)}:"
223
+ array_these_programs_are_available = []
224
+ ARRAY_TRACKED_PROGRAMS.each {|entry|
225
+ target = "#{use_this_as_programs_directory}#{entry.capitalize}"
226
+ if File.directory?(target)
227
+ # =================================================================== #
228
+ # In this case we know that this target exists.
229
+ # =================================================================== #
230
+ array_these_programs_are_available << entry
231
+ end
232
+ }
233
+ # ======================================================================= #
234
+ # 2) Checking these programs next.
235
+ # ======================================================================= #
236
+ clear_main_dataset
237
+ add(array_these_programs_are_available)
238
+ ::EnvironmentInformation.set_prefix_to_use(use_this_as_programs_directory)
239
+ end
240
+
241
+ # ========================================================================= #
242
+ # === set_main_array
243
+ # ========================================================================= #
244
+ def set_main_array(i)
245
+ @array_report_these_programs = i
246
+ end; alias set_display_these_components set_main_array # === set_display_these_components
247
+ alias set_use_this_as_main_input set_main_array # === set_use_this_as_main_input
248
+ alias set_report_these_programs set_main_array # === set_report_these_programs
249
+ alias show_only_the_components_from_this_dataset set_main_array # === show_only_the_components_from_this_dataset
250
+
251
+ # ========================================================================= #
252
+ # === set_runmode_gui
253
+ # ========================================================================= #
254
+ def set_runmode_gui
255
+ @runmode = :gui
256
+ end
257
+
258
+ # ========================================================================= #
259
+ # === set_runmode_html
260
+ # ========================================================================= #
261
+ def set_runmode_html
262
+ @runmode = :html
263
+ end
264
+
265
+ # ========================================================================= #
266
+ # === do_exit_the_program
267
+ # ========================================================================= #
268
+ def do_exit_the_program
269
+ @do_exit_the_program = true
270
+ end
271
+
272
+ # ========================================================================= #
273
+ # === gui?
274
+ # ========================================================================= #
275
+ def gui?
276
+ @runmode == :gui
277
+ end
278
+
279
+ # ========================================================================= #
280
+ # === commandline?
281
+ #
282
+ # Whether we run in the "commandline mode" or whether we run in the
283
+ # GUI or WWW/HTML mode.
284
+ # ========================================================================= #
285
+ def commandline?
286
+ @runmode == :commandline
287
+ end
288
+
289
+ # ========================================================================= #
290
+ # === be_silent
291
+ # ========================================================================= #
292
+ def be_silent
293
+ @be_silent = true
294
+ end
295
+
296
+ # ========================================================================= #
297
+ # === set_be_silent
298
+ # ========================================================================= #
299
+ def set_be_silent(i = true)
300
+ @be_silent = i
301
+ end
302
+
303
+ # ========================================================================= #
304
+ # === be_silent?
305
+ # ========================================================================= #
306
+ def be_silent?
307
+ @be_silent
308
+ end
309
+
310
+ # ========================================================================= #
311
+ # === start_the_sinatra_interface
312
+ # ========================================================================= #
313
+ def start_the_sinatra_interface
314
+ require 'environment_information/www/sinatra_interface.rb'
315
+ ::EnvironmentInformation.start_sinatra_interface
316
+ end
317
+
318
+ # ========================================================================= #
319
+ # === do_not_display_the_result
320
+ # ========================================================================= #
321
+ def do_not_display_the_result
322
+ @display_result = false
323
+ end
324
+
325
+ # ========================================================================= #
326
+ # === do_rename_kde_konsole
327
+ #
328
+ # This will attempt to rename the KDE Konsole tab, but only if we are
329
+ # on roebe.
330
+ # ========================================================================= #
331
+ def do_rename_kde_konsole(
332
+ use_this_title = 'Environment Information'
333
+ )
334
+ begin
335
+ require 'roebe/requires/require_kde_konsole.rb'
336
+ rescue LoadError; end
337
+ if try_to_rename_the_kde_konsole_tab? and
338
+ is_on_roebe? and
339
+ Object.const_defined?(:Roebe) and
340
+ Roebe.const_defined?(:KdeKonsole)
341
+ Roebe.rename_konsole(use_this_title)
342
+ end
343
+ end
344
+
345
+ # ========================================================================= #
346
+ # === use_ascii_table
347
+ #
348
+ # We will display in ascii-table format here.
349
+ # ========================================================================= #
350
+ def use_ascii_table
351
+ disable_colours # Can't use colours right now. Perhaps at a later time.
352
+ extend Terminal::Table::TableHelper
353
+ @table = table ['Name', 'Version']
354
+ @table.style = {
355
+ padding_left: 2,
356
+ width: 110 # Set the width here.
357
+ }
358
+ @use_ascii_table = true
359
+ end
360
+
361
+ # ========================================================================= #
362
+ # === show_everything?
363
+ # ========================================================================= #
364
+ def show_everything?
365
+ @show_everything
366
+ end
367
+
368
+ # ========================================================================= #
369
+ # === try_to_rename_the_kde_konsole_tab?
370
+ # ========================================================================= #
371
+ def try_to_rename_the_kde_konsole_tab?
372
+ @internal_hash[:try_to_rename_the_kde_konsole_tab]
373
+ end
374
+
375
+ # ========================================================================= #
376
+ # === is_a_registered_component?
377
+ # ========================================================================= #
378
+ def is_a_registered_component?(i)
379
+ ::EnvironmentInformation.is_this_component_included?(i)
380
+ end; alias is_an_allowed_entry? is_a_registered_component? # === is_an_allowed_entry?
381
+
382
+ # ========================================================================= #
383
+ # === do_not_run_already
384
+ # ========================================================================= #
385
+ def do_not_run_already
386
+ @run_already = false
387
+ end; alias do_not_run do_not_run_already # === do_not_run
388
+
389
+ # ========================================================================= #
390
+ # === open_this_file_in_editor
391
+ # ========================================================================= #
392
+ def open_this_file_in_editor
393
+ _ = "bluefish #{THIS_FILE}"
394
+ e _; system _; exit
395
+ end
396
+
397
+ # ========================================================================= #
398
+ # === xorg_components?
399
+ # ========================================================================= #
400
+ def xorg_components?
401
+ ::EnvironmentInformation.xorg_components?
402
+ end; alias return_all_xorg_components xorg_components? # === return_all_xorg_components
403
+
404
+ # ========================================================================= #
405
+ # === do_show_only_the_xorg_components
406
+ #
407
+ # This method will essentially clear the old dataset before adding
408
+ # all xorg-components to the display-part of this class.
409
+ #
410
+ # The components that are appended here, are defined in the file
411
+ # constants/array_tracked_components.rb - so if you wish to add
412
+ # new xorg-related entries, you should modify the entries in that
413
+ # .rb file.
414
+ # ========================================================================= #
415
+ def do_show_only_the_xorg_components
416
+ clear_old_dataset
417
+ do_not_show_the_ruby_components
418
+ add(:all_xorg_components)
419
+ end
420
+
421
+ # ========================================================================= #
422
+ # === clear_old_dataset
423
+ # ========================================================================= #
424
+ def clear_old_dataset
425
+ @array_report_these_programs.clear
426
+ end
427
+
428
+ # ========================================================================= #
429
+ # === shall_we_really_store_which_programs_are_not_up_to_date?
430
+ #
431
+ # This method will also honour whether the user is on a roebe-like
432
+ # system or whether the user is not.
433
+ # ========================================================================= #
434
+ def shall_we_really_store_which_programs_are_not_up_to_date?
435
+ is_on_roebe? and !@array_these_programs_not_up_to_date.empty?
436
+ end
437
+
438
+ # ========================================================================= #
439
+ # === result_as_array
440
+ #
441
+ # The lines that we will have inside of this method, may look like this:
442
+ #
443
+ # " operating_system: GNU/Linux\n"
444
+ #
445
+ # ========================================================================= #
446
+ def result_as_array
447
+ _ = dataset_as_string
448
+ splitted = _.split("\n")
449
+ splitted.map! {|inner_line|
450
+ inner_line.split(': ').map {|entry| entry.strip }
451
+ }
452
+ return splitted
453
+ end; alias result result_as_array # === result
454
+
455
+ # ========================================================================= #
456
+ # === clear_the_main_dataset
457
+ # ========================================================================= #
458
+ def clear_the_main_dataset
459
+ clear_old_dataset
460
+ do_not_display_the_ruby_components
461
+ end; alias clear_main_dataset clear_the_main_dataset # === clear_main_dataset
462
+ alias empty_main_dataset clear_the_main_dataset # === empty_main_dataset
463
+ alias empty_main_array clear_the_main_dataset # === empty_main_array
464
+
465
+ # ========================================================================= #
466
+ # === clear_toplevel_hash
467
+ # ========================================================================= #
468
+ def clear_toplevel_hash
469
+ ::EnvironmentInformation.clear_hash
470
+ end
471
+
472
+ # ========================================================================= #
473
+ # === dataset_as_string
474
+ #
475
+ # This method must return the dataset in String format. That String
476
+ # must already be properly "formatted".
477
+ # ========================================================================= #
478
+ def dataset_as_string
479
+ _ = ''.dup # Put the information onto that String here.
480
+ main_dataset?.each {|entry|
481
+ if entry.is_a? Array
482
+ entry = entry.first # The second entry is ignored in that event.
483
+ end
484
+ # ===================================================================== #
485
+ # Before we can use .send() we have to check whether EnvironmentInformation
486
+ # actually responds to that method. If not then we will simply skip
487
+ # this snippet for now; but this may have to be changed at some
488
+ # point in the future, to more elegantly handle failure. (Sep 2019).
489
+ # ===================================================================== #
490
+ use_this_method = "return_version_of_#{entry}".to_sym
491
+ if ::EnvironmentInformation.respond_to? use_this_method
492
+ program_version = ::EnvironmentInformation.send(
493
+ use_this_method
494
+ )
495
+ entry = " #{entry}:"
496
+ _ << "#{entry} #{program_version}#{N}"
497
+ end
498
+ }
499
+ return _ # And return the generated String.
500
+ end; alias string? dataset_as_string # === string?
501
+ alias string dataset_as_string # === string
502
+ alias main_string? dataset_as_string # === main_string?
503
+ alias stringified dataset_as_string # === stringified
504
+
505
+ # ========================================================================= #
506
+ # === start_gtk_component
507
+ #
508
+ # To invoke this method from the commandline, do:
509
+ #
510
+ # envi --start-gtk
511
+ #
512
+ # ========================================================================= #
513
+ def start_gtk_component
514
+ require 'environment_information/gui/gtk/bindings.rb'
515
+ ::EnvironmentInformation.run_gtk
516
+ @do_exit_the_program = true
517
+ end
518
+
519
+ # ========================================================================= #
520
+ # === return_version_of_awk?
521
+ # ========================================================================= #
522
+ def return_version_of_awk?
523
+ ::EnvironmentInformation.send(__method__)
524
+ end; alias return_version_of_awk return_version_of_awk? # == return_version_of_awk
525
+
526
+ # ========================================================================= #
527
+ # === return_version_of_binutils?
528
+ # ========================================================================= #
529
+ def return_version_of_binutils?
530
+ ::EnvironmentInformation.send(__method__)
531
+ end; alias return_version_of_binutils return_version_of_binutils? # == return_version_of_binutils
532
+
533
+ # ========================================================================= #
534
+ # === return_version_of_coreutils?
535
+ # ========================================================================= #
536
+ def return_version_of_coreutils?
537
+ ::EnvironmentInformation.send(__method__)
538
+ end; alias return_version_of_coreutils return_version_of_coreutils? # == return_version_of_coreutils
539
+
540
+ # ========================================================================= #
541
+ # === return_version_of_diffutils?
542
+ # ========================================================================= #
543
+ def return_version_of_diffutils?
544
+ ::EnvironmentInformation.send(__method__)
545
+ end; alias return_version_of_diffutils return_version_of_diffutils? # == return_version_of_diffutils
546
+
547
+ # ========================================================================= #
548
+ # === return_version_of_gcc?
549
+ # ========================================================================= #
550
+ def return_version_of_gcc?
551
+ ::EnvironmentInformation.send(__method__)
552
+ end; alias return_version_of_gcc return_version_of_gcc? # == return_version_of_gcc
553
+
554
+ # ========================================================================= #
555
+ # === return_version_of_linux_kernel?
556
+ # ========================================================================= #
557
+ def return_version_of_linux_kernel?
558
+ ::EnvironmentInformation.send(__method__)
559
+ end; alias return_version_of_linux_kernel return_version_of_linux_kernel? # == return_version_of_linux_kernel
560
+
561
+ # ========================================================================= #
562
+ # === is_this_program_included?
563
+ # ========================================================================= #
564
+ def is_this_program_included?(i)
565
+ ::EnvironmentInformation.is_this_program_included?(i)
566
+ end
567
+
568
+ # ========================================================================= #
569
+ # === return_version_of_glibc?
570
+ # ========================================================================= #
571
+ def return_version_of_glibc?
572
+ ::EnvironmentInformation.send(__method__)
573
+ end; alias return_version_of_glibc return_version_of_glibc? # == return_version_of_glibc
574
+
575
+ # ========================================================================= #
576
+ # === return_version_of_intltool?
577
+ # ========================================================================= #
578
+ def return_version_of_intltool?
579
+ ::EnvironmentInformation.send(__method__)
580
+ end; alias return_version_of_intltool return_version_of_intltool? # == return_version_of_intltool
581
+
582
+ # ========================================================================= #
583
+ # === return_version_of_grep?
584
+ # ========================================================================= #
585
+ def return_version_of_grep?
586
+ ::EnvironmentInformation.send(__method__)
587
+ end; alias return_version_of_grep return_version_of_grep? # == return_version_of_grep
588
+
589
+ # ========================================================================= #
590
+ # === return_version_of_gnupg?
591
+ # ========================================================================= #
592
+ def return_version_of_gnupg?
593
+ ::EnvironmentInformation.send(__method__)
594
+ end; alias return_version_of_gnupg return_version_of_gnupg? # == return_version_of_gnupg
595
+
596
+ # ========================================================================= #
597
+ # === return_version_of_bison?
598
+ # ========================================================================= #
599
+ def return_version_of_bison?
600
+ ::EnvironmentInformation.send(__method__)
601
+ end; alias return_version_of_bison return_version_of_bison? # == return_version_of_bison
602
+
603
+ # ========================================================================= #
604
+ # === return_version_of_flex?
605
+ # ========================================================================= #
606
+ def return_version_of_flex?
607
+ ::EnvironmentInformation.send(__method__)
608
+ end; alias return_version_of_flex return_version_of_flex? # == return_version_of_flex
609
+
610
+ # ========================================================================= #
611
+ # === operating_system?
612
+ #
613
+ # To quickly test this method, try:
614
+ #
615
+ # EnvironmentInformation::EnvironmentInformation.new { :do_not_run_yet }.operating_system?
616
+ #
617
+ # ========================================================================= #
618
+ def operating_system?
619
+ ::EnvironmentInformation.send(__method__)
620
+ end; alias return_version_of_operating_system operating_system? # === return_version_of_operating_system
621
+
622
+ # ========================================================================= #
623
+ # === load_dataset_from_this_file
624
+ #
625
+ # This method can be used to read which programs will be displayed
626
+ # from a local file, rather than rely on the pre-set default.
627
+ # ========================================================================= #
628
+ def load_dataset_from_this_file(i)
629
+ if File.exist? i
630
+ File.readlines(i).map {|entry|
631
+ entry.delete('-').strip # <- Clean up the input a little bit.
632
+ }
633
+ else
634
+ opnn; e "No file exists at `#{sfile(i)}`."
635
+ end
636
+ end; alias try_to_load_dataset_from_this_file load_dataset_from_this_file # === try_to_load_dataset_from_this_file
637
+ alias try_to_read_content_from_this_file load_dataset_from_this_file # === try_to_read_content_from_this_file
638
+
639
+ # ========================================================================= #
640
+ # === consider_storing_which_programs_are_not_up_to_date
641
+ # ========================================================================= #
642
+ def consider_storing_which_programs_are_not_up_to_date
643
+ if shall_we_really_store_which_programs_are_not_up_to_date?
644
+ into = FILE_THESE_PROGRAMS_CAN_BE_UPGRADED
645
+ what = YAML.dump(@array_these_programs_not_up_to_date)
646
+ if File.directory?('/home/Temp/rbt/')
647
+ into = "/home/Temp/rbt/#{File.basename(into)}"
648
+ else
649
+ into = "#{log_dir?}#{File.basename(into)}"
650
+ end
651
+ opnn; e 'We will also store which programs are not up to date.'
652
+ opnn; e "These will be stored into the file at `#{sfile(into)}`."
653
+ ::EnvironmentInformation.write_what_into(what, into)
654
+ end
655
+ end
656
+
657
+ require 'environment_information/misc_components/operating_system_bit_type.rb'
658
+ # ========================================================================= #
659
+ # === bit_type?
660
+ # ========================================================================= #
661
+ def bit_type?
662
+ ::EnvironmentInformation.operating_system_bit_type
663
+ end
664
+
665
+ # ========================================================================= #
666
+ # === register_unavailable_program
667
+ #
668
+ # Programs that were not be found can be registered through this method.
669
+ # ========================================================================= #
670
+ def register_unavailable_program(i)
671
+ i = i.to_sym # Let's store only Symbols.
672
+ @array_unavailable_programs << i
673
+ end; alias register_not_found register_unavailable_program # === register_not_found
674
+
675
+ require 'environment_information/misc_components/cpuinfo.rb'
676
+ # ========================================================================= #
677
+ # === cpu_model?
678
+ # ========================================================================= #
679
+ def cpu_model?
680
+ ::EnvironmentInformation.cpuinfo?
681
+ end
682
+
683
+ require 'environment_information/misc_components/ram.rb'
684
+ # ========================================================================= #
685
+ # === ram?
686
+ # ========================================================================= #
687
+ def ram?
688
+ ::EnvironmentInformation.ram?
689
+ end
690
+
691
+ require 'environment_information/misc_components/screen_resolution.rb'
692
+ # ========================================================================= #
693
+ # === screen_resolution?
694
+ # ========================================================================= #
695
+ def screen_resolution?
696
+ ::EnvironmentInformation.screen_resolution?
697
+ end
698
+
699
+ require 'environment_information/misc_components/cflags.rb'
700
+ # ========================================================================= #
701
+ # === cflags_in_use?
702
+ # ========================================================================= #
703
+ def cflags_in_use?
704
+ ::EnvironmentInformation.cflags_in_use?
705
+ end
706
+
707
+ # ========================================================================= #
708
+ # === return_every_registered_component
709
+ # ========================================================================= #
710
+ def return_every_registered_component
711
+ array = ::EnvironmentInformation.tracked_programs?+
712
+ ::EnvironmentInformation.tracked_non_programs?+
713
+ ::EnvironmentInformation.science_cluster?+
714
+ ::EnvironmentInformation.xorg_components?
715
+ array = array.flatten.uniq
716
+ # ======================================================================= #
717
+ # === The mate-desktop
718
+ #
719
+ # Since as of 31.03.2019 we will also try to show the mate-desktop
720
+ # components if the RBT project is available/installed.
721
+ # ======================================================================= #
722
+ if can_we_query_the_mate_desktop?
723
+ # ===================================================================== #
724
+ # Keep in mind that this Array is nested, so the name is
725
+ # included as well as the version.
726
+ # ===================================================================== #
727
+ _ = RBT.return_mate_desktop_version_array
728
+ _.each {|a,b|
729
+ # array << [a, b]
730
+ array << a
731
+ register_onto_the_main_hash(a, b)
732
+ }
733
+ end
734
+ return array # Return our findings.
735
+ end
736
+
737
+ # ========================================================================= #
738
+ # === clear_hash_and_missing_components
739
+ # ========================================================================= #
740
+ def clear_hash_and_missing_components
741
+ clear_toplevel_hash
742
+ clear_missing_components
743
+ end
744
+
745
+ # ========================================================================= #
746
+ # === clear_missing_components
747
+ # ========================================================================= #
748
+ def clear_missing_components
749
+ ::EnvironmentInformation.clear_missing_components
750
+ end
751
+
752
+ # ========================================================================= #
753
+ # === return_remote_gtk2_version
754
+ #
755
+ # Be wary when using this method, as it may slow down the whole
756
+ # application, due to making remote web-based queries.
757
+ # ========================================================================= #
758
+ def return_remote_gtk2_version
759
+ ::EnvironmentInformation.return_remote_gtk2_version
760
+ end
761
+
762
+ # ========================================================================= #
763
+ # === do_compare_the_program_version
764
+ #
765
+ # This method can be used if the user wishes to also compare the
766
+ # program version of the installed programs. This functionality
767
+ # depends on the rbt gem, and the RBT namespace.
768
+ # ========================================================================= #
769
+ def do_compare_the_program_version(
770
+ be_verbose = true
771
+ )
772
+ if be_verbose
773
+ @array_show_this_to_the_user <<
774
+ 'The program versions will also be compared.'
775
+ end
776
+ @internal_hash[:compare_program_versions] = true
777
+ end
778
+
779
+ # ========================================================================= #
780
+ # === compare_program_versions?
781
+ # ========================================================================= #
782
+ def compare_program_versions?
783
+ @internal_hash[:compare_program_versions]
784
+ end; alias compare_program_version? compare_program_versions? # === compare_program_version?
785
+
786
+ # ========================================================================= #
787
+ # === is_rbt_available_and_may_we_try_to_use_rbt?
788
+ # ========================================================================= #
789
+ def is_rbt_available_and_may_we_try_to_use_rbt?
790
+ is_rbt_available? and may_we_try_to_use_rbt?
791
+ end
792
+
793
+ # ========================================================================= #
794
+ # === report_the_remote_urls?
795
+ # ========================================================================= #
796
+ def report_the_remote_urls?
797
+ @internal_hash[:report_the_remote_urls]
798
+ end
799
+
800
+ # ========================================================================= #
801
+ # === return_version_of_busyboxy?
802
+ # ========================================================================= #
803
+ def return_version_of_busyboxy?
804
+ ::EnvironmentInformation.send(__method__)
805
+ end; alias return_version_of_busyboxy return_version_of_busyboxy? # == return_version_of_busyboxy
806
+
807
+ # ========================================================================= #
808
+ # === return_version_of_boost?
809
+ # ========================================================================= #
810
+ def return_version_of_boost?
811
+ ::EnvironmentInformation.send(__method__)
812
+ end; alias return_version_of_boost return_version_of_boost? # == return_version_of_boost
813
+
814
+ # ========================================================================= #
815
+ # === return_version_of_xvid?
816
+ # ========================================================================= #
817
+ def return_version_of_xvid?
818
+ ::EnvironmentInformation.send(__method__)
819
+ end; alias return_version_of_xvid return_version_of_xvid? # == return_version_of_xvid
820
+
821
+ end; end