environment_information 1.4.124 → 1.5.5

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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +91 -15
  3. data/doc/README.gen +42 -14
  4. data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +16 -12
  5. data/lib/environment_information/base/base.rb +483 -99
  6. data/lib/environment_information/colours/colours.rb +92 -66
  7. data/lib/environment_information/commandline/commandline.rb +137 -0
  8. data/lib/environment_information/constants/constants.rb +372 -11
  9. data/lib/environment_information/project/project.rb +1 -1
  10. data/lib/environment_information/query/constants.rb +46 -0
  11. data/lib/environment_information/query/help.rb +88 -0
  12. data/lib/environment_information/query/menu.rb +487 -0
  13. data/lib/environment_information/query/misc.rb +2006 -0
  14. data/lib/environment_information/query/query.rb +245 -0
  15. data/lib/environment_information/query/reset.rb +202 -0
  16. data/lib/environment_information/query/run.rb +70 -0
  17. data/lib/environment_information/requires/require_the_environment_information_project.rb +2 -7
  18. data/lib/environment_information/requires/require_the_toplevel_methods.rb +1 -3
  19. data/lib/environment_information/toplevel_methods/toplevel_methods.rb +2258 -0
  20. data/lib/environment_information/version/version.rb +2 -2
  21. data/lib/environment_information/www/sinatra_interface.rb +20 -17
  22. data/lib/environment_information/www/webobject_interface.cgi +6 -7
  23. data/lib/environment_information/yaml/colours.yml +3 -3
  24. data/lib/environment_information/yaml/query_to_use_for_all_components.yml +284 -0
  25. data/lib/environment_information/yaml/{array_tracked_programs.yml → track_these_components.yml} +77 -11
  26. metadata +18 -60
  27. data/lib/environment_information/class/class.rb +0 -2580
  28. data/lib/environment_information/class/colours.rb +0 -282
  29. data/lib/environment_information/colours/sfancy.rb +0 -19
  30. data/lib/environment_information/colours/simp.rb +0 -19
  31. data/lib/environment_information/constants/array_tracked_components.rb +0 -210
  32. data/lib/environment_information/constants/encoding.rb +0 -21
  33. data/lib/environment_information/constants/error_line.rb +0 -17
  34. data/lib/environment_information/constants/file_constants.rb +0 -102
  35. data/lib/environment_information/constants/misc.rb +0 -86
  36. data/lib/environment_information/constants/namespace.rb +0 -14
  37. data/lib/environment_information/constants/newline.rb +0 -16
  38. data/lib/environment_information/constants/regex.rb +0 -30
  39. data/lib/environment_information/constants/temp_directory.rb +0 -52
  40. data/lib/environment_information/misc_components/README.md +0 -3
  41. data/lib/environment_information/misc_components/cflags.rb +0 -36
  42. data/lib/environment_information/misc_components/cpuinfo.rb +0 -64
  43. data/lib/environment_information/misc_components/operating_system.rb +0 -54
  44. data/lib/environment_information/misc_components/operating_system_bit_type.rb +0 -42
  45. data/lib/environment_information/misc_components/ram.rb +0 -30
  46. data/lib/environment_information/misc_components/rubygems_installation_directory.rb +0 -54
  47. data/lib/environment_information/misc_components/screen_resolution.rb +0 -50
  48. data/lib/environment_information/queries/README.md +0 -2
  49. data/lib/environment_information/queries/complex_version.rb +0 -273
  50. data/lib/environment_information/queries/pkg_config.rb +0 -125
  51. data/lib/environment_information/queries/simple_version.rb +0 -272
  52. data/lib/environment_information/requires/require_the_individual_misc_components.rb +0 -30
  53. data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +0 -153
  54. data/lib/environment_information/toplevel_methods/cd.rb +0 -16
  55. data/lib/environment_information/toplevel_methods/e.rb +0 -43
  56. data/lib/environment_information/toplevel_methods/hash.rb +0 -65
  57. data/lib/environment_information/toplevel_methods/internet_is_available.rb +0 -30
  58. data/lib/environment_information/toplevel_methods/is_on_roebe.rb +0 -16
  59. data/lib/environment_information/toplevel_methods/menu.rb +0 -90
  60. data/lib/environment_information/toplevel_methods/misc.rb +0 -324
  61. data/lib/environment_information/toplevel_methods/n_subcommands.rb +0 -31
  62. data/lib/environment_information/toplevel_methods/prefix_to_use.rb +0 -39
  63. data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +0 -61
  64. data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +0 -45
  65. data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +0 -84
  66. data/lib/environment_information/toplevel_methods/return_alias_to.rb +0 -30
  67. data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +0 -28
  68. data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +0 -54
  69. data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +0 -28
  70. data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +0 -182
  71. data/lib/environment_information/toplevel_methods/show_all_available_components.rb +0 -192
  72. data/lib/environment_information/toplevel_methods/write_what_into.rb +0 -24
  73. data/lib/environment_information/yaml/array_default_programs_on_linux.yml +0 -15
  74. data/lib/environment_information/yaml/array_lfs_core_programs.yml +0 -37
  75. data/lib/environment_information/yaml/array_science_cluster.yml +0 -12
  76. data/lib/environment_information/yaml/array_tracked_non_programs.yml +0 -13
  77. data/lib/environment_information/yaml/array_tracked_xorg_components.yml +0 -37
  78. data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +0 -284
