environment_information 1.4.89

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 (94) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1276 -0
  3. data/bin/envi +7 -0
  4. data/bin/fast_envi +7 -0
  5. data/doc/README.gen +1044 -0
  6. data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +48 -0
  7. data/environment_information.gemspec +135 -0
  8. data/lib/environment_information/base/base.rb +159 -0
  9. data/lib/environment_information/class/add.rb +187 -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 +90 -0
  14. data/lib/environment_information/class/html.rb +78 -0
  15. data/lib/environment_information/class/initialize.rb +177 -0
  16. data/lib/environment_information/class/menu.rb +465 -0
  17. data/lib/environment_information/class/misc.rb +897 -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 +217 -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 +355 -0
  24. data/lib/environment_information/colours/colours.rb +211 -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 +210 -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/gtk2/environment_information.rb +35 -0
  38. data/lib/environment_information/gui/gtk3/environment_information.rb +34 -0
  39. data/lib/environment_information/gui/libui/environment_information.rb +74 -0
  40. data/lib/environment_information/gui/shared_code/environment_information_module.rb +409 -0
  41. data/lib/environment_information/misc_components/README.md +3 -0
  42. data/lib/environment_information/misc_components/cflags.rb +36 -0
  43. data/lib/environment_information/misc_components/cpuinfo.rb +64 -0
  44. data/lib/environment_information/misc_components/operating_system.rb +54 -0
  45. data/lib/environment_information/misc_components/operating_system_bit_type.rb +42 -0
  46. data/lib/environment_information/misc_components/ram.rb +30 -0
  47. data/lib/environment_information/misc_components/rubygems_installation_directory.rb +54 -0
  48. data/lib/environment_information/misc_components/screen_resolution.rb +50 -0
  49. data/lib/environment_information/project/project.rb +27 -0
  50. data/lib/environment_information/queries/README.md +2 -0
  51. data/lib/environment_information/queries/complex_version.rb +272 -0
  52. data/lib/environment_information/queries/pkg_config.rb +125 -0
  53. data/lib/environment_information/queries/simple_version.rb +217 -0
  54. data/lib/environment_information/requires/require_asciitable.rb +15 -0
  55. data/lib/environment_information/requires/require_the_constants.rb +7 -0
  56. data/lib/environment_information/requires/require_the_environment_information_project.rb +23 -0
  57. data/lib/environment_information/requires/require_the_individual_misc_components.rb +30 -0
  58. data/lib/environment_information/requires/require_the_toplevel_methods.rb +22 -0
  59. data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +152 -0
  60. data/lib/environment_information/toplevel_methods/cd.rb +16 -0
  61. data/lib/environment_information/toplevel_methods/e.rb +43 -0
  62. data/lib/environment_information/toplevel_methods/hash.rb +60 -0
  63. data/lib/environment_information/toplevel_methods/internet_is_available.rb +30 -0
  64. data/lib/environment_information/toplevel_methods/is_on_roebe.rb +16 -0
  65. data/lib/environment_information/toplevel_methods/menu.rb +90 -0
  66. data/lib/environment_information/toplevel_methods/misc.rb +309 -0
  67. data/lib/environment_information/toplevel_methods/n_subcommands.rb +31 -0
  68. data/lib/environment_information/toplevel_methods/prefix_to_use.rb +39 -0
  69. data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +61 -0
  70. data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +45 -0
  71. data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +84 -0
  72. data/lib/environment_information/toplevel_methods/return_alias_to.rb +30 -0
  73. data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +28 -0
  74. data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +54 -0
  75. data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +28 -0
  76. data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +182 -0
  77. data/lib/environment_information/toplevel_methods/show_all_available_components.rb +192 -0
  78. data/lib/environment_information/toplevel_methods/write_what_into.rb +24 -0
  79. data/lib/environment_information/version/version.rb +25 -0
  80. data/lib/environment_information/www/sinatra_interface.rb +213 -0
  81. data/lib/environment_information/www/webobject_interface.cgi +29 -0
  82. data/lib/environment_information/yaml/array_default_programs_on_linux.yml +15 -0
  83. data/lib/environment_information/yaml/array_lfs_core_programs.yml +37 -0
  84. data/lib/environment_information/yaml/array_science_cluster.yml +12 -0
  85. data/lib/environment_information/yaml/array_tracked_non_programs.yml +13 -0
  86. data/lib/environment_information/yaml/array_tracked_programs.yml +207 -0
  87. data/lib/environment_information/yaml/array_tracked_xorg_components.yml +37 -0
  88. data/lib/environment_information/yaml/colours.yml +3 -0
  89. data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +256 -0
  90. data/lib/environment_information.rb +5 -0
  91. data/test/testing_environment_information.rb +26 -0
  92. data/test/testing_missing_components.rb +9 -0
  93. data/test/testing_prefix_for_the_environment_information_project.rb +20 -0
  94. metadata +191 -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,217 @@
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
+ # === @show_ruby_version_and_gem_version
104
+ #
105
+ # This instance variable determines whether class EnvironmentInformation
106
+ # will display the ruby version and the gem version.
107
+ #
108
+ # By default we will do so, but there may be situations where this
109
+ # may be unwanted, or not a good idea, such as in a minimal system
110
+ # where no ruby is running, or if the user only wants to display
111
+ # very little information.
112
+ # ======================================================================= #
113
+ @show_ruby_version_and_gem_version = true
114
+ # ======================================================================= #
115
+ # === @display_everything_in_short_format
116
+ #
117
+ # This variable determines whether we will use a compact-display or
118
+ # whether there will be one-entry-per-program instead.
119
+ # ======================================================================= #
120
+ @display_everything_in_short_format = false
121
+ # ======================================================================= #
122
+ # === @run_already
123
+ #
124
+ # This variable will be true by default.
125
+ # ======================================================================= #
126
+ @run_already = true
127
+ # ======================================================================= #
128
+ # === @show_help
129
+ #
130
+ # If this variable is set to true, then we will only show help, then
131
+ # exit the program.
132
+ # ======================================================================= #
133
+ @show_help = false
134
+ # ======================================================================= #
135
+ # === @do_exit_the_program
136
+ #
137
+ # The following variable can determine when we exit from this class.
138
+ # By default we will not exist early.
139
+ # ======================================================================= #
140
+ @do_exit_the_program = false
141
+ # ======================================================================= #
142
+ # === @array_these_programs_not_up_to_date
143
+ #
144
+ # This Array can be used to save into a local file which programs
145
+ # are not up to date.
146
+ # ======================================================================= #
147
+ if is_on_roebe?
148
+ @array_these_programs_not_up_to_date = []
149
+ end
150
+ # ======================================================================= #
151
+ # === @internal_hash
152
+ # ======================================================================= #
153
+ @internal_hash = {}
154
+ # ======================================================================= #
155
+ # === :report_the_remote_urls
156
+ #
157
+ # If this instance variable is set to true then the remote URLs will
158
+ # be shown as well, on the commandline.
159
+ # ======================================================================= #
160
+ @internal_hash[:report_the_remote_urls] = false
161
+ # ======================================================================= #
162
+ # === :try_to_rename_the_kde_konsole_tab
163
+ #
164
+ # The following instance variable will determine as to whether we will
165
+ # try to make use of the KDE Konsole and rename the tab of the konsole
166
+ # there.
167
+ #
168
+ # Since as of October 2018 we will not use the KDE konsole by default
169
+ # anymore. This may change at a later moment in time, though.
170
+ # ======================================================================= #
171
+ @internal_hash[:try_to_rename_the_kde_konsole_tab] = false
172
+ # ======================================================================= #
173
+ # === :generate_a_html_file
174
+ #
175
+ # If the next instance variable is set to true then a html file will
176
+ # be generated. By default this will not happen, though.
177
+ # ======================================================================= #
178
+ @internal_hash[:generate_a_html_file] = false
179
+ # ======================================================================= #
180
+ # === :store_the_results_into_local_files
181
+ #
182
+ # If the following variable is set to true then the project will
183
+ # generate local files too, e. g. yaml files and what not.
184
+ # ======================================================================= #
185
+ @internal_hash[:store_the_results_into_local_files] = true
186
+ # ======================================================================= #
187
+ # === :use_ascii_table
188
+ #
189
+ # Whether to use an ASCII table or whether we will not:
190
+ # ======================================================================= #
191
+ @internal_hash[:use_ascii_table] = false
192
+ # ======================================================================= #
193
+ # === :table
194
+ # ======================================================================= #
195
+ @internal_hash[:table] = nil # The ascii table.
196
+ # ======================================================================= #
197
+ # === :compare_program_versions
198
+ #
199
+ # This instance variable can be used to also compare the program
200
+ # versions, if the RBT project is available.
201
+ #
202
+ # By default this will not be done, though.
203
+ # ======================================================================= #
204
+ @internal_hash[:compare_program_versions] = false
205
+ # ======================================================================= #
206
+ # === :use_one_line_to_show_the_result
207
+ # ======================================================================= #
208
+ @internal_hash[:use_one_line_to_show_the_result] = false
209
+ # ======================================================================= #
210
+ # === :sort_alphabetically
211
+ #
212
+ # Whether to sort the main Hash alphabetically or not.
213
+ # ======================================================================= #
214
+ @internal_hash[:sort_alphabetically] = false
215
+ end
216
+
217
+ 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