environment_information 1.4.124

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 (80) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1322 -0
  3. data/bin/envi +7 -0
  4. data/bin/fast_envi +7 -0
  5. data/doc/README.gen +1058 -0
  6. data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +55 -0
  7. data/environment_information.gemspec +135 -0
  8. data/lib/environment_information/base/base.rb +166 -0
  9. data/lib/environment_information/class/class.rb +2580 -0
  10. data/lib/environment_information/class/colours.rb +282 -0
  11. data/lib/environment_information/colours/colours.rb +224 -0
  12. data/lib/environment_information/colours/sfancy.rb +19 -0
  13. data/lib/environment_information/colours/simp.rb +19 -0
  14. data/lib/environment_information/constants/array_tracked_components.rb +210 -0
  15. data/lib/environment_information/constants/constants.rb +17 -0
  16. data/lib/environment_information/constants/encoding.rb +21 -0
  17. data/lib/environment_information/constants/error_line.rb +17 -0
  18. data/lib/environment_information/constants/file_constants.rb +102 -0
  19. data/lib/environment_information/constants/misc.rb +86 -0
  20. data/lib/environment_information/constants/namespace.rb +14 -0
  21. data/lib/environment_information/constants/newline.rb +16 -0
  22. data/lib/environment_information/constants/regex.rb +30 -0
  23. data/lib/environment_information/constants/temp_directory.rb +52 -0
  24. data/lib/environment_information/gui/jruby/environment_information.rb +77 -0
  25. data/lib/environment_information/gui/shared_code/environment_information/environment_information_module.rb +99 -0
  26. data/lib/environment_information/gui/universal_widgets/environment_information/environment_information.rb +419 -0
  27. data/lib/environment_information/misc_components/README.md +3 -0
  28. data/lib/environment_information/misc_components/cflags.rb +36 -0
  29. data/lib/environment_information/misc_components/cpuinfo.rb +64 -0
  30. data/lib/environment_information/misc_components/operating_system.rb +54 -0
  31. data/lib/environment_information/misc_components/operating_system_bit_type.rb +42 -0
  32. data/lib/environment_information/misc_components/ram.rb +30 -0
  33. data/lib/environment_information/misc_components/rubygems_installation_directory.rb +54 -0
  34. data/lib/environment_information/misc_components/screen_resolution.rb +50 -0
  35. data/lib/environment_information/project/project.rb +27 -0
  36. data/lib/environment_information/queries/README.md +2 -0
  37. data/lib/environment_information/queries/complex_version.rb +273 -0
  38. data/lib/environment_information/queries/pkg_config.rb +125 -0
  39. data/lib/environment_information/queries/simple_version.rb +272 -0
  40. data/lib/environment_information/requires/require_asciitable.rb +15 -0
  41. data/lib/environment_information/requires/require_the_constants.rb +7 -0
  42. data/lib/environment_information/requires/require_the_environment_information_project.rb +23 -0
  43. data/lib/environment_information/requires/require_the_individual_misc_components.rb +30 -0
  44. data/lib/environment_information/requires/require_the_toplevel_methods.rb +22 -0
  45. data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +153 -0
  46. data/lib/environment_information/toplevel_methods/cd.rb +16 -0
  47. data/lib/environment_information/toplevel_methods/e.rb +43 -0
  48. data/lib/environment_information/toplevel_methods/hash.rb +65 -0
  49. data/lib/environment_information/toplevel_methods/internet_is_available.rb +30 -0
  50. data/lib/environment_information/toplevel_methods/is_on_roebe.rb +16 -0
  51. data/lib/environment_information/toplevel_methods/menu.rb +90 -0
  52. data/lib/environment_information/toplevel_methods/misc.rb +324 -0
  53. data/lib/environment_information/toplevel_methods/n_subcommands.rb +31 -0
  54. data/lib/environment_information/toplevel_methods/prefix_to_use.rb +39 -0
  55. data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +61 -0
  56. data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +45 -0
  57. data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +84 -0
  58. data/lib/environment_information/toplevel_methods/return_alias_to.rb +30 -0
  59. data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +28 -0
  60. data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +54 -0
  61. data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +28 -0
  62. data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +182 -0
  63. data/lib/environment_information/toplevel_methods/show_all_available_components.rb +192 -0
  64. data/lib/environment_information/toplevel_methods/write_what_into.rb +24 -0
  65. data/lib/environment_information/version/version.rb +25 -0
  66. data/lib/environment_information/www/sinatra_interface.rb +213 -0
  67. data/lib/environment_information/www/webobject_interface.cgi +29 -0
  68. data/lib/environment_information/yaml/array_default_programs_on_linux.yml +15 -0
  69. data/lib/environment_information/yaml/array_lfs_core_programs.yml +37 -0
  70. data/lib/environment_information/yaml/array_science_cluster.yml +12 -0
  71. data/lib/environment_information/yaml/array_tracked_non_programs.yml +13 -0
  72. data/lib/environment_information/yaml/array_tracked_programs.yml +235 -0
  73. data/lib/environment_information/yaml/array_tracked_xorg_components.yml +37 -0
  74. data/lib/environment_information/yaml/colours.yml +3 -0
  75. data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +284 -0
  76. data/lib/environment_information.rb +5 -0
  77. data/test/testing_environment_information.rb +26 -0
  78. data/test/testing_missing_components.rb +9 -0
  79. data/test/testing_prefix_for_the_environment_information_project.rb +20 -0
  80. metadata +177 -0