@@ -10,157 +10,541 @@ module EnvironmentInformation
10
10
  class Base
11
11
 
12
12
  require 'environment_information/requires/require_the_constants.rb'
13
+ require 'environment_information/toplevel_methods/toplevel_methods.rb'
13
14
  require 'environment_information/colours/colours.rb'
14
- require 'environment_information/toplevel_methods/e.rb'
15
- require 'environment_information/toplevel_methods/misc.rb'
15
+ require 'environment_information/project/project.rb'
16
16
 
17
- require 'environment_information/toplevel_methods/is_on_roebe.rb'
18
- # ========================================================================= #
17
+ # ========================================================================== #
18
+ # === TRY_TO_USE_HTML_COLOURS
19
+ #
20
+ # If true then we will try to use the konsole-colours, when possible.
21
+ #
22
+ # These are part of the colours gem, so this adds a dependency on the
23
+ # colours gem.
24
+ # ========================================================================== #
25
+ TRY_TO_USE_HTML_COLOURS = true
26
+
27
+ # ========================================================================== #
28
+ # === reset
29
+ # ========================================================================== #
30
+ def reset
31
+ # ======================================================================= #
32
+ # === @internal_hash
33
+ # ======================================================================= #
34
+ @internal_hash = {}
35
+ # ======================================================================= #
36
+ # === :use_colours
37
+ # ======================================================================= #
38
+ set_use_colours(TRY_TO_USE_HTML_COLOURS)
39
+ # ======================================================================= #
40
+ # === :be_verbose
41
+ # ======================================================================= #
42
+ set_be_verbose
43
+ end
44
+
45
+ # ========================================================================== #
46
+ # === set_be_verbose
47
+ # ========================================================================== #
48
+ def set_be_verbose(
49
+ i = true
50
+ )
51
+ case i
52
+ # ======================================================================== #
53
+ # === :be_quiet
54
+ # ======================================================================== #
55
+ when :be_quiet
56
+ i = false
57
+ end
58
+ @internal_hash[:be_verbose] = i
59
+ end
60
+
61
+ # ========================================================================== #
19
62
  # === is_on_roebe?
20
- # ========================================================================= #
63
+ # ========================================================================== #
21
64
  def is_on_roebe?
22
65
  ::EnvironmentInformation.is_on_roebe?
23
66
  end
24
67
 
25
- # ========================================================================= #
26
- # === e
27
- # ========================================================================= #
28
- def e(i = '')
29
- ::EnvironmentInformation.e(i)
30
- end
31
-
32
- # ========================================================================= #
68
+ # ========================================================================== #
33
69
  # === set_commandline_arguments
34
- # ========================================================================= #
70
+ # ========================================================================== #
35
71
  def set_commandline_arguments(i = '')
36
72
  i = [i].flatten.compact
37
73
  @commandline_arguments = i
38
74
  end
39
75
 
40
- # ========================================================================= #
76
+ # ========================================================================== #
41
77
  # === commandline_arguments?
42
- # ========================================================================= #
78
+ # ========================================================================== #
43
79
  def commandline_arguments?
44
80
  @commandline_arguments
45
81
  end
46
82
 
47
- # ========================================================================= #
83
+ # ========================================================================== #
48
84
  # === first_argument?
49
- # ========================================================================= #
85
+ # ========================================================================== #
50
86
  def first_argument?
