environment_information 1.4.29

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.

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,33 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/opn.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/class/colours.rb'
14
+ require 'environment_information/constants/namespace.rb'
15
+
16
+ begin
17
+ require 'opn'
18
+ rescue LoadError; end
19
+
20
+ # ========================================================================= #
21
+ # === opnn
22
+ # ========================================================================= #
23
+ def opnn
24
+ if TRY_TO_MAKE_USE_OF_THE_OPN_GEM_IF_IT_IS_AVAILABLE and
25
+ Object.const_defined?(:Opn)
26
+ Opn.opn({
27
+ namespace: NAMESPACE,
28
+ use_colours: use_colours?
29
+ })
30
+ end
31
+ end; alias opn opnn # === opn
32
+
33
+ end; end
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/register_sigint.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ # ========================================================================= #
14
+ # === register_sigint
15
+ # ========================================================================= #
16
+ def register_sigint
17
+ Signal.trap('SIGINT') { e; exit }
18
+ end
19
+
20
+ end; end
@@ -0,0 +1,213 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/reset.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ # ========================================================================= #
14
+ # === reset (reset tag)
15
+ # ========================================================================= #
16
+ def reset
17
+ # ======================================================================= #
18
+ # === @pkg_config_query
19
+ # ======================================================================= #
20
+ @pkg_config_query = ::EnvironmentInformation::Queries::PkgConfig.new
21
+ # ======================================================================= #
22
+ # === @simple_version_query
23
+ # ======================================================================= #
24
+ @simple_version_query = ::EnvironmentInformation::Queries::SimpleVersion.new
25
+ # ======================================================================= #
26
+ # === @complex_version_query
27
+ # ======================================================================= #
28
+ @complex_version_query = ::EnvironmentInformation::Queries::ComplexVersion.new
29
+ # ======================================================================= #
30
+ # === @array_report_these_programs
31
+ #
32
+ # This Array denotes which programs are to be reported.
33
+ #
34
+ # By default it is empty.
35
+ # ======================================================================= #
36
+ @array_report_these_programs = []
37
+ # ======================================================================= #
38
+ # === @array_unavailable_programs
39
+ #
40
+ # Programs which could not be found can be registered into the following
41
+ # Array.
42
+ # ======================================================================= #
43
+ @array_unavailable_programs = []
44
+ # ======================================================================= #
45
+ # === @runmode
46
+ #
47
+ # The @runmode variable can be :commandline or :gui or :www.
48
+ # ======================================================================= #
49
+ @runmode = :commandline
50
+ # ======================================================================= #
51
+ # === @show_everything
52
+ #
53
+ # If the following instance variable is set to true then this class
54
+ # will try to show every registered (and thus, available) component.
55
+ #
56
+ # By default this is not wanted, so it is disabled. The user has to
57
+ # specifically enable this option via the commandline, if so
58
+ # desired, and thus overrule this default value.
59
+ # ======================================================================= #
60
+ @show_everything = false
61
+ # ======================================================================= #
62
+ # === @display_result
63
+ #
64
+ # If the following instance variable is true, which is the case by
65
+ # default, then this class will report to the user on the commandline.
66
+ #
67
+ # If it is set to false then nothing will be displayed; this is
68
+ # useful when you only want to obtain the dataset, without
69
+ # showing anything to the user.
70
+ # ======================================================================= #
71
+ @display_result = true
72
+ # ======================================================================= #
73
+ # === @be_silent
74
+ #
75
+ # By default, this class is not silent, meaning that it will display
76
+ # information to the user.
77
+ # ======================================================================= #
78
+ @be_silent = false
79
+ # ======================================================================= #
80
+ # === @may_we_try_to_use_rbt
81
+ #
82
+ # Whether we may query RBT for additional help or not. By default
83
+ # we will try to make use of RBT.
84
+ # ======================================================================= #
85
+ @may_we_try_to_use_rbt = true
86
+ # ======================================================================= #
87
+ # === @array_show_this_to_the_user
88
+ #
89
+ # The following Array can be used to show messages to the user.
90
+ # ======================================================================= #
91
+ @array_show_this_to_the_user = []
92
+ # ======================================================================= #
93
+ # === @array_display_these_components
94
+ #
95
+ # This Array will display the components on the commandline.
96
+ #
97
+ # Take note that the order is important: the entries that appear first
98
+ # will be displayed earlier. In other words: first entries will be
99
+ # shown first as well.
100
+ # ======================================================================= #
101
+ @array_display_these_components = []
102
+ # ======================================================================= #
103
+ # === @sort_alphabetically
104
+ #
105
+ # Whether to sort the main Hash alphabetically or not.
106
+ # ======================================================================= #
107
+ @sort_alphabetically = false
108
+ # ======================================================================= #
109
+ # === @show_ruby_version_and_gem_version
110
+ #
111
+ # This instance variable determines whether class EnvironmentInformation
112
+ # will display the ruby version and the gem version.
113
+ #
114
+ # By default we will do so, but there may be situations where this
115
+ # may be unwanted, or not a good idea, such as in a minimal system
116
+ # where no ruby is running, or if the user only wants to display
117
+ # very little information.
118
+ # ======================================================================= #
119
+ @show_ruby_version_and_gem_version = true
120
+ # ======================================================================= #
121
+ # === @display_everything_in_short_format
122
+ #
123
+ # This variable determines whether we will use a compact-display or
124
+ # whether there will be one-entry-per-program instead.
125
+ # ======================================================================= #
126
+ @display_everything_in_short_format = false
127
+ # ======================================================================= #
128
+ # === @run_already
129
+ #
130
+ # This variable will be true by default.
131
+ # ======================================================================= #
132
+ @run_already = true
133
+ # ======================================================================= #
134
+ # === @show_help
135
+ #
136
+ # If this variable is set to true, then we will only show help, then
137
+ # exit the program.
138
+ # ======================================================================= #
139
+ @show_help = false
140
+ # ======================================================================= #
141
+ # === @do_exit_the_program
142
+ #
143
+ # The following variable can determine when we exit from this class.
144
+ # By default we will not exist early.
145
+ # ======================================================================= #
146
+ @do_exit_the_program = false
147
+ # ======================================================================= #
148
+ # === @array_these_programs_not_up_to_date
149
+ #
150
+ # This Array can be used to save into a local file which programs
151
+ # are not up to date.
152
+ # ======================================================================= #
153
+ if is_on_roebe?
154
+ @array_these_programs_not_up_to_date = []
155
+ end
156
+ # ======================================================================= #
157
+ # === @internal_hash
158
+ # ======================================================================= #
159
+ @internal_hash = {}
160
+ # ======================================================================= #
161
+ # === :report_the_remote_urls
162
+ #
163
+ # If this instance variable is set to true then the remote URLs will
164
+ # be shown as well, on the commandline.
165
+ # ======================================================================= #
166
+ @internal_hash[:report_the_remote_urls] = false
167
+ # ======================================================================= #
168
+ # === @internal_hash[:try_to_rename_the_kde_konsole_tab]
169
+ #
170
+ # The following instance variable will determine as to whether we will
171
+ # try to make use of the KDE Konsole and rename the tab of the konsole
172
+ # there.
173
+ #
174
+ # Since as of October 2018 we will not use the KDE konsole by default
175
+ # anymore. This may change at a later moment in time, though.
176
+ # ======================================================================= #
177
+ @internal_hash[:try_to_rename_the_kde_konsole_tab] = false
178
+ # ======================================================================= #
179
+ # === @internal_hash[:generate_a_html_file]
180
+ #
181
+ # If the next instance variable is set to true then a html file will
182
+ # be generated. By default this will not happen, though.
183
+ # ======================================================================= #
184
+ @internal_hash[:generate_a_html_file] = false
185
+ # ======================================================================= #
186
+ # === @internal_hash[:store_the_results_into_local_files]
187
+ #
188
+ # If the following variable is set to true then the project will
189
+ # generate local files too, e. g. yaml files and what not.
190
+ # ======================================================================= #
191
+ @internal_hash[:store_the_results_into_local_files] = true
192
+ # ======================================================================= #
193
+ # === @internal_hash[:use_ascii_table]
194
+ #
195
+ # Whether to use an ASCII table or whether we will not:
196
+ # ======================================================================= #
197
+ @internal_hash[:use_ascii_table] = false
198
+ # ======================================================================= #
199
+ # === @internal_hash[:table]
200
+ # ======================================================================= #
201
+ @internal_hash[:table] = nil # The ascii table.
202
+ # ======================================================================= #
203
+ # === @internal_hash[:compare_program_versions]
204
+ #
205
+ # This instance variable can be used to also compare the program
206
+ # versions, if the RBT project is available.
207
+ #
208
+ # By default this will not be done, though.
209
+ # ======================================================================= #
210
+ @internal_hash[:compare_program_versions] = false
211
+ end
212
+
213
+ end; end
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/ruby.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ # ========================================================================= #
14
+ # === dont_show_ruby_stuff
15
+ #
16
+ # Disable showing ruby + gem information.
17
+ # ========================================================================= #
18
+ def dont_show_ruby_stuff # Dont show ruby stuff.
19
+ @show_ruby_version_and_gem_version = false
20
+ end; alias show_no_ruby dont_show_ruby_stuff # === show_no_ruby
21
+
22
+ # ========================================================================= #
23
+ # === return_all_ruby_components
24
+ #
25
+ # Combine three calls into one here - all related to ruby.
26
+ # ========================================================================= #
27
+ def return_all_ruby_components
28
+ %i(
29
+ ruby
30
+ rubygems
31
+ rubygems_installation_directory
32
+ )
33
+ end
34
+
35
+ # ========================================================================= #
36
+ # === consider_adding_the_ruby_components
37
+ #
38
+ # This method can be used to consider adding the ruby-components,
39
+ # which means "ruby" itself, rubygems "gem", and the rubygems
40
+ # installation directory.
41
+ # ========================================================================= #
42
+ def consider_adding_the_ruby_components
43
+ if @show_ruby_version_and_gem_version
44
+ add(
45
+ return_all_ruby_components # Combine three calls into one here - all related to ruby.
46
+ )
47
+ end
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === do_not_show_the_ruby_components
52
+ # ========================================================================= #
53
+ def do_not_show_the_ruby_components
54
+ @show_ruby_version_and_gem_version = false
55
+ end; alias do_not_display_the_ruby_components do_not_show_the_ruby_components # === do_not_display_the_ruby_components
56
+
57
+ # ========================================================================= #
58
+ # === return_version_of_rubygems?
59
+ # ========================================================================= #
60
+ def return_version_of_rubygems?
61
+ ::EnvironmentInformation.send(__method__)
62
+ end; alias return_version_of_rubygems return_version_of_rubygems? # == return_version_of_rubygems
63
+
64
+ # ========================================================================= #
65
+ # === return_version_of_ruby?
66
+ # ========================================================================= #
67
+ def return_version_of_ruby?
68
+ ::EnvironmentInformation.send(__method__)
69
+ end; alias return_version_of_ruby return_version_of_ruby? # == return_version_of_ruby
70
+
71
+ require 'environment_information/misc_components/rubygems_installation_directory.rb'
72
+ # ========================================================================= #
73
+ # === rubygems_installation_directory?
74
+ # ========================================================================= #
75
+ def rubygems_installation_directory?
76
+ ::EnvironmentInformation.rubygems_installation_directory?
77
+ end
78
+
79
+ end; end
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/run.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ # ========================================================================= #
14
+ # === run (run tag)
15
+ # ========================================================================= #
16
+ def run
17
+ # ======================================================================= #
18
+ # Try to rename the KDE konsole first. This will happen on
19
+ # roebe-systems only.
20
+ # ======================================================================= #
21
+ do_rename_kde_konsole
22
+ # ======================================================================= #
23
+ # ^^^ This check happens here again because menu() is allowed to
24
+ # toggle this variable.
25
+ # ======================================================================= #
26
+ if @display_everything_in_short_format
27
+ assign_components_for_the_short_format # Handle the short format here.
28
+ end
29
+ do_sort_alphabetically if @sort_alphabetically # ← Must come before the report-step.
30
+ unless @do_exit_the_program
31
+ # ===================================================================== #
32
+ # === Report step
33
+ #
34
+ # We may only display the components if @display_result is true.
35
+ # ===================================================================== #
36
+ if @display_result
37
+ register_the_available_components_and_show_them_at_once
38
+ end
39
+ end
40
+ # ======================================================================= #
41
+ # === Consider generating a .html file
42
+ #
43
+ # The user may want to generate a .html file, so the following
44
+ # functionality allows the user to do so. This check should
45
+ # ideally come before other local files are generated.
46
+ # ======================================================================= #
47
+ do_generate_a_html_file if @internal_hash[:generate_a_html_file]
48
+ if commandline? and store_the_results_into_local_files?
49
+ # ===================================================================== #
50
+ # Only store local files if the variable
51
+ # @store_the_results_into_local_files is true.
52
+ # ===================================================================== #
53
+ consider_storing_the_components_that_were_displayed
54
+ consider_storing_which_programs_are_not_up_to_date
55
+ end
56
+ end; alias feedback_everything run # === feedback_everything
57
+ alias do_feedback_everything run # === do_feedback_everything
58
+ alias output run # === output
59
+ alias feedback run # === feedback
60
+
61
+ end; end