data/README.md ADDED
@@ -0,0 +1,1322 @@
1
+ [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://www.gobolinux.org/)
2
+ [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
+ [![Gem Version](https://badge.fury.io/rb/environment_information.svg)](https://badge.fury.io/rb/environment_information)
4
+
5
+ This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">27.03.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">19:39:48</span> o'clock.
6
+
7
+ ## About the environment_information gem
8
+
9
+ This project is called **EnvironmentInformation** (**environment information**).
10
+
11
+ Its primary goal is **to gather information about the environment that ruby is
12
+ presently running on** - in other words, **the host system** and its
13
+ capabilities.
14
+
15
+ This gathered information can then be shown to the user on the commandline,
16
+ or via a ruby-gtk widget, or via a sinatra-interface on the www. The main focus
17
+ for this project is on the **commandline-usage**, though. For example, the
18
+ file at **bin/fenvi**, which is part of this project, can be used to
19
+ quickly show all versions of different programs on the target computer
20
+ system.
21
+
22
+ To provide a short overview how this may look, taken on the **KDE konsole**
23
+ and **bash**, have a look at the following image on a black background:
24
+
25
+ ![alt text][screenshot1]
26
+ [screenshot1]: https://i.imgur.com/KiXIIVV.png
27
+
28
+ Invocation example:
29
+
30
+ fenvi
31
+
32
+ Generated output (only showing the first five entries):
33
+
34
+ atk 2.32.0
35
+ bash 5.0.0
36
+ binutils 2.32
37
+ bison 3.4.1
38
+ bzip2 1.0.8
39
+
40
+ Do note that by default **colours** will be used, so atk may appear
41
+ in green, and the associated version will be shown in a blue
42
+ colour (actually steelblue, by default). If you do not want to use
43
+ colours, you can disable them for the current invocation run, like
44
+ in this way:
45
+
46
+ envi --no-colours
47
+ envi --no-colors
48
+ envi --disable-colours
49
+ envi --disable-colors
50
+
51
+ Take note that you can tweak most of the behaviour of **EnvironmentInformation**
52
+ via specific **commandline flags**.
53
+
54
+ To obtain **a listing of the available options**, you can invoke the
55
+ main executable called **envi** (**bin/envi**) via:
56
+
57
+ envi --help
58
+
59
+ What is meant with the term **environment**?
60
+
61
+ **Definition**:
62
+
63
+ The term **environment**, within the context of the **environment_information gem**,
64
+ is **the (software) environment** that can be discovered by the ruby version
65
+ found within the **$PATH** variable, on the given computer system at hand.
66
+
67
+ Recall that there may be situations where there is more than one
68
+ version of ruby installed, on a given computer system, in different
69
+ locations - e. g. **/usr/bin/** versus **/usr/local/bin/**
70
+ versus **/home/** or **/opt/** setups. Thus, $PATH should be kept in mind in
71
+ the event that you have multiple ruby versions on the given computer system
72
+ at hand, as the incorrect ruby version may be discovered, in certain
73
+ situations. Furthermore keep also in mind that multiple binaries may exist
74
+ at the target system, e. g. bzip at /bin but also at /usr/bin or elsewhere.
75
+
76
+ Thus, I recommend to always ensure that **$PATH** is correctly set on the
77
+ target machine. First come, first serve, so it is a good advice to keep
78
+ PATH clean, and 'logical'.
79
+
80
+ At any rate, the **information** that will be gathered by the
81
+ **EnvironmentInformation** project may also be stored more persistently
82
+ in a **standalone .html file**, if you so desire to. This .html file
83
+ could then be used for static display of the information (but may
84
+ become quickly outdated, so keep this in mind as well).
85
+
86
+ The **Environment information** project may include any of the
87
+ following as its output:
88
+
89
+ - The **GCC Version** in use on the given computer host system.
90
+ - The (Linux) Kernel in use.
91
+ - Which Ruby Version is used.
92
+ - Which Rubygem version is used.
93
+ - The path to the rubygem directory.
94
+ - What the Host CPU Model is (on Linux at the least).
95
+ - What is the the **GTK*+, **GLIB*+ and **gdk-pixbuf** version, respectively.
96
+ - Which **dhcpcd version** is available.
97
+ - What Xorg components are available, such as libX11, libxcm, libxp,
98
+ libxau.
99
+
100
+ And so on and so forth - and a lot more.
101
+
102
+ Why are there many **different ways** to query the version of a locally
103
+ installed programs?
104
+
105
+ The main reason as to why **different ways** have to be supported is because
106
+ different software is installed in different ways, making use of
107
+ information in, well - different ways.
108
+
109
+ For example: not every software comes with a **.pc** file, so we can not
110
+ rely on .pc files uniformly for every installed program. Sometines no
111
+ commandline-binary is provided, so the **--version** flag can not be
112
+ used either; and if no .pc file exists for a given program, we may
113
+ have to query the name of the **.so files** (on a linux system),
114
+ and infer the version from that.
115
+
116
+ The main class in this project is **class EnvironmentInformation**,
117
+ which resides under **module EnvironmentInformation**.
118
+
119
+ The actual query of the version is done on the toplevel, so for example:
120
+
121
+ EnvironmentInformation.gcc?
122
+
123
+ would display the version of GCC at hand.
124
+
125
+ The code there will typically try to query .pc files via **pkg**-config,
126
+ but may sometimes try to infer the version from the .so file at hand,
127
+ and sometimes it will try to run the system binary (or an associated
128
+ binary) with a -V or -v or --version flag, and parse that output.
129
+
130
+ Typically the components that will be displayed, are handled by code
131
+ that resides in the file **display.rb**. The instance variable
132
+ **@display_these_components** keeps track of which components will
133
+ be displayed, so that information about these disparate programs
134
+ and components can be tracked.
135
+
136
+ There are in general only two entries that are of interest to
137
+ class EnvironmentInformation here:
138
+
139
+ (a) The name of the program.
140
+ (b) The associated specific program version, as String, of that program.
141
+
142
+ So, for example, we may see a key→value association like:
143
+
144
+ ruby => 2.5.1
145
+
146
+ If you need a **String** representation of the dataset then you can
147
+ use the method <b>.string?</b> or <b>.stringified</b>, which will give
148
+ you a **String** instead. The **.stringified** method exists
149
+ primarily due to **convenience** alone, for people who don't
150
+ want to do much conversion on their own and just be done with it).
151
+
152
+ There are various additional helper methods, such as a reader-method
153
+ called <b>.main_string?</b> or <b>.string</b> (they are equivalent to
154
+ one another, aka one is an alias).
155
+
156
+ This should allow you to re-use the information from this gem in
157
+ other projects, such as if you wish to get the String of all
158
+ available programs, and display this on a webpage. Or, alternatively,
159
+ just use a toplevel method call, such as:
160
+
161
+ EnvironmentInformation.glibc_version?
162
+
163
+ ## How to make use of the project
164
+
165
+ There are, essentially, three recommended ways how to use the main
166
+ class of this project:
167
+
168
+ (1)
169
+
170
+ From the commandline, just call **envi** directly and pass in
171
+ specific commands to this executable (optionally).
172
+
173
+ For instance: invoke the envi-executable with the argument "ALL"
174
+ or "--all" and the class will show all information that could
175
+ be found. This is personally my favourite way how to invoke
176
+ this class. I even combine it with "FALL" or "RALL" (**--really-all**
177
+ or **--really-everything**), which will also compare the programs
178
+ versions that are available, if the RBT project is available
179
+ (**gem install rbt**), and then inform me as to which programs
180
+ are **not** up-to-date on the local computer system at hand. This
181
+ then allows me to compile/install these programs. This idea came
182
+ to be because I liked the Linux from Scratch project a lot, and
183
+ there you may often have to upgrade programs.
184
+
185
+ Note that **--really-everything** may be hard to type. I suggest to
186
+ use an alias in that case, or just the upcased variant **FALL** or
187
+ **RALL**. See the file <b>menu.rb</b> for more aliases to that.
188
+
189
+ (2)
190
+
191
+ The other use case is the "embedded use", i.e. for use in a
192
+ <b>.cgi page</b> or perhaps for a ruby-on-rails webpage.
193
+
194
+ An example for the former follows:
195
+
196
+ _ = EnvironmentInformation.new(:do_not_run_yet) # The symbol allows us to prepare the class first.
197
+ _.set_n_tokens 58
198
+ _.disable_colours # <- Recommended, since the colours are thought for the commandline only.
199
+ _.be_silent
200
+ _.dont_show_ruby_stuff # <- If you do not need information about ruby.
201
+ _.run
202
+
203
+ But you do not have to instantiate a new object; you can
204
+ simply use another toplevel API, since as of September 2019.
205
+
206
+ (3)
207
+
208
+ For example, to query the glibc version, you could use this:
209
+
210
+ EnvironmentInformation.glibc? # => "2.29"
211
+
212
+ Which variant to prefer? This depends on your use case. If you
213
+ need more flexibility then you should use the class; if you
214
+ only need the version-string, number 3 may be best as it is
215
+ the simplest.
216
+
217
+ You can also display some additional information, such as the version
218
+ of GTK, Glib, Atk and Pango, by passing in "f" or "full" or "--full"
219
+ on the commandline, without the quotation marks.
220
+
221
+ See the help section to this this script, which can be invoked by
222
+ passing "help" or "--help" as argument to envi.
223
+
224
+ You can also pass this information through a block (as a Hash inside
225
+ of that block), if you would like to:
226
+
227
+ _ = EnvironmentInformation.new(:do_not_run_yet) {{
228
+ n_tokens: 58,
229
+ use_colours: no,
230
+ be_silent: true
231
+ show_ruby_stuff: no
232
+ }}
233
+ _.run
234
+
235
+ Do note that the following **API** also works, primarily due to
236
+ convenience - you can try it in **irb**, of course:
237
+
238
+ require 'environment_information'
239
+
240
+ EnvironmentInformation[]
241
+
242
+ The executable version for class EnvironmentInformation is called <b>envi</b>.
243
+ It will reside under **bin/envi** of this gem.
244
+
245
+ So you can invoke the script by typing "envi" from the commandline,
246
+ without the quotes; if you installed it as a gem into a prefix
247
+ other than /usr, it may be that the bin/ directory resides only
248
+ in that gem, though. Setting an alias may help in this case.
249
+
250
+ ## Colours used by the EnvironmentInformation project
251
+
252
+ Support for colours in the <b>environment_information</b> gem
253
+ is available through the following file:
254
+
255
+ environment_information/colours/colours.rb
256
+
257
+ Which, in turn, taps into the **colours** gem.
258
+
259
+ In theory other colour-related gems could be used as well, but this may
260
+ require someone to write support-code for this, in regards to other
261
+ gems.
262
+
263
+ Presently (August 2020; September 2022) this project <b>only</b> uses
264
+ the **colours** gem (**gem install colours**), though.
265
+
266
+ You can specifically **disable** the use of colours for the current
267
+ invocation run, for whatever the reasons, from the commandline,
268
+ via either:
269
+
270
+ envi --disable-colours
271
+ envi --disable-colors
272
+ envi --nocolours
273
+ envi --nocolors
274
+ envi --no-colours
275
+
276
+ envi --really-all --disable-colours
277
+ envi --really-all --disable-colors
278
+
279
+ envi --all --disable-colours
280
+ envi --all --disable-colors
281
+
282
+ Note that <b>envi</b> refers to <b>bin/envi</b>, which is distributed
283
+ as part of this gem.
284
+
285
+ Both UK and US spelling should work fine in regards to colours/colors;
286
+ use whichever variant you prefer. As I was taught the UK spelling in
287
+ school, I prefer the UK spelling in general.
288
+
289
+ Internally, the <b>@use_colours</b> variable is used to determine
290
+ whether colours are to be used for the main class of this gem.
291
+
292
+ You can <b>query</b> the current setting via the following toplevel
293
+ method (in ruby):
294
+
295
+ EnvironmentInformation.use_colours?
296
+
297
+ You can also query whether colours are used via <b>envi</b>
298
+ as well (the **bin/envi** file) from the commandline, via:
299
+
300
+ envi --use-colours?
301
+ envi --use-colors?
302
+
303
+ The default assumption for commandline use of this gem is that
304
+ the user uses a black/dark background in the terminal; and white
305
+ colour for the text, or at the least some light/bright colour.
306
+
307
+ Not every uses uses a black background, though. In these cases
308
+ the default colours used by the environment_gem are not optimal.
309
+
310
+ Because this may be a concern for some users, support was added
311
+ to the environment_information gem to allow them to use different
312
+ colours if they want to. So, not only can you disable colours
313
+ altogether, but you can also fine-tune them to your liking, if
314
+ you want to.
315
+
316
+ The file that will handle this is a .yml file and it normally
317
+ resides at:
318
+
319
+ environment_information/yaml/colours.yml
320
+
321
+ Currently (September 2022) it only covers two values - the
322
+ colour for the left-hand display, and the colour for the
323
+ right-hand display. This refers to the table-layout that
324
+ you can see when you use the environment_gem (bin/envi)
325
+ on the commandline. To the left side one will typically
326
+ see the name of the program; to the right side the version
327
+ of that program is shown. The two colour names used in
328
+ the .yml file will determine this. You can change the names
329
+ there; I use HTML colour names.
330
+
331
+ If the .yml file can not be found or is missing then the
332
+ two default colours in use will be <b>forestgreen</b>
333
+ (for the left side) and <b>steelblue</b> (for the
334
+ right side).
335
+
336
+ A third entry exists called <b>program_not_found</b>,
337
+ defaulting to <b>lightslategrey</b>. Most users probably may
338
+ not need to change this, but in the event that you would
339
+ like to, you can change it of course. In principle commandline
340
+ support could be added to change the colours on an ad-hoc
341
+ basis during a run of bin/envi, but for now I'll leave it
342
+ how it is. If someone wants to be able to fine-tune the colours
343
+ on the commandline, without wanting to modify the .yml file,
344
+ let me know; I'll add support in this case then.
345
+
346
+ Note that you can combine this in various means.
347
+
348
+ For instance, to show information about EVERY program,
349
+ and use a compact display without any newlines, while
350
+ also disabling colours, use the following:
351
+
352
+ envi --rall --oneliner --disable-colours
353
+
354
+ The following image shows how this looks:
355
+
356
+ <img src="https://i.imgur.com/dt3PhRY.png" style="margin: 2em">
357
+
358
+ Yes, this is not very elegant and hard(er) to read,
359
+ but imagine if you work on Linux runlevel 3, without
360
+ a GUI. In this case this can be convenient to have
361
+ in one terminal as you work.
362
+
363
+
364
+ ## fenvi
365
+
366
+ There is an executable at **bin/fast_envi**, as part of this gem, which
367
+ complements the executable at **bin/envi**. envi is simply an abbreviation
368
+ to "environment information"; and fenvi stands for "fast environment
369
+ information". That is exactly the primary use case for fenvi - it shall
370
+ allow for maximum speed, without "maximal usability". The latter means
371
+ that fenvi will not offer as much customization/flexibility as envi
372
+ does. In fact - the EnvironmentInformation project was rewritten in
373
+ **September 2019** precisely to make the whole project much more
374
+ performant and faster; the old code was too slow, for various reasons.
375
+ (Note: I am using an alias called fenvi that refers to fenvi; the
376
+ official name of the executable is **fast_envi** though.)
377
+
378
+ Nonetheless, **fenvi** also supports some commandline flags.
379
+
380
+ For example, if you wish to only show the registered xorg components
381
+ and their corresponding versions, then you can issue the following
382
+ flag:
383
+
384
+ fenvi --xorg
385
+
386
+ This would **show all xorg components**.
387
+
388
+ fenvi --help
389
+
390
+ Would show the help options. Right now this is limited to just two
391
+ options (or perhaps a bit more than that in the long run).
392
+
393
+ Another option is:
394
+
395
+ fenvi --compare-to-program-versions
396
+
397
+ This can be used to quickly compare the program versions of the
398
+ local computer system. Note that this functionality depends on
399
+ the RBT gem:
400
+
401
+ gem install rbt
402
+
403
+ ## Determining which programs should be shown on your own
404
+
405
+ You can decide to only show the version of some programs, via the
406
+ **commandline** specifically.
407
+
408
+ For example, say that you wish to see only the versions of **ruby**,
409
+ **python** and **perl**, then you could try the following:
410
+
411
+ envi --use-these-programs=ruby,python,perl
412
+
413
+ If you wish to display the local versions of **bash**, **binutils**
414
+ and **bison**, then you can try this:
415
+
416
+ envi --use-these-programs=bash,binutils,bison
417
+
418
+ If you wish to show all components that may be important for
419
+ the LFS (linux from scratch) project then you can use this:
420
+
421
+ envi --use-these-programs=bash,binutils,bison,flex,bzip2,coreutils,diffutils,find,awk,gcc,grep,gzip,linux,make,m4,patch,perl,python,sed,tar,texinfo,xz
422
+
423
+ Since that is a bit annoying to type (it's quite long), you can also
424
+ use the **fake-symbol** :lfs for this instead:
425
+
426
+ envi --use-these-programs=:lfs
427
+
428
+ Or, even simpler than that:
429
+
430
+ envi --lfs
431
+
432
+ In fact, this functionality has been added precisely to
433
+ avoid using a shell script, such as this one:
434
+
435
+ http://www.linuxfromscratch.org/lfs/view/development/chapter02/hostreqs.html
436
+
437
+ The name **fake-symbol** is given because via the commandline
438
+ you can only pass e. g. a String, not a Symbol, as bash does
439
+ not know what a Symbol is. So if a string has a leading :
440
+ then the EnvironmentInformation project will assume that the
441
+ user wanted to convey a **special meaning**.
442
+
443
+ If you do not wish to save any local file then invoke EnvironmentInformation
444
+ in this way:
445
+
446
+ envi --lfs --no-save
447
+
448
+ If you wish to show the local version of openssl as well, try
449
+ adding this commandline flag:
450
+
451
+ envi --openssl
452
+
453
+ ## xorg components
454
+
455
+ To display the registered **xorg components**, you could use any of
456
+ the following commandline flags:
457
+
458
+ envi --xorg-components
459
+ envi --xorg
460
+
461
+ Do note that not necessarily every xorg component is registered,
462
+ but most of the xorg-components should be covered by now.
463
+
464
+ ## Reading from a local file
465
+
466
+ The **EnvironmentInformation project** can read from a **local file**
467
+ containing the programs whose version you would like to show, on the
468
+ commandline.
469
+
470
+ The commandline invocation goes like this:
471
+
472
+ envi --read-from-this-file=/Depot/j/display_these_programs.md
473
+ envi --file=/Depot/j/display_these_programs.md
474
+ envi --input-from=/Depot/j/display_these_programs.md
475
+
476
+ The reason as to why this functionality has been made available
477
+ is so that people can use their own custom input to the main
478
+ class of this gem, if they would like to.
479
+
480
+ A requirement for this to work is that there is a corresponding
481
+ component that can query the version of a program. I am open for
482
+ suggestions what to add, if anything is missing, as well as
483
+ including a more generic way to make a query. Either way this
484
+ depends on others to make suggestions.
485
+
486
+ ## Sorting the components alphabetically
487
+
488
+ You can display the components in an alphabetical manner, if you
489
+ would like to, through this:
490
+
491
+ envi --sort-alphabetically
492
+
493
+ ## Sinatra interface
494
+
495
+ Since as of **May 2019** there is now a small sinatra "interface"
496
+ available.
497
+
498
+ To start it, try:
499
+
500
+ envi --sinatra
501
+
502
+ In order for this to work, you need to have sinatra installed, such as
503
+ via this way:
504
+
505
+ gem install sinatra
506
+
507
+ or
508
+
509
+ gem install sinatra --user-install # into the home directory
510
+
511
+ It is not a mandatory dependency for this gem, so it is not registered
512
+ to be a hard dependency in the **.gemspec** file.
513
+
514
+ ## The science cluster
515
+
516
+ There are also a few science-related applications, such as for hmmer
517
+ or relion. To query their versions specifically you can issue:
518
+
519
+ envi --science
520
+
521
+ ## Show the URL of every registered program
522
+
523
+ You can, if you like to, show the remote URLs to the different
524
+ programs, if you have the **RBT project** installed (**gem install rbt**).
525
+
526
+ Then, you should be able to do the following:
527
+
528
+ envi --everything --show-remote-url
529
+
530
+ This variant will not only display the local programs found,
531
+ but will additionally also show the **remote URLs** on the
532
+ commandline, on the right hand side, to the corresponding
533
+ program at hand.
534
+
535
+ ## Only display the operating system in use
536
+
537
+ If you are only interested in seeing the operating system, try
538
+ this **commandline flag**:
539
+
540
+ envi --os?
541
+
542
+ ## Showing additional programs on an ad-hoc basis
543
+
544
+ You can also show additional individual components via the **--additional**
545
+ flag, like this:
546
+
547
+ envi --additional=php,python,perl
548
+
549
+ This would display the local versions of the installed programs
550
+ **php**, **python** and **perl**. You can add any additional
551
+ program as you see fit there, separated via ',' character -
552
+ this will, however had, only work if that program has been
553
+ registered in the <b>environment_information</b> gem.
554
+
555
+ Note that since as of **September 2019** you can also add the name
556
+ of the component directly. For example, to show the version of
557
+ bash, you can invoke envi like this:
558
+
559
+ envi --bash
560
+
561
+ To also show php and python, you can do this:
562
+
563
+ envi --bash --php --python
564
+
565
+ Use whichever variant you prefer - the choices are up to the user.
566
+
567
+ ## Ruby-gtk bindings
568
+
569
+ A small **gtk-widget** exists, which can be started via either of:
570
+
571
+ envi --gui
572
+ envi --gtk
573
+
574
+ Note that this requires the **ruby-gtk package**, in particular
575
+ **gtk2**, and possibly also the gem called **gtk_paradise**.
576
+
577
+ Installing these could be done through the following commandline
578
+ invocations:
579
+
580
+ gem install gtk2
581
+ gem install gtk3
582
+ gem install gtk_paradise
583
+
584
+ You may need the "devel" packages (.h files) for this to work.
585
+
586
+ The **gtk** widget is really just extremely simple, and thus not too
587
+ terribly useful, since it lacks functionality; I only wanted to be
588
+ able to **embed this information** into other ruby-gtk applications.
589
+ At some point in the future, the functionality may be extended - but
590
+ for the time being, it will remain simple. **Simple is beautiful**,
591
+ too.
592
+
593
+ Presently (September 2019) the gtk-bindings in the
594
+ **environment_information** project only support **ruby-gtk2**,
595
+ but in the future I may switch to **ruby-gtk3** - or at the
596
+ least offer means for the user to decide which variant is
597
+ to be used.
598
+
599
+ ## No changelog entries any longer
600
+
601
+ In the past, changes to this project were listed specifically, together
602
+ with the date - a short changelog.
603
+
604
+ However had, most users are probably more interested in the options
605
+ and features that are supported as-is; the features that are available
606
+ right **now**. Seeing every unimportant change made in the long
607
+ forgotten past, is not that useful for most users. Additionally, for
608
+ **small projects**, a changelog is not really that worthwhile to be
609
+ had to begin with.
610
+
611
+ So, I have abandoned the concept of a changelog for this project. Do
612
+ note that if there is something noteworthy that has been changed, it
613
+ will be mentioned and documented here in this file (**README.md**)
614
+ anyway.
615
+
616
+ ## How to add new components/entries to this project
617
+
618
+ The file <b>environment_information/constants/array_tracked_components.rb</b>
619
+ keeps track over all available entries.
620
+
621
+ The method called **return_default_programs_on_a_linux_computer**,
622
+ defined in the file <b>environment_information/base/misc.rb</b>,
623
+ will add all the entries that are, assumingly, useful on a linux
624
+ computer by default.
625
+
626
+ If you want to change the entries, or add new ones, look there first.
627
+ If you wish to register a new program, you have to add it onto the
628
+ main Array (in the constants.rb file) first.
629
+
630
+ You will also have to add a method that does the actual **query**
631
+ part for the program version at hand, within the
632
+ <b>environment_information/individual_components/</b> subdirectory.
633
+
634
+ It may be simplest to just copy one of those .rb files, by giving it
635
+ the same name as the program you wish to see displayed. You will
636
+ then have to **change the content** of that method too, in that
637
+ new file, but this is quite trivial and takes at maximum five
638
+ minutes (for those who have not seen it before; it takes
639
+ significantly less time for those who already know what to change
640
+ there). Entries that come with **pkg-config .pc files** are even
641
+ simpler to add - this is much easier than manually parsing
642
+ **--version** flags.
643
+
644
+ In the future I may switch to a yaml file rather than hardcode
645
+ the entries in .rb directly, but for the time being, I will stick
646
+ to the method described above.
647
+
648
+ ## Short display variant
649
+
650
+ If you only wish to quickly view the most important information
651
+ about the local computer system, then you can use the following
652
+ variant:
653
+
654
+ envi --short
655
+
656
+ ## Caveats
657
+
658
+ Note that the **EnvironmentInformation** project has to sometimes guess
659
+ how to obtain the necessary information, in order to determine which
660
+ program is installed. For example, for programs such as **readline**
661
+ there is no trivial way to determine which version is used, to
662
+ **EnvironmentInformation** will attempt to read the .so files, and
663
+ determine the version from the .so files. This may fail, depending
664
+ on the setup of the host computer.
665
+
666
+ In general, the two best ways to determine the version of programs
667
+ are via a **--version** flag or simply by using **pkg-config** to
668
+ query the .pc file of the package. But this is not available for
669
+ all programs, so ultimately **EnvironmentInformation** may not
670
+ display completely accurate information on all given computer
671
+ systems.
672
+
673
+ ## Clearing the old dataset
674
+
675
+ Via **--clear** on the commandline you can remove all old entries.
676
+ This commandline flag thus resets **class EnvironmentInformation**
677
+ to a totally clean, fresh state. Internally the method .reset() will
678
+ be called on **class EnvironmentInformation**.
679
+
680
+ This allows you to show only one component, or a few components,
681
+ for example. The following example demonstrates this.
682
+
683
+ Say that you wish to show **only** **python** and **php**, thus
684
+ two programs only. Then you can use the following flag to achieve
685
+ this, in this order:
686
+
687
+ envi --clear --python --php
688
+
689
+ The order is important because --clear will clear at the moment
690
+ it occurs in **ARGV**, which holds the commandline-arguments
691
+ issued on the commandline by the user.
692
+
693
+ ## Which packages will be checked by default?
694
+
695
+ The following provides a list of packages that are presently,
696
+ in **October of 2019**, tracked.
697
+
698
+ In the past I did manually copy/paste the following listing, but
699
+ since as of 15th of October 2019, the list is **autogenerated** via
700
+ a macro.
701
+
702
+ This listing can be seen in the **file**:
703
+
704
+ environment_information/constants/array_tracked_components.rb
705
+
706
+ These are the following programs:
707
+
708
+ adwaitaicontheme
709
+ atk
710
+ automake
711
+ babl
712
+ bash
713
+ binutils
714
+ bison
715
+ boost
716
+ bubblewrap
717
+ busybox
718
+ bzip2
719
+ cairo
720
+ cares
721
+ ccache
722
+ check
723
+ clang
724
+ clutter
725
+ cmake
726
+ colord
727
+ coreutils
728
+ curl
729
+ dbus
730
+ dhcpcd
731
+ diffutils
732
+ djvulibre
733
+ doubleconversion
734
+ duktape
735
+ elfutils
736
+ emacs
737
+ enchant
738
+ ethtool
739
+ eudev
740
+ evince
741
+ exempi
742
+ expat
743
+ ffmpeg
744
+ fftw
745
+ file
746
+ findutils
747
+ flac
748
+ flatpak
749
+ flex
750
+ fluidsynth
751
+ fontconfig
752
+ freeipmi
753
+ freetype
754
+ fribidi
755
+ fuse
756
+ gawk
757
+ gc
758
+ gcc
759
+ gcr
760
+ gdb
761
+ gdkpixbuf
762
+ gegl
763
+ geocodeglib
764
+ gettext
765
+ ghostscript
766
+ gimp
767
+ git
768
+ glslang
769
+ gmime
770
+ gjs
771
+ glib
772
+ glibc
773
+ gmp
774
+ gnupg
775
+ gnuplot
776
+ gnutls
777
+ gperf
778
+ graphite2
779
+ graphviz
780
+ grep
781
+ groff
782
+ gsettingsdesktopschemas
783
+ gsl
784
+ gstreamer
785
+ gstpluginsbase
786
+ gtk2
787
+ gtk3
788
+ guile
789
+ gupnp
790
+ gzip
791
+ harfbuzz
792
+ hmmer
793
+ ibus
794
+ icewm
795
+ icu4c
796
+ imagemagick
797
+ intltool
798
+ isl
799
+ jasper
800
+ java
801
+ kde_frameworks
802
+ kmod
803
+ krb5
804
+ krita
805
+ lftp
806
+ libarchive
807
+ libassuan
808
+ libbytesize
809
+ libdazzle
810
+ libdrm
811
+ libepoxy
812
+ libgdata
813
+ libgee
814
+ libgpgerror
815
+ libgsf
816
+ libgtop
817
+ libgusb
818
+ libhandy
819
+ libical
820
+ libidn
821
+ libjpegturbo
822
+ libmbim
823
+ libmicrohttpd
824
+ libpaper
825
+ libpeas
826
+ libpsl
827
+ libqmi
828
+ librsvg
829
+ libsamplerate
830
+ libseccomp
831
+ libsecret
832
+ libsndfile
833
+ libtasn1
834
+ libtool
835
+ libunwind
836
+ libusb
837
+ libuv
838
+ libva
839
+ libvpx
840
+ libwebp
841
+ libwpe
842
+ libzip
843
+ lighttpd
844
+ linux
845
+ llvm
846
+ lynx
847
+ m4
848
+ make
849
+ mc
850
+ mlt
851
+ mozjs
852
+ mpc
853
+ mpfr
854
+ mtools
855
+ mutter
856
+ nasm
857
+ ncurses
858
+ neon
859
+ nettle
860
+ nghttp2
861
+ nginx
862
+ ninja
863
+ node
864
+ nspr
865
+ nss
866
+ openmpi
867
+ openssl
868
+ opusfile
869
+ pango
870
+ parted
871
+ patch
872
+ patchelf
873
+ pbbam
874
+ pcre
875
+ pcre2
876
+ perl
877
+ php
878
+ pipewire
879
+ pkgconfig
880
+ plzip
881
+ poppler
882
+ popt
883
+ postgresql
884
+ python
885
+ qpdf
886
+ qt
887
+ r
888
+ readline
889
+ re2c
890
+ relion
891
+ rsync
892
+ ruby
893
+ rubygems
894
+ samtools
895
+ sed
896
+ screen
897
+ sharutils
898
+ simple-scan
899
+ strace
900
+ swig
901
+ sysstat
902
+ taglib
903
+ tar
904
+ tesseract
905
+ texinfo
906
+ tiff
907
+ tmux
908
+ unbound
909
+ v4lutils
910
+ valgrind
911
+ viennarna
912
+ vim
913
+ vte
914
+ wavpack
915
+ webkit2gtk
916
+ weston
917
+ wget
918
+ wireshark
919
+ xfsprogs
920
+ xinput
921
+ xterm
922
+ xvid
923
+ xz
924
+ zlib
925
+
926
+
927
+ You can also display these programs dynamically, such as through the
928
+ following **API**:
929
+
930
+ require 'environment_information'
931
+
932
+ pp EnvironmentInformation.tracked_programs?
933
+
934
+ Note that since as of **March 2019**, environment_information will also attempt
935
+ to find out the installed version for **gmp**, **mpfr** and **mpc**. This
936
+ may fail, though, and will be silently ignored in these cases (at least
937
+ for the time being).
938
+
939
+ You can use the following method to display a list of all programs
940
+ that are registered, from the commandline:
941
+
942
+ envi --registered-components?
943
+
944
+ This will show every registered (and thus, available) component of this
945
+ project.
946
+
947
+ As of **February 2020**, this project tracks at the least 105 different
948
+ programs. More entries will be added in the future, but the primary
949
+ focus will be on a **Linux from Scratch** / **Beyond Linux from Scratch**
950
+ setup, so expect those programs that are installed first, to be added
951
+ next, too.
952
+
953
+ ## Querying the components that will be shown
954
+
955
+ You can query the components that will be shown, by issuing one of
956
+ the following commands:
957
+
958
+ envi --show-components?
959
+ envi --show-components
960
+
961
+ Note that this works exclusively, meaning that if you use this
962
+ commandline switch, then you will ONLY get a query of the
963
+ components that are available.
964
+
965
+ ## Replaying the information
966
+
967
+ Normally showing all information when issuing **envi --RALL** can take
968
+ quite some time; on my computer system 18 seconds, before the rewrite
969
+ in February 2020.
970
+
971
+ The reason as to why it takes that long is mostly because many different
972
+ files have to be queried; their --version flag has to be called or
973
+ their .pc file has to be checked, but most importantly querying data
974
+ from the **RBT project** currently takes way too long. This is not an
975
+ ideal situation, as nobody wants to wait.
976
+
977
+ Waiting 18 seconds is simply too long, though, but until that part in
978
+ RBT is improved, I have added a **--replay** functionality for **class
979
+ EnvironmentInformation** (via the commandline).
980
+
981
+ What this functionality does is to take an available (existing) .yml
982
+ file that holds the information from the last invocation run, and then
983
+ proceeds to display this information on the commandline to the user.
984
+ This will evidently be much faster, since the information has already
985
+ been stored before in a prior run.
986
+
987
+ This change required that the environment information project will
988
+ also generate a **.yml file** by default.
989
+
990
+ Note that this functionality is not yet complete; I will extend this
991
+ at a later time (written this part here as of **December 2019**).
992
+
993
+ You can disable saving into this .yml file via:
994
+
995
+ envi --no-yaml-file
996
+
997
+ To invoke the replay functionality, do:
998
+
999
+ envi --replay
1000
+
1001
+ ## Avoid the creation of local files
1002
+
1003
+ By default, the main class in this project may generate a few local
1004
+ files. This may not always be wanted, or possible (e. g. in a
1005
+ read-only filesystem), so an option has to exist that disables
1006
+ this functionality.
1007
+
1008
+ That option is called **--no-save** and can be used like this:
1009
+
1010
+ envi --lfs --no-save
1011
+
1012
+ ## Using another prefix
1013
+
1014
+ By default, the environment_information project will assume that
1015
+ the main prefix is / or /usr, respectively. In other words, it
1016
+ will assume that, for example, the binary called "bison" will
1017
+ reside at /usr/bin/bison. To be more correct, it will make use
1018
+ of the PATH environment variable, but for most users this will
1019
+ list /usr/bin/ first.
1020
+
1021
+ That way "bison --version" should work and be the same as
1022
+ "/usr/bin/bison --version".
1023
+
1024
+ For pkg-config .pc files, the main target will usually then
1025
+ be at /usr/lib/pkgconfig/.
1026
+
1027
+ Note that the above is not always a correct assumption. For
1028
+ example, the **GoboLinux approach** uses the **/Programs/**
1029
+ hierarchy instead (but it also keeps legacy symlinks, so in
1030
+ fact GoboLinux works just like any other linux distribution too).
1031
+
1032
+ On my home setup, I tend to use /home/Programs/ since some
1033
+ time - mostly because I tend to relocate /home/ in general
1034
+ or may keep it on a separate partition.
1035
+
1036
+ For these latter use cases we require another way to quickly
1037
+ list all versions of different programs. On 14.01.2020
1038
+ support for this has been (partially) added.
1039
+
1040
+ Invoke this like so:
1041
+
1042
+ envi --work-on-programs-directory-only
1043
+
1044
+ Note that this would use /home/Programs/ right now, which
1045
+ is hardcoded - and thus not flexible.
1046
+
1047
+ I am aware of this limitation, so expect more code changes
1048
+ in the future to extend this functionality.
1049
+
1050
+ One key idea for this is to set up /home/Programs/Toolchain/
1051
+ and have that one work reliably to cross-compile different
1052
+ architectures, libc libraries and so forth. But for now,
1053
+ this subsection is a stub.
1054
+
1055
+ ## Rationale as to why some programs may work and some may not
1056
+
1057
+ Querying the specific version installed on a given computer
1058
+ system can be tricky. If a **.pc file** is available (**pkg-config**)
1059
+ then querying the version is quite trivial. If a **binary** is
1060
+ available then often **--version** or **-V** will work. But
1061
+ sometimes there is no binary, and no .pc file either. So what
1062
+ to do in such a case?
1063
+
1064
+ This is not simple to answer, since it may depend on the
1065
+ program at hand.
1066
+
1067
+ It may be possible to infer the proper version from the
1068
+ library at hand e. g. **/usr/lib/foobar.so.4.8.2**. Here
1069
+ we could assume that the version will be 4.8.2, but this
1070
+ is not necessarily guaranteed to work, either.
1071
+
1072
+ In the past, before the rewrite of this project in **February 2020**,
1073
+ the environment_information project had used code that would
1074
+ check for such conditions - for example, for **readline**,
1075
+ and look for specific .so files under **/usr/lib/** or
1076
+ elsewhere.
1077
+
1078
+ But the resulting code that had to be written for this, was not
1079
+ very elegant, and takes about 10-20 lines of code for checking
1080
+ this, including fall-backs, for each program that does not
1081
+ conform to --version or a .pc file. I am no longer sure whether
1082
+ it is worth to add that code, since it also may have to be
1083
+ maintained, and is not always perfect nor does it always work,
1084
+ depending on the computer system at hand. So, past this point,
1085
+ **environment_information** is not doing its best to query the
1086
+ version for all programs - it will try pkg-config and
1087
+ --version or -V in most cases, and if that fails then
1088
+ the environment_information project will assume that the
1089
+ program at hand is not installed.
1090
+
1091
+ This may be a **false negative**, but to me it appears
1092
+ to be better in the long run, in regards to maintainability
1093
+ of the whole project. After all one reason for the rewrite
1094
+ in 2020 was to simplify the whole project, and this objective
1095
+ has been achieved - all the commands are now stored in yaml
1096
+ files, and that is so much simpler to handle than the
1097
+ corresponding ruby methods that were used before that.
1098
+
1099
+ ## Adding new entries to EnvironmentInformation
1100
+
1101
+ New entries can be added into the following yaml file:
1102
+
1103
+ **query_to_use_for_the_individual_components.yml**
1104
+
1105
+ The two most commonly used variants there are version,
1106
+ for **bin/foo --version* invocations, and pkgconfig,
1107
+ for querying pkg-config .pc files. However had, many
1108
+ programs make use of different invocation variants,
1109
+ don't come with a .pc file, and have no binaries.
1110
+ Querying the correct version of such files is difficult
1111
+ since there is no standard. This is a reason why the
1112
+ code has to handle these cases.
1113
+
1114
+ But in principle, adding a new entry is as simple as
1115
+ adding a new line into that .yml file (and registering
1116
+ that component in a second .yml file).
1117
+
1118
+ ## The toplevel main hash
1119
+
1120
+ EnvironmentInformation tries to store the information that
1121
+ it has collected into a **hash**, which can be accessed like
1122
+ this quickly:
1123
+
1124
+ EnvironmentInformation.hash?
1125
+
1126
+ By default this hash is empty, so you have to fill it up
1127
+ first, if you want to do so, via the following method:
1128
+
1129
+ EnvironmentInformation.initialize
1130
+
1131
+ hash = EnvironmentInformation.hash? # ← and here you can query it
1132
+
1133
+ The hash can then be used as basis for reporting at a later time,
1134
+ or replaying that information via the **--replay** commandline
1135
+ switch to the executable.
1136
+
1137
+ ## Dependencies of the EnvironmentInformation project
1138
+
1139
+ The sole dependency for the **environment_information gem**
1140
+ is on the **colours** gem.
1141
+
1142
+ Up until the beginning of March 2020, the EnvironmentInformation
1143
+ project also depended on the **opn gem**. However had, I
1144
+ noticed that in a restricted environment installation of
1145
+ gems can be difficult, so I made opn **optional**. If you have
1146
+ it installed then EnvironmentInformation will still try to
1147
+ make use of the **Opn namespace**; and if it is not installed
1148
+ then EnvironmentInformation will simply **skip** Opn completely.
1149
+
1150
+ ## Rationale behind the different queries
1151
+
1152
+ As was already explained, different programs require different
1153
+ ways to determine which version is installed. Some projects
1154
+ would allow more than one way, such as the --version flag,
1155
+ but also querying .pc files. Ruby, for example, supports both
1156
+ --version, and comes with a .pc file (if you compiled it from
1157
+ source, at the least).
1158
+
1159
+ So, which way to choose?
1160
+
1161
+ In my opinion, .pc files are better than --version, for
1162
+ at the least two reasons:
1163
+
1164
+ - The resulting code to handle this is much simpler. .pc
1165
+ files are quite uniform, whereas the output of --version
1166
+ is very dissimilar between different programs.
1167
+
1168
+ - Another reason is that invoking the binary, just to
1169
+ do a --version, is actually more expensive (CPU-wise)
1170
+ than it is to query a simple text file, which is
1171
+ essentially what .pc files are. So this is another reason
1172
+ in favour of .pc files.
1173
+
1174
+ For these reasons, and a few smaller ones, the EnvironmentInformation
1175
+ project will try to prefer .pc files whenever that is possible.
1176
+ We may retain code that can handle --version calls, though,
1177
+ if they need a special way to query.
1178
+
1179
+ ## Querying all registered pkg-config entries
1180
+
1181
+ To show all registered pkg-config entries (with .pc files)
1182
+ do this:
1183
+
1184
+ envi --pkgconfig
1185
+
1186
+ If you want to obtain an Array of all outdated programs
1187
+ on the target computer system, try this method:
1188
+
1189
+ EnvironmentInformation.return_array_of_outdated_programs
1190
+
1191
+ You need to have initialized the main hash once, before
1192
+ being able to make use of that method.
1193
+
1194
+ ## Quickly showing the version of individual programs
1195
+
1196
+ You can show the version of individual programs
1197
+ like this:
1198
+
1199
+ envi --bash
1200
+ envi --brotli
1201
+
1202
+ This will only work if the program has been registered,
1203
+ though - so the second variant will not work.
1204
+
1205
+ Also take note that this will be ultra-short output,
1206
+ so nothing will be saved into a local file. The idea
1207
+ here is that the user only wants to see the version
1208
+ of the program at hand, such as the <b>bash shell</b>.
1209
+
1210
+ ## Aliases to program names
1211
+
1212
+ For several reasons it may be useful to define some aliases
1213
+ or shortcuts to registered names. For example, the input
1214
+ name **yacc** should point to the program called **bison**,
1215
+ and the input name **diff** should really be an abbreviation
1216
+ for **diffutils**. This allows the user to use the
1217
+ environment_information project in a more convenient manner.
1218
+
1219
+ Currently these aliases are hardcoded, defined in the
1220
+ method called **EnvironmentInformation.return_alias_to()**.
1221
+
1222
+ If no alias is found then the method will simply return
1223
+ the original input argument. This allows us to use this
1224
+ method as a 'sanitizer' or filter.
1225
+
1226
+ ## Support for KDE
1227
+
1228
+ If you have the RBT gem installed (gem install rbt) then you
1229
+ can invoke envi via:
1230
+
1231
+ envi --kde?
1232
+
1233
+ Since as of August 2022 this will try to show the versions
1234
+ of installed KDE applications.
1235
+
1236
+ This currently does not work very well; at a later point
1237
+ this will be polished and improved.
1238
+
1239
+ ## Bugs and other misbehaviours
1240
+
1241
+ I noticed a few bugs here and there over the years. For instance,
1242
+ sometimes there may not be any output and the program stops
1243
+ working suddenly. This sometimes happens because there is some
1244
+ error in the underlying way how EnvironmentInformation obtains
1245
+ the version-information. In the long run I intend to improve
1246
+ the situation, by no longer falling into such issues - but
1247
+ they are not easily reproducible on my system. Either way I
1248
+ added this subsection in November 2021, to lessen the confusion
1249
+ for users at the least a little bit. And, again, as said, in
1250
+ the long run the code will change so as to not run into such
1251
+ situations anymore.
1252
+
1253
+ To provide a specific example: there may be instances of
1254
+ emacs about, such as on antiX, which simply did not
1255
+ provide any output. When I compiled emacs from source, it
1256
+ worked fine - so always check that the program works as
1257
+ assumed it **should** work.
1258
+
1259
+ ## GUIs - Graphical User Interfaces
1260
+
1261
+ A few bindings to graphical user interfaces exist, to ruby-gtk3 and
1262
+ ruby-libui. These are mostly just demos, proof-of-concept. They are
1263
+ not really very elegant or sophisticated - I really only wanted to
1264
+ show how to embed the information gained from the commandline via
1265
+ a GUI as well.
1266
+
1267
+ Since as of 2024, a GUI via jruby-Swing is now part of this
1268
+ gem. The current GUI is very minimalistic:
1269
+
1270
+ <img src="https://i.imgur.com/kGHXiCd.png" style="margin: 1em">
1271
+
1272
+ Still not very elegant. But the advantage here is that this
1273
+ also works on windows, and I may add more code over time to
1274
+ make this more useful on windows as well. One day I would like
1275
+ to have a collection of different widget sets that all work
1276
+ on as many different operating systems as possible. Stay
1277
+ tuned for more updates in this regard in the future.
1278
+
1279
+
1280
+ ## Contact information and mandatory 2FA (no longer) coming up in 2022 / 2023
1281
+
1282
+ If your creative mind has ideas and specific suggestions to make this gem
1283
+ more useful in general, feel free to drop me an email at any time, via:
1284
+
1285
+ shevy@inbox.lt
1286
+
1287
+ Before that email I used an email account at Google gmail, but in **2021** I
1288
+ decided to slowly abandon gmail, for various reasons. In order to limit the
1289
+ explanation here, allow me to just briefly state that I do not feel as if I
1290
+ want to promote any Google service anymore when the user becomes the end
1291
+ product (such as via data collection by upstream services, including other
1292
+ proxy-services). My feeling is that this is a hugely flawed business model
1293
+ to begin with, and I no longer wish to support this in any way, even if
1294
+ only indirectly so, such as by using services of companies that try to
1295
+ promote this flawed model.
1296
+
1297
+ In regards to responding to emails: please keep in mind that responding
1298
+ may take some time, depending on the amount of work I may have at that
1299
+ moment. So it is not that emails are ignored; it is more that I have not
1300
+ (yet) found the time to read and reply. This means there may be a delay
1301
+ of days, weeks and in some instances also months. There is, unfortunately,
1302
+ not much I can do when I need to prioritise my time investment, but I try
1303
+ to consider <b>all</b> feedback as an opportunity to improve my projects
1304
+ nonetheless.
1305
+
1306
+ In <b>2022</b> rubygems.org decided to make 2FA mandatory for every
1307
+ gem owner eventually:
1308
+
1309
+ see
1310
+ https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
1311
+
1312
+ However had, that has been reverted again, so I decided to shorten
1313
+ this paragraph. Mandatory 2FA may exclude users who do not have a
1314
+ smartphone device or other means to 'identify'. I do not feel it is
1315
+ a fair assumption by others to be made that non-identified people may
1316
+ not contribute code, which is why I reject it. Mandatory 2FA would mean
1317
+ an end to all my projects on rubygems.org, so let's hope it will never
1318
+ happen. (Keep in mind that I refer to mandatory 2FA; I have no qualms
1319
+ for people who use 2FA on their own, but this carrot-and-stick strategy
1320
+ by those who control the rubygems infrastructure is a very bad one to
1321
+ pursue.
1322
+