51
87
  @commandline_arguments.first
52
88
  end; alias first? first_argument? # === first?
53
89
 
54
- # ========================================================================= #
90
+ # ========================================================================== #
55
91
  # === is_rbt_available? (rbt tag)
56
92
  #
57
93
  # Query whether the user has the necessary code from the RBT project
58
94
  # installed.
59
- # ========================================================================= #
95
+ # ========================================================================== #
60
96
  def is_rbt_available?
61
97
  Object.const_defined? :RBT
62
98
  end
63
99
 
64
- # ========================================================================= #
65
- # === log_dir?
66
- # ========================================================================= #
67
- def log_dir?
68
- ::EnvironmentInformation.temp_directory?
69
- end; alias log_directory? log_dir? # === log_directory?
70
-
71
- require 'environment_information/toplevel_methods/cd.rb'
72
- # ========================================================================= #
100
+ # ========================================================================== #
73
101
  # === cd (cd tag)
74
102
  #
75
103
  # A shorter variant for the change-directory action.
76
- # ========================================================================= #
104
+ # ========================================================================== #
77
105
  def cd(i)
78
106
  ::EnvironmentInformation.cd(i)
79
107
  end
80
108
 
81
- # ========================================================================= #
109
+ # ========================================================================== #
110
+ # === e
111
+ # ========================================================================== #
112
+ # def e(i = '')
113
+ # ::EnvironmentInformation.e(i)
114
+ # end
115
+
116
+ # ========================================================================== #
117
+ # === e (e tag)
118
+ # ========================================================================== #
119
+ def e(i = '')
120
+ puts i
121
+ end
122
+
123
+ # ========================================================================== #
82
124
  # === esystem
83
- # ========================================================================= #
125
+ # ========================================================================== #
84
126
  def esystem(i)
85
127
  e i
86
128
  system i
87
129
  end
88
130
 
89
- # ========================================================================= #
131
+ # ========================================================================== #
132
+ # === return_very_silent_system_output_from (query tag)
133
+ # ========================================================================== #
134
+ def return_very_silent_system_output_from(
135
+ use_this_query
136
+ )
137
+ return ::EnvironmentInformation.return_very_silent_system_output_from(
138
+ use_this_query
139
+ )
140
+ end; alias default_query return_very_silent_system_output_from # === default_query
141
+ alias silent_sys_command return_very_silent_system_output_from # === silent_sys_command
142
+ alias silent_query return_very_silent_system_output_from # === silent_query
143
+ alias swift_query return_very_silent_system_output_from # === swift_query
144
+
145
+ # ========================================================================== #
146
+ # === sanitize_this_version_string
147
+ # ========================================================================== #
148
+ def sanitize_this_version_string(
149
+ i
150
+ )
151
+ return ::EnvironmentInformation.sanitize_this_version_string(i)
152
+ end
153
+
154
+ # ========================================================================== #
155
+ # === sfile
156
+ # ========================================================================== #
157
+ def sfile(
158
+ i = '',
159
+ use_colours = use_colours?
160
+ )
161
+ return ::EnvironmentInformation.sfile(i, use_colours) if use_colours
162
+ return i
163
+ end
164
+
165
+ # ========================================================================== #
166
+ # === use_colours?
167
+ # ========================================================================== #
168
+ def use_colours?
169
+ @use_colours
170
+ end
171
+
172
+ # ========================================================================== #
173
+ # === tomato
174
+ # ========================================================================== #
175
+ def tomato(i = '')
176
+ return ::Colours::HtmlColoursMethods.tomato(i)
177
+ end
178
+
179
+ # ========================================================================== #
90
180
  # === gold
91
- # ========================================================================= #
181
+ # ========================================================================== #
92
182
  def gold(i = '')
93
- return ::Colours.gold(i)
183
+ return ::Colours::HtmlColoursMethods.gold(i)
94
184
  end
95
185
 
