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
@@ -0,0 +1,282 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/class/colours.rb'
6
+ # =========================================================================== #
7
+ require 'environment_information/base/base.rb'
8
+
9
+ module EnvironmentInformation
10
+
11
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
12
+
13
+ # ========================================================================= #
14
+ # === colourize_this_in_the_right_side_colour
15
+ # ========================================================================= #
16
+ def colourize_this_in_the_right_side_colour(i)
17
+ if use_colours?
18
+ ::Colours.send(::EnvironmentInformation.colour_for_the_right_side, i)
19
+ else
20
+ i
21
+ end
22
+ end
23
+
24
+ # ========================================================================= #
25
+ # === cyan
26
+ # ========================================================================= #
27
+ def cyan(
28
+ i = '', use_colours = use_colours?
29
+ )
30
+ if i.empty?
31
+ Colours::CYAN
32
+ end if use_colours
33
+ end
34
+
35
+ # ========================================================================= #
36
+ # === blue
37
+ # ========================================================================= #
38
+ def blue(i = '')
39
+ if i.empty?
40
+ ::Colours::BLUE
41
+ end if use_colours?
42
+ end
43
+
44
+ # ========================================================================= #
45
+ # === simp
46
+ # ========================================================================= #
47
+ def simp(i, use_colours = use_colours?)
48
+ return ::Colours.simp(i) if use_colours
49
+ return i
50
+ end
51
+
52
+ # ========================================================================= #
53
+ # === set_use_colours
54
+ # ========================================================================= #
55
+ def set_use_colours(i = '')
56
+ ::EnvironmentInformation.set_use_colours(true)
57
+ end
58
+
59
+ # ========================================================================= #
60
+ # === use_colours?
61
+ # ========================================================================= #
62
+ def use_colours?
63
+ ::EnvironmentInformation.use_colours?
64
+ end
65
+
66
+ # ========================================================================= #
67
+ # === enable_colours
68
+ # ========================================================================= #
69
+ def enable_colours
70
+ ::EnvironmentInformation.use_colours = true
71
+ end
72
+
73
+ # ========================================================================= #
74
+ # === disable_colours
75
+ #
76
+ # Call this method when you wish to disable the colours. Note that
77
+ # this will disable colours on the toplevel.
78
+ # ========================================================================= #
79
+ def disable_colours
80
+ ::EnvironmentInformation.use_colours = false
81
+ end; alias no_colours disable_colours # === no_colours()
82
+
83
+ # ========================================================================= #
84
+ # === rev
85
+ # ========================================================================= #
86
+ def rev
87
+ if use_colours?
88
+ Colours::GREEN
89
+ else
90
+ ''
91
+ end
92
+ end
93
+
94
+ # ========================================================================= #
95
+ # === true_rev
96
+ # ========================================================================= #
97
+ def true_rev
98
+ if use_colours?
99
+ Colours::REV
100
+ else
101
+ ''
102
+ end
103
+ end
104
+
105
+ # ========================================================================= #
106
+ # === col1
107
+ #
108
+ # The "first" colour to be used.
109
+ # ========================================================================= #
110
+ def col1
111
+ if use_colours?
112
+ Colours::BOLD_BLUE
113
+ else
114
+ ''
115
+ end
116
+ end
117
+
118
+ # ========================================================================= #
119
+ # === sfile
120
+ # ========================================================================= #
121
+ def sfile(i)
122
+ return ::Colours.sfile(i) if use_colours?
123
+ return i
124
+ end
125
+
126
+ # ========================================================================= #
127
+ # === sfancy
128
+ # ========================================================================= #
129
+ def sfancy(i = '')
130
+ return ::Colours.sfancy(i) if use_colours?
131
+ return i
132
+ end
133
+
134
+ # ========================================================================= #
135
+ # === crimson
136
+ # ========================================================================= #
137
+ def crimson(i = '')
138
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
139
+ i = ::Colours.crimson(i)
140
+ end
141
+ return i
142
+ end
143
+
144
+ # ========================================================================= #
145
+ # === darkgreen
146
+ # ========================================================================= #
147
+ def darkgreen(i = '')
148
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
149
+ i = ::Colours.darkgreen(i)
150
+ end
151
+ return i
152
+ end
153
+
154
+ # ========================================================================= #
155
+ # === dimgray
156
+ # ========================================================================= #
157
+ def dimgray(i = '')
158
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
159
+ i = ::Colours.dimgray(i)
160
+ end
161
+ return i
162
+ end
163
+
164
+ # ========================================================================= #
165
+ # === royalblue
166
+ # ========================================================================= #
167
+ def royalblue(i = '')
168
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
169
+ i = ::Colours.royalblue(i)
170
+ end
171
+ return i
172
+ end
173
+
174
+ # ========================================================================= #
175
+ # === slateblue
176
+ # ========================================================================= #
177
+ def slateblue(i = '')
178
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
179
+ i = ::Colours.slateblue(i)
180
+ end
181
+ return i
182
+ end
183
+
184
+ # ========================================================================= #
185
+ # === steelblue
186
+ # ========================================================================= #
187
+ def steelblue(i = '')
188
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
189
+ i = ::Colours.steelblue(i)
190
+ end
191
+ return i
192
+ end
193
+
194
+ # ========================================================================= #
195
+ # === seagreen
196
+ # ========================================================================= #
197
+ def seagreen(i = '')
198
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
199
+ i = ::Colours.seagreen(i)
200
+ end
201
+ return i
202
+ end
203
+
204
+ # ========================================================================= #
205
+ # === olivedrab
206
+ #
207
+ # This one will be used for the right-hand side.
208
+ # ========================================================================= #
209
+ def olivedrab(i = '')
210
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
211
+ i = ::Colours.olivedrab(i)
212
+ end
213
+ return i
214
+ end
215
+
216
+ # ========================================================================= #
217
+ # === olive
218
+ # ========================================================================= #
219
+ def olive(i = '')
220
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
221
+ i = ::Colours.olive(i)
222
+ end
223
+ return i
224
+ end
225
+
226
+ # ========================================================================= #
227
+ # === limegreen
228
+ # ========================================================================= #
229
+ def limegreen(i = '')
230
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
231
+ i = ::Colours.limegreen(i)
232
+ end
233
+ return i
234
+ end
235
+
236
+ # ========================================================================= #
237
+ # === darkolivegreen
238
+ # ========================================================================= #
239
+ def darkolivegreen(i = '')
240
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
241
+ i = ::Colours.darkolivegreen(i)
242
+ end
243
+ return i
244
+ end
245
+
246
+ # ========================================================================= #
247
+ # === lightgreen
248
+ # ========================================================================= #
249
+ def lightgreen(i = '')
250
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
251
+ i = ::Colours.lightgreen(i)
252
+ end
253
+ return i
254
+ end
255
+
256
+ # ========================================================================= #
257
+ # === mediumpurple
258
+ # ========================================================================= #
259
+ def mediumpurple(i = '')
260
+ if use_colours? and TRY_TO_USE_HTML_COLOURS
261
+ i = ::Colours.mediumpurple(i)
262
+ end
263
+ return i
264
+ end
265
+
266
+ # ========================================================================= #
267
+ # === teal
268
+ # ========================================================================= #
269
+ def teal(i = '')
270
+ return ::Colours.teal(i) if use_colours?
271
+ return i
272
+ end
273
+
274
+ # ========================================================================= #
275
+ # === orange
276
+ # ========================================================================= #
277
+ def orange(i = '')
278
+ return ::Colours.orange(i) if use_colours?
279
+ return i
280
+ end
281
+
282
+ end; end
@@ -0,0 +1,224 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/colours/colours.rb'
6
+ # EnvironmentInformation.colour_for_the_left_side
7
+ # =========================================================================== #
8
+ module EnvironmentInformation
9
+
10
+ require 'environment_information/project/project.rb'
11
+
12
+ # ========================================================================= #
13
+ # First the code here will determine which colours are to be used. If
14
+ # a .yml file can be found as part of this project then it will override
15
+ # the default values given here; otherwise the default values will be
16
+ # used, consequently.
17
+ # ========================================================================= #
18
+
19
+ yaml_file = EnvironmentInformation.project_base_directory?+'yaml/colours.yml'
20
+ if File.exist? yaml_file
21
+ dataset = YAML.load_file(yaml_file) # These should be a Symbol.
22
+ @colour_for_the_left_side = dataset['left_side'].to_sym
23
+ @colour_for_the_right_side = dataset['right_side'].to_sym
24
+ @colour_for_program_not_found = dataset['program_not_found'].to_sym
25
+ else # else use default values here
26
+ # ========================================================================= #
27
+ # === @colour_for_the_left_side
28
+ # ========================================================================= #
29
+ @colour_for_the_left_side = :forestgreen
30
+
31
+ # ========================================================================= #
32
+ # === @colour_for_the_right_side
33
+ # ========================================================================= #
34
+ @colour_for_the_right_side = :steelblue
35
+
36
+ # ========================================================================= #
37
+ # === @colour_for_program_not_found
38
+ # ========================================================================= #
39
+ @colour_for_program_not_found = :lightslategrey
40
+ end
41
+
42
+ begin
43
+ require 'colours/html_colours'
44
+ # ======================================================================= #
45
+ # === @use_colours
46
+ #
47
+ # By default this project will try to make use of colours. This has
48
+ # be protected by a rescue clause, as not every user may have the
49
+ # gem called "colours" installed.
50
+ # ======================================================================= #
51
+ @use_colours = true
52
+ rescue LoadError
53
+ # ======================================================================= #
54
+ # If the colours-gem is not available then we will not use colours.
55
+ # The user could still overrule this at a later time, though.
56
+ # ======================================================================= #
57
+ @use_colours = false
58
+ end
59
+
60
+ # ========================================================================= #
61
+ # === EnvironmentInformation.colour_for_the_left_side (left tag)
62
+ #
63
+ # This method will return the colour
64
+ #
65
+ # This could also be :limegreen rather than :forestgreen or vice versa.
66
+ # ========================================================================= #
67
+ def self.colour_for_the_left_side
68
+ @colour_for_the_left_side
69
+ end
70
+
71
+ # ========================================================================= #
72
+ # === EnvironmentInformation.colour_for_the_right_side (right tag)
73
+ # ========================================================================= #
74
+ def self.colour_for_the_right_side
75
+ @colour_for_the_right_side
76
+ end
77
+
78
+ # ========================================================================= #
79
+ # === EnvironmentInformation.colour_for_program_not_found
80
+ # ========================================================================= #
81
+ def self.colour_for_program_not_found
82
+ @colour_for_program_not_found
83
+ end
84
+
85
+ # ========================================================================= #
86
+ # === EnvironmentInformation.use_colours?
87
+ # ========================================================================= #
88
+ def self.use_colours?
89
+ @use_colours
90
+ end
91
+
92
+ # ========================================================================= #
93
+ # === EnvironmentInformation.set_use_colours
94
+ #
95
+ # Determine whether the EnvironmentInformation project will use
96
+ # colours or whether it will not.
97
+ # ========================================================================= #
98
+ def self.set_use_colours(i = true)
99
+ @use_colours = i
100
+ end; self.instance_eval { alias use_colours= set_use_colours } # === EnvironmentInformation.use_colours=
101
+
102
+ # ========================================================================= #
103
+ # === EnvironmentInformation.do_use_colours
104
+ # ========================================================================= #
105
+ def self.do_use_colours
106
+ @use_colours = i
107
+ end
108
+
109
+ # ========================================================================= #
110
+ # === EnvironmentInformation.mediumpurple
111
+ # ========================================================================= #
112
+ def self.mediumpurple(i = '')
113
+ if @use_colours
114
+ return ::Colours.mediumpurple(i)
115
+ end
116
+ return i
117
+ end
118
+
119
+ # ========================================================================= #
120
+ # === EnvironmentInformation.lightslategrey
121
+ # ========================================================================= #
122
+ def self.lightslategrey(i = '')
123
+ if @use_colours
124
+ return ::Colours.lightslategrey(i)
125
+ end
126
+ return i
127
+ end
128
+
129
+ # ========================================================================= #
130
+ # === EnvironmentInformation.tomato
131
+ # ========================================================================= #
132
+ def self.tomato(
133
+ i = '', use_colours = @use_colours
134
+ )
135
+ return ::Colours.tomato(i) if use_colours
136
+ return i
137
+ end
138
+
139
+ # ========================================================================= #
140
+ # === EnvironmentInformation.pink
141
+ # ========================================================================= #
142
+ def self.pink(
143
+ i = '', use_colours = @use_colours
144
+ )
145
+ return ::Colours.pink(i) if use_colours
146
+ return i
147
+ end
148
+
149
+ # ========================================================================= #
150
+ # === EnvironmentInformation.forestgreen
151
+ # ========================================================================= #
152
+ def self.forestgreen(
153
+ i = '', use_colours = @use_colours
154
+ )
155
+ return ::Colours.forestgreen(i) if use_colours
156
+ return i
157
+ end
158
+
159
+ # ========================================================================= #
160
+ # === EnvironmentInformation.lightseagreen
161
+ # ========================================================================= #
162
+ def self.lightseagreen(i = '', use_colours = @use_colours)
163
+ if use_colours
164
+ return ::Colours.lightseagreen(i)
165
+ end
166
+ return i
167
+ end
168
+
169
+ # ========================================================================= #
170
+ # === EnvironmentInformation.steelblue
171
+ # ========================================================================= #
172
+ def self.steelblue(i = '')
173
+ if @use_colours
174
+ return ::Colours.steelblue(i)
175
+ end
176
+ return i
177
+ end
178
+
179
+ # ========================================================================= #
180
+ # === EnvironmentInformation.royalblue
181
+ # ========================================================================= #
182
+ def self.royalblue(
183
+ i = '',
184
+ use_colours = @use_colours
185
+ )
186
+ if use_colours
187
+ return ::Colours.royalblue(i)
188
+ end
189
+ return i
190
+ end
191
+
192
+ # ========================================================================= #
193
+ # === EnvironmentInformation.mediumaquamarine
194
+ # ========================================================================= #
195
+ def self.mediumaquamarine(
196
+ i = '',
197
+ use_colours = @use_colours
198
+ )
199
+ if use_colours
200
+ return ::Colours.mediumaquamarine(i)
201
+ end
202
+ return i
203
+ end
204
+
205
+ # ========================================================================= #
206
+ # === EnvironmentInformation.sfile
207
+ # ========================================================================= #
208
+ def self.sfile(i = '')
209
+ if @use_colours
210
+ ::Colours.sfile(i)
211
+ else
212
+ i
213
+ end
214
+ end
215
+
216
+ # ========================================================================= #
217
+ # === EnvironmentInformation.rev (rev tag)
218
+ # ========================================================================= #
219
+ def self.rev
220
+ return ::Colours.rev if @use_colours
221
+ '' # Else return an empty String.
222
+ end
223
+
224
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/colours/sfancy.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ require 'environment_information/colours/colours.rb'
10
+
11
+ # ========================================================================= #
12
+ # === EnvironmentInformation
13
+ # ========================================================================= #
14
+ def self.sfancy(i = '')
15
+ return ::Colours.sfancy(i) if Object.const_defined? :Colours
16
+ i
17
+ end
18
+
19
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/colours/simp.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ require 'environment_information/colours/colours.rb'
10
+
11
+ # ========================================================================= #
12
+ # === EnvironmentInformation
13
+ # ========================================================================= #
14
+ def self.simp(i = '')
15
+ return ::Colours.simp(i) if Object.const_defined? :Colours
16
+ i
17
+ end
18
+
19
+ end