96
- # ========================================================================= #
97
- # === report_left_right
98
- # ========================================================================= #
99
- def report_left_right(
100
- left = program_name?,
101
- right = program_version?,
102
- colour_for_the_left_side = ::EnvironmentInformation.colour_for_the_left_side,
103
- colour_for_the_right_side = ::EnvironmentInformation.colour_for_the_right_side,
104
- colour_for_program_not_found = ::EnvironmentInformation.colour_for_program_not_found,
105
- use_padding = true
106
- )
107
- case colour_for_the_left_side
108
- # ======================================================================= #
109
- # === :default_colour
110
- # ======================================================================= #
111
- when :default_colour
112
- colour_for_the_left_side = ::EnvironmentInformation.colour_for_the_left_side
113
- end
114
- case colour_for_the_right_side
115
- # ======================================================================= #
116
- # === :default_colour
117
- # ======================================================================= #
118
- when :default_colour
119
- colour_for_the_right_side = ::EnvironmentInformation.colour_for_the_right_side
120
- end
121
- case colour_for_program_not_found
122
- # ======================================================================= #
123
- # === :default_colour
124
- # ======================================================================= #
125
- when :default_colour
126
- colour_for_program_not_found = ::EnvironmentInformation.colour_for_program_not_found
127
- end
128
- case right
129
- when nil
130
- right = NOT_INSTALLED_OR_NOT_FOUND
131
- end
132
- right = right.dup if right.frozen?
133
- right.strip!
134
- if right.include? 'not found'
135
- right = ::EnvironmentInformation.send(
136
- colour_for_program_not_found, right
137
- )
138
- end
139
- colourized_right_side = ::EnvironmentInformation.send(
140
- colour_for_the_right_side,
141
- right
142
- )
143
- modified_left = "#{left}:"
144
- modified_left = modified_left.ljust(32) if use_padding
145
- e ::EnvironmentInformation.send(
146
- colour_for_the_left_side,
147
- modified_left
148
- )+
149
- " #{colourized_right_side}"
150
- end
151
-
152
- # ========================================================================= #
186
+ # ========================================================================== #
187
+ # === mediumaquamarine
188
+ # ========================================================================== #
189
+ def mediumaquamarine(i = '')
190
+ return ::Colours::HtmlColoursMethods.mediumaquamarine(i)
191
+ end
192
+
193
+ # ========================================================================== #
153
194
  # === lightblue
154
- # ========================================================================= #
195
+ # ========================================================================== #
155
196
  def lightblue(i = '')
156
- return ::Colours.lightblue(i)
197
+ return ::Colours::HtmlColoursMethods.lightblue(i)
157
198
  end
158
199
 
159
- # ========================================================================= #
160
- # === mediumaquamarine
161
- # ========================================================================= #
162
- def mediumaquamarine(i = '')
163
- return ::EnvironmentInformation.mediumaquamarine(i)
200
+ # ========================================================================== #
201
+ # === cyan
202
+ # ========================================================================== #
203
+ def cyan(
204
+ i = '',
205
+ use_colours = use_colours?
206
+ )
207
+ return ::Colours::HtmlColoursMethods.cyan(i) if use_colours and TRY_TO_USE_HTML_COLOURS
208
+ return i
209
+ end
210
+
211
+ # ========================================================================== #
212
+ # === true_rev
213
+ # ========================================================================== #
214
+ def true_rev
215
+ return Colours.rev if use_colours?
216
+ return ''
217
+ end
218
+
219
+ # ========================================================================== #
220
+ # === simp
221
+ # ========================================================================== #
222
+ def simp(
223
+ i,
224
+ use_colours = use_colours?
225
+ )
226
+ return ::Colours.simp(i) if use_colours
227
+ return i
228
+ end
229
+
230
+ # ========================================================================== #
231
+ # === register_sigint
232
+ # ========================================================================== #
233
+ def register_sigint
234
+ Signal.trap('SIGINT') { e; exit }
164
235
  end
165
236
 
237
+ # ========================================================================== #
238
+ # === tracked_programs?
239
+ # ========================================================================== #
240
+ def tracked_programs?
241
+ ARRAY_TRACKED_PROGRAMS
242
+ end
243
+
244
+ # ========================================================================== #
245
+ # === set_use_colours
246
+ # ========================================================================== #
247
+ def set_use_colours(i = true)
248
+ @use_colours = i
249
+ end
250
+
251
+ # ========================================================================== #
252
+ # === enable_colours
253
+ # ========================================================================== #
254
+ def enable_colours
255
+ set_use_colours(true)
256
+ end
257
+
258
+ # ========================================================================== #
259
+ # === disable_colours
260
+ # ========================================================================== #
261
+ def disable_colours
262
+ set_use_colours(false)
263
+ end; alias no_colours disable_colours # === no_colours()
264
+
265
+ # ========================================================================== #
266
+ # === rev (rev tag)
267
+ # ========================================================================== #
268
+ def rev(
269
+ use_colours = use_colours?
270
+ )
271
+ return ::EnvironmentInformation.rev(use_colours)
272
+ end
273
+
274
+ # ========================================================================== #
275
+ # === lightseagreen
276
+ # ========================================================================== #
277
+ def lightseagreen(
278
+ i = '',
279
+ use_colours = use_colours?
280
+ )
281
+ return ::Colours::HtmlColoursMethods.lightseagreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
282
+ return i
283
+ end
284
+
285
+ # ========================================================================== #
286
+ # === seagreen
287
+ # ========================================================================== #
288
+ def seagreen(
289
+ i = '',
290
+ use_colours = use_colours?
291
+ )
292
+ return ::Colours::HtmlColoursMethods.seagreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
293
+ return i
294
+ end
295
+
296
+ # ========================================================================== #
297
+ # === blue
298
+ # ========================================================================== #
299
+ def blue(
300
+ i = '',
301
+ use_colours = use_colours?
302
+ )
303
+ return ::Colours::HtmlColoursMethods.blue(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
304
+ return i
305
+ end
306
+
307
+ # ========================================================================== #
308
+ # === crimson
309
+ # ========================================================================== #
310
+ def crimson(
311
+ i = '',
312
+ use_colours = use_colours?
313
+ )
314
+ return ::Colours::HtmlColoursMethods.crimson(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
315
+ return i
316
+ end
317
+
318
+ # ========================================================================== #
319
+ # === mediumpurple
320
+ # ========================================================================== #
321
+ def mediumpurple(
322
+ i = '',
323
+ use_colours = use_colours?
324
+ )
325
+ return ::Colours::HtmlColoursMethods.mediumpurple(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
326
+ return i
327
+ end
328
+
329
+ # ========================================================================== #
330
+ # === teal
331
+ # ========================================================================== #
332
+ def teal(
333
+ i = '',
334
+ use_colours = use_colours?
335
+ )
336
+ return ::Colours::HtmlColoursMethods.teal(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
337
+ return i
338
+ end
339
+
340
+ # ========================================================================== #
341
+ # === orange
342
+ # ========================================================================== #
343
+ def orange(
344
+ i = '',
345
+ use_colours = use_colours?
346
+ )
347
+ return ::Colours::HtmlColoursMethods.orange(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
348
+ return i
349
+ end
350
+
351
+ # ========================================================================== #
352
+ # === lightgreen
353
+ # ========================================================================== #
354
+ def lightgreen(
355
+ i = '',
356
+ use_colours = use_colours?
357
+ )
358
+ return ::Colours::HtmlColoursMethods.lightgreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
359
+ return i
360
+ end
361
+
362
+ # ========================================================================== #
363
+ # === darkolivegreen
364
+ # ========================================================================== #
365
+ def darkolivegreen(
366
+ i = '',
367
+ use_colours = use_colours?
368
+ )
369
+ return ::Colours::HtmlColoursMethods.darkolivegreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
370
+ return i
371
+ end
372
+
373
+ # ========================================================================== #
374
+ # === limegreen
375
+ # ========================================================================== #
376
+ def limegreen(
377
+ i = '',
378
+ use_colours = use_colours?
379
+ )
380
+ return ::Colours::HtmlColoursMethods.limegreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
381
+ return i
382
+ end
383
+
384
+ # ========================================================================== #
385
+ # === olive
386
+ # ========================================================================== #
387
+ def olive(
388
+ i = '',
389
+ use_colours = use_colours?
390
+ )
391
+ return ::Colours::HtmlColoursMethods.olive(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
392
+ return i
393
+ end
394
+
395
+ # ========================================================================== #
396
+ # === olivedrab
397
+ # ========================================================================== #
398
+ def olivedrab(
399
+ i = '',
400
+ use_colours = use_colours?
401
+ )
402
+ return ::Colours::HtmlColoursMethods.olivedrab(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
403
+ return i
404
+ end
405
+
406
+ # ========================================================================== #
407
+ # === steelblue
408
+ # ========================================================================== #
409
+ def steelblue(
410
+ i = '',
411
+ use_colours = use_colours?
412
+ )
413
+ return ::Colours::HtmlColoursMethods.steelblue(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
414
+ return i
415
+ end
416
+
417
+ # ========================================================================== #
418
+ # === slateblue
419
+ # ========================================================================== #
420
+ def slateblue(
421
+ i = '',
422
+ use_colours = use_colours?
423
+ )
424
+ return ::Colours::HtmlColoursMethods.slateblue(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
425
+ return i
426
+ end
427
+
428
+ # ========================================================================== #
429
+ # === royalblue
430
+ # ========================================================================== #
431
+ def royalblue(
432
+ i = '',
433
+ use_colours = use_colours?
434
+ )
435
+ return ::Colours::HtmlColoursMethods.royalblue(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
436
+ return i
437
+ end
438
+
439
+ # ========================================================================== #
440
+ # === dimgray
441
+ # ========================================================================== #
442
+ def dimgray(
443
+ i = '',
444
+ use_colours = use_colours?
445
+ )
446
+ return ::Colours::HtmlColoursMethods.dimgray(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
447
+ return i
448
+ end
449
+
450
+ # ========================================================================== #
451
+ # === darkgreen
452
+ # ========================================================================== #
453
+ def darkgreen(
454
+ i = '',
455
+ use_colours = use_colours?
456
+ )
457
+ return ::Colours::HtmlColoursMethods.darkgreen(i) if use_colours? and TRY_TO_USE_HTML_COLOURS
458
+ return i
459
+ end
460
+
461
+ # ========================================================================== #
462
+ # === col1
463
+ #
464
+ # The "first" colour to be used.
465
+ # ========================================================================== #
466
+ def col1
467
+ return Colours::BOLD_BLUE if use_colours?
468
+ return ''
469
+ end
470
+
471
+ # ========================================================================== #
472
+ # === sfancy
473
+ # ========================================================================== #
474
+ def sfancy(
475
+ i = '',
476
+ use_colours = use_colours?
477
+ )
478
+ return ::Colours.sfancy(i) if use_colours
479
+ return i
480
+ end
481
+
482
+ # ========================================================================== #
483
+ # === write_what_into
484
+ # ========================================================================== #
485
+ def write_what_into(what, into)
486
+ ::EnvironmentInformation.write_what_into(what, into)
487
+ end
488
+
489
+ # ========================================================================== #
490
+ # === be_verbose?
491
+ # ========================================================================== #
492
+ def be_verbose?
493
+ @internal_hash[:be_verbose]
494
+ end
495
+
496
+ # ========================================================================== #
497
+ # === be_silent
498
+ # ========================================================================== #
499
+ def be_silent
500
+ @internal_hash[:be_verbose] = false
501
+ end; alias be_quiet be_silent # === be_quiet
502
+
503
+ # ========================================================================== #
504
+ # === set_be_silent
505
+ # ========================================================================== #
506
+ def set_be_silent(i = true)
507
+ @internal_hash[:be_verbose] = !i
508
+ end
509
+
510
+ # ========================================================================== #
511
+ # === be_silent?
512
+ # ========================================================================== #
513
+ def be_silent?
514
+ !be_verbose?
515
+ end
516
+
517
+ # ========================================================================== #
518
+ # === opne
519
+ # ========================================================================== #
520
+ def opne(i = '')
521
+ opnn; e i
522
+ end; alias opnne opne # === opnne
523
+
524
+ # ========================================================================== #
525
+ # === log_dir?
526
+ # ========================================================================== #
527
+ def log_dir?
528
+ ::EnvironmentInformation.temp_directory?
529
+ end; alias log_directory? log_dir? # === log_directory?
530
+ alias temp_dir? log_dir? # === temp_dir?
531
+ alias temp_directory? log_dir? # === temp_directory?
532
+
533
+ # ========================================================================== #
534
+ # === load_dataset_from_this_file
535
+ #
536
+ # This method can be used to read which programs will be displayed
537
+ # from a local file, rather than rely on the pre-set default.
538
+ # ========================================================================== #
539
+ def load_dataset_from_this_file(i)
540
+ if File.exist? i
541
+ File.readlines(i).map {|entry|
542
+ entry.delete('-').strip # ← Clean up the input a little bit.
543
+ }
544
+ else
545
+ opne "No file exists at `#{sfile(i)}`."
546
+ end
547
+ end; alias try_to_load_dataset_from_this_file load_dataset_from_this_file # === try_to_load_dataset_from_this_file
548
+ alias try_to_read_content_from_this_file load_dataset_from_this_file # === try_to_read_content_from_this_file
549
+
166
550
  end; end