environment_information 1.4.99
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.
- checksums.yaml +7 -0
- data/README.md +1287 -0
- data/bin/envi +7 -0
- data/bin/fast_envi +7 -0
- data/doc/README.gen +1044 -0
- data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +48 -0
- data/environment_information.gemspec +135 -0
- data/lib/environment_information/base/base.rb +166 -0
- data/lib/environment_information/class/class.rb +2829 -0
- data/lib/environment_information/colours/colours.rb +224 -0
- data/lib/environment_information/colours/sfancy.rb +19 -0
- data/lib/environment_information/colours/simp.rb +19 -0
- data/lib/environment_information/constants/array_tracked_components.rb +210 -0
- data/lib/environment_information/constants/constants.rb +17 -0
- data/lib/environment_information/constants/encoding.rb +21 -0
- data/lib/environment_information/constants/error_line.rb +17 -0
- data/lib/environment_information/constants/file_constants.rb +102 -0
- data/lib/environment_information/constants/misc.rb +86 -0
- data/lib/environment_information/constants/namespace.rb +14 -0
- data/lib/environment_information/constants/newline.rb +16 -0
- data/lib/environment_information/constants/regex.rb +30 -0
- data/lib/environment_information/constants/temp_directory.rb +52 -0
- data/lib/environment_information/gui/gtk2/environment_information.rb +35 -0
- data/lib/environment_information/gui/gtk3/environment_information.rb +34 -0
- data/lib/environment_information/gui/libui/environment_information.rb +74 -0
- data/lib/environment_information/gui/shared_code/environment_information_module.rb +409 -0
- data/lib/environment_information/misc_components/README.md +3 -0
- data/lib/environment_information/misc_components/cflags.rb +36 -0
- data/lib/environment_information/misc_components/cpuinfo.rb +64 -0
- data/lib/environment_information/misc_components/operating_system.rb +54 -0
- data/lib/environment_information/misc_components/operating_system_bit_type.rb +42 -0
- data/lib/environment_information/misc_components/ram.rb +30 -0
- data/lib/environment_information/misc_components/rubygems_installation_directory.rb +54 -0
- data/lib/environment_information/misc_components/screen_resolution.rb +50 -0
- data/lib/environment_information/project/project.rb +27 -0
- data/lib/environment_information/queries/README.md +2 -0
- data/lib/environment_information/queries/complex_version.rb +273 -0
- data/lib/environment_information/queries/pkg_config.rb +125 -0
- data/lib/environment_information/queries/simple_version.rb +217 -0
- data/lib/environment_information/requires/require_asciitable.rb +15 -0
- data/lib/environment_information/requires/require_the_constants.rb +7 -0
- data/lib/environment_information/requires/require_the_environment_information_project.rb +23 -0
- data/lib/environment_information/requires/require_the_individual_misc_components.rb +30 -0
- data/lib/environment_information/requires/require_the_toplevel_methods.rb +22 -0
- data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +152 -0
- data/lib/environment_information/toplevel_methods/cd.rb +16 -0
- data/lib/environment_information/toplevel_methods/e.rb +43 -0
- data/lib/environment_information/toplevel_methods/hash.rb +60 -0
- data/lib/environment_information/toplevel_methods/internet_is_available.rb +30 -0
- data/lib/environment_information/toplevel_methods/is_on_roebe.rb +16 -0
- data/lib/environment_information/toplevel_methods/menu.rb +90 -0
- data/lib/environment_information/toplevel_methods/misc.rb +322 -0
- data/lib/environment_information/toplevel_methods/n_subcommands.rb +31 -0
- data/lib/environment_information/toplevel_methods/prefix_to_use.rb +39 -0
- data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +61 -0
- data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +45 -0
- data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +84 -0
- data/lib/environment_information/toplevel_methods/return_alias_to.rb +30 -0
- data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +28 -0
- data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +54 -0
- data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +28 -0
- data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +182 -0
- data/lib/environment_information/toplevel_methods/show_all_available_components.rb +192 -0
- data/lib/environment_information/toplevel_methods/write_what_into.rb +24 -0
- data/lib/environment_information/version/version.rb +25 -0
- data/lib/environment_information/www/sinatra_interface.rb +213 -0
- data/lib/environment_information/www/webobject_interface.cgi +29 -0
- data/lib/environment_information/yaml/array_default_programs_on_linux.yml +15 -0
- data/lib/environment_information/yaml/array_lfs_core_programs.yml +37 -0
- data/lib/environment_information/yaml/array_science_cluster.yml +12 -0
- data/lib/environment_information/yaml/array_tracked_non_programs.yml +13 -0
- data/lib/environment_information/yaml/array_tracked_programs.yml +215 -0
- data/lib/environment_information/yaml/array_tracked_xorg_components.yml +37 -0
- data/lib/environment_information/yaml/colours.yml +3 -0
- data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +264 -0
- data/lib/environment_information.rb +5 -0
- data/test/testing_environment_information.rb +26 -0
- data/test/testing_missing_components.rb +9 -0
- data/test/testing_prefix_for_the_environment_information_project.rb +20 -0
- metadata +177 -0
@@ -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'
|
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.rev
|
87
|
+
# ========================================================================= #
|
88
|
+
def self.rev
|
89
|
+
return ::Colours.rev if @use_colours
|
90
|
+
'' # Else return an empty String.
|
91
|
+
end
|
92
|
+
|
93
|
+
# ========================================================================= #
|
94
|
+
# === EnvironmentInformation.use_colours?
|
95
|
+
# ========================================================================= #
|
96
|
+
def self.use_colours?
|
97
|
+
@use_colours
|
98
|
+
end
|
99
|
+
|
100
|
+
# ========================================================================= #
|
101
|
+
# === EnvironmentInformation.set_use_colours
|
102
|
+
#
|
103
|
+
# Determine whether the EnvironmentInformation project will use
|
104
|
+
# colours or whether it will not.
|
105
|
+
# ========================================================================= #
|
106
|
+
def self.set_use_colours(i = true)
|
107
|
+
@use_colours = i
|
108
|
+
end; self.instance_eval { alias use_colours= set_use_colours } # === EnvironmentInformation.use_colours=
|
109
|
+
|
110
|
+
# ========================================================================= #
|
111
|
+
# === EnvironmentInformation.do_use_colours
|
112
|
+
# ========================================================================= #
|
113
|
+
def self.do_use_colours
|
114
|
+
@use_colours = i
|
115
|
+
end
|
116
|
+
|
117
|
+
# ========================================================================= #
|
118
|
+
# === EnvironmentInformation.mediumpurple
|
119
|
+
# ========================================================================= #
|
120
|
+
def self.mediumpurple(i = '')
|
121
|
+
if @use_colours
|
122
|
+
return ::Colours.mediumpurple(i)
|
123
|
+
end
|
124
|
+
return i
|
125
|
+
end
|
126
|
+
|
127
|
+
# ========================================================================= #
|
128
|
+
# === EnvironmentInformation.lightslategrey
|
129
|
+
# ========================================================================= #
|
130
|
+
def self.lightslategrey(i = '')
|
131
|
+
if @use_colours
|
132
|
+
return ::Colours.lightslategrey(i)
|
133
|
+
end
|
134
|
+
return i
|
135
|
+
end
|
136
|
+
|
137
|
+
# ========================================================================= #
|
138
|
+
# === EnvironmentInformation.tomato
|
139
|
+
# ========================================================================= #
|
140
|
+
def self.tomato(
|
141
|
+
i = '', use_colours = @use_colours
|
142
|
+
)
|
143
|
+
return ::Colours.tomato(i) if use_colours
|
144
|
+
return i
|
145
|
+
end
|
146
|
+
|
147
|
+
# ========================================================================= #
|
148
|
+
# === EnvironmentInformation.pink
|
149
|
+
# ========================================================================= #
|
150
|
+
def self.pink(
|
151
|
+
i = '', use_colours = @use_colours
|
152
|
+
)
|
153
|
+
return ::Colours.pink(i) if use_colours
|
154
|
+
return i
|
155
|
+
end
|
156
|
+
|
157
|
+
# ========================================================================= #
|
158
|
+
# === EnvironmentInformation.forestgreen
|
159
|
+
# ========================================================================= #
|
160
|
+
def self.forestgreen(
|
161
|
+
i = '', use_colours = @use_colours
|
162
|
+
)
|
163
|
+
return ::Colours.forestgreen(i) if use_colours
|
164
|
+
return i
|
165
|
+
end
|
166
|
+
|
167
|
+
# ========================================================================= #
|
168
|
+
# === EnvironmentInformation.lightseagreen
|
169
|
+
# ========================================================================= #
|
170
|
+
def self.lightseagreen(i = '', use_colours = @use_colours)
|
171
|
+
if use_colours
|
172
|
+
return ::Colours.lightseagreen(i)
|
173
|
+
end
|
174
|
+
return i
|
175
|
+
end
|
176
|
+
|
177
|
+
# ========================================================================= #
|
178
|
+
# === EnvironmentInformation.steelblue
|
179
|
+
# ========================================================================= #
|
180
|
+
def self.steelblue(i = '')
|
181
|
+
if @use_colours
|
182
|
+
return ::Colours.steelblue(i)
|
183
|
+
end
|
184
|
+
return i
|
185
|
+
end
|
186
|
+
|
187
|
+
# ========================================================================= #
|
188
|
+
# === EnvironmentInformation.royalblue
|
189
|
+
# ========================================================================= #
|
190
|
+
def self.royalblue(
|
191
|
+
i = '',
|
192
|
+
use_colours = @use_colours
|
193
|
+
)
|
194
|
+
if use_colours
|
195
|
+
return ::Colours.royalblue(i)
|
196
|
+
end
|
197
|
+
return i
|
198
|
+
end
|
199
|
+
|
200
|
+
# ========================================================================= #
|
201
|
+
# === EnvironmentInformation.mediumaquamarine
|
202
|
+
# ========================================================================= #
|
203
|
+
def self.mediumaquamarine(
|
204
|
+
i = '',
|
205
|
+
use_colours = @use_colours
|
206
|
+
)
|
207
|
+
if use_colours
|
208
|
+
return ::Colours.mediumaquamarine(i)
|
209
|
+
end
|
210
|
+
return i
|
211
|
+
end
|
212
|
+
|
213
|
+
# ========================================================================= #
|
214
|
+
# === EnvironmentInformation.sfile
|
215
|
+
# ========================================================================= #
|
216
|
+
def self.sfile(i = '')
|
217
|
+
if @use_colours
|
218
|
+
::Colours.sfile(i)
|
219
|
+
else
|
220
|
+
i
|
221
|
+
end
|
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
|
@@ -0,0 +1,210 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/array_tracked_components.rb'
|
6
|
+
# EnvironmentInformation.is_this_program_included?
|
7
|
+
# =========================================================================== #
|
8
|
+
module EnvironmentInformation
|
9
|
+
|
10
|
+
# ========================================================================= #
|
11
|
+
# The following constant will also pull in yaml-support.
|
12
|
+
# ========================================================================= #
|
13
|
+
require 'environment_information/constants/file_constants.rb'
|
14
|
+
|
15
|
+
# ========================================================================= #
|
16
|
+
# === EnvironmentInformation::ARRAY_LFS_CORE_PROGRAMS
|
17
|
+
#
|
18
|
+
# All the LFS core programs are registered here in this Array.
|
19
|
+
# ========================================================================= #
|
20
|
+
ARRAY_LFS_CORE_PROGRAMS =
|
21
|
+
YAML.load_file(FILE_ARRAY_LFS_CORE_PROGRAMS)
|
22
|
+
|
23
|
+
# ========================================================================= #
|
24
|
+
# === EnvironmentInformation::ARRAY_XORG_COMPONENTS (xorg tag)
|
25
|
+
#
|
26
|
+
# All xorg-components will be collected here. Sort alphabetically, please,
|
27
|
+
# and keep the entries downcased.
|
28
|
+
#
|
29
|
+
# xf86dga is an xorg-component, but since as of October 2018 it has
|
30
|
+
# been removed and will no longer be checked - it seems to have been
|
31
|
+
# abandoned, more or less.
|
32
|
+
# ========================================================================= #
|
33
|
+
ARRAY_XORG_COMPONENTS = YAML.load_file(FILE_ARRAY_TRACKED_XORG_COMPONENTS)
|
34
|
+
|
35
|
+
# ========================================================================= #
|
36
|
+
# === EnvironmentInformation::ARRAY_TRACKED_PROGRAMS
|
37
|
+
#
|
38
|
+
# This Array keeps track of which programs are tracked by the
|
39
|
+
# EnvironmentInformation project. That listing will include ALL
|
40
|
+
# registered entries, with a corresponding entry under the
|
41
|
+
# directory individual_components/.
|
42
|
+
#
|
43
|
+
# All entries of this Array should be downcased.
|
44
|
+
#
|
45
|
+
# Keep this Array alphabetically sorted, please, even though this is
|
46
|
+
# not an absolute necessity; it just simplifies adding and removing
|
47
|
+
# entries in the long run.
|
48
|
+
#
|
49
|
+
# Since as of February 2020 this is maintained in a yaml file.
|
50
|
+
# ========================================================================= #
|
51
|
+
if File.exist? FILE_ARRAY_TRACKED_PROGRAMS
|
52
|
+
ARRAY_TRACKED_PROGRAMS = YAML.load_file(FILE_ARRAY_TRACKED_PROGRAMS)
|
53
|
+
else
|
54
|
+
puts 'No file could be found at '+FILE_ARRAY_TRACKED_PROGRAMS+'.'
|
55
|
+
ARRAY_TRACKED_PROGRAMS = [] # Default in this case.
|
56
|
+
end
|
57
|
+
|
58
|
+
# ========================================================================= #
|
59
|
+
# === EnvironmentInformation.array_tracked_programs
|
60
|
+
#
|
61
|
+
# This method will return all the programs that are currently
|
62
|
+
# tracked by the EnvironmentInformation project.
|
63
|
+
# ========================================================================= #
|
64
|
+
def self.array_tracked_programs
|
65
|
+
ARRAY_TRACKED_PROGRAMS
|
66
|
+
end
|
67
|
+
|
68
|
+
# ========================================================================= #
|
69
|
+
# === EnvironmentInformation::ARRAY_DEFAULT_PROGRAMS_ON_LINUX
|
70
|
+
#
|
71
|
+
# This Array keeps track of the default programs on a linux computer.
|
72
|
+
# ========================================================================= #
|
73
|
+
ARRAY_DEFAULT_PROGRAMS_ON_LINUX =
|
74
|
+
YAML.load_file(FILE_ARRAY_DEFAULT_PROGRAMS_ON_LINUX)
|
75
|
+
|
76
|
+
# ========================================================================= #
|
77
|
+
# === EnvironmentInformation::ARRAY_TRACKED_NON_PROGRAMS
|
78
|
+
#
|
79
|
+
# The entry rubygems_installation_directory depends on the executable
|
80
|
+
# called "gem", which is part of ruby.
|
81
|
+
#
|
82
|
+
# This Array has also been called "registered extra functionality" in
|
83
|
+
# the past. The entries here are special in one way or another.
|
84
|
+
# Usually these entries are NOT standalone-programs, which is
|
85
|
+
# why they are tracked separately.
|
86
|
+
# ========================================================================= #
|
87
|
+
ARRAY_TRACKED_NON_PROGRAMS =
|
88
|
+
load_file_array_tracked_non_programs
|
89
|
+
|
90
|
+
# ========================================================================= #
|
91
|
+
# === EnvironmentInformation::ARRAY_SCIENCE_CLUSTER (science tag)
|
92
|
+
#
|
93
|
+
# Science-specific applications are gathered in this array.
|
94
|
+
# ========================================================================= #
|
95
|
+
ARRAY_SCIENCE_CLUSTER =
|
96
|
+
YAML.load_file(FILE_ARRAY_SCIENCE_CLUSTER)
|
97
|
+
|
98
|
+
# ========================================================================= #
|
99
|
+
# === EnvironmentInformation.science_cluster?
|
100
|
+
# ========================================================================= #
|
101
|
+
def self.science_cluster?
|
102
|
+
ARRAY_SCIENCE_CLUSTER
|
103
|
+
end
|
104
|
+
|
105
|
+
# ========================================================================= #
|
106
|
+
# === EnvironmentInformation::ARRAY_LFS_TEMPORARY_PROGRAMS
|
107
|
+
#
|
108
|
+
# All programs that are temporary, e. g. for enabling the bootstrapping
|
109
|
+
# of the compiler, are stored in the following Array.
|
110
|
+
# ========================================================================= #
|
111
|
+
ARRAY_LFS_TEMPORARY_PROGRAMS = %i(
|
112
|
+
binutils
|
113
|
+
gcc
|
114
|
+
linux_API_headers
|
115
|
+
glibc
|
116
|
+
libstdc++
|
117
|
+
binutils
|
118
|
+
tcl
|
119
|
+
expect
|
120
|
+
dejagnu
|
121
|
+
m4
|
122
|
+
ncurse
|
123
|
+
bash
|
124
|
+
bison
|
125
|
+
bzip2
|
126
|
+
coreutils
|
127
|
+
diffutils
|
128
|
+
file
|
129
|
+
findutils
|
130
|
+
gawk
|
131
|
+
gettext
|
132
|
+
grep
|
133
|
+
gzip
|
134
|
+
make
|
135
|
+
patch
|
136
|
+
perl
|
137
|
+
python
|
138
|
+
sed
|
139
|
+
tar
|
140
|
+
texinfo
|
141
|
+
xz
|
142
|
+
)
|
143
|
+
|
144
|
+
# ========================================================================= #
|
145
|
+
# === EnvironmentInformation.tracked_programs?
|
146
|
+
#
|
147
|
+
# Simpler toplevel-method to find out which programs are registered
|
148
|
+
# within the EnvironmentInformation project.
|
149
|
+
# ========================================================================= #
|
150
|
+
def self.tracked_programs?
|
151
|
+
ARRAY_TRACKED_PROGRAMS
|
152
|
+
end
|
153
|
+
|
154
|
+
# ========================================================================= #
|
155
|
+
# === EnvironmentInformation.xorg_components?
|
156
|
+
# ========================================================================= #
|
157
|
+
def self.xorg_components?
|
158
|
+
ARRAY_XORG_COMPONENTS
|
159
|
+
end; self.instance_eval { alias return_all_xorg_components_as_array xorg_components? } # === EnvironmentInformation.return_all_xorg_components_as_array
|
160
|
+
self.instance_eval { alias return_all_xorg_components_as_array xorg_components? } # === EnvironmentInformation.return_all_xorg_components_as_array
|
161
|
+
|
162
|
+
# ========================================================================= #
|
163
|
+
# === EnvironmentInformation.tracked_non_programs?
|
164
|
+
#
|
165
|
+
# Simpler toplevel-method to find out which non-programs are registered
|
166
|
+
# within the EnvironmentInformation project.
|
167
|
+
# ========================================================================= #
|
168
|
+
def self.tracked_non_programs?
|
169
|
+
ARRAY_TRACKED_NON_PROGRAMS
|
170
|
+
end; self.instance_eval { alias registered_extra_functionality tracked_non_programs? } # === EnvironmentInformation.registered_extra_functionality
|
171
|
+
|
172
|
+
# ========================================================================= #
|
173
|
+
# === EnvironmentInformation.lfs_core_programs?
|
174
|
+
# ========================================================================= #
|
175
|
+
def self.lfs_core_programs?
|
176
|
+
ARRAY_LFS_CORE_PROGRAMS
|
177
|
+
end
|
178
|
+
|
179
|
+
# ========================================================================= #
|
180
|
+
# === EnvironmentInformation.is_this_program_included?
|
181
|
+
#
|
182
|
+
# This will include the two Arrays ARRAY_TRACKED_PROGRAMS and
|
183
|
+
# ARRAY_XORG_COMPONENTS, but it will NOT include ARRAY_TRACKED_NON_PROGRAMS.
|
184
|
+
# ========================================================================= #
|
185
|
+
def self.is_this_program_included?(i)
|
186
|
+
(
|
187
|
+
ARRAY_TRACKED_PROGRAMS +
|
188
|
+
ARRAY_XORG_COMPONENTS
|
189
|
+
).flatten.include? i.to_sym # Need a symbol.
|
190
|
+
end; self.instance_eval { alias is_this_a_registered_program? is_this_program_included? } # === ::EnvironmentInformation.is_this_a_registered_program?
|
191
|
+
|
192
|
+
# ========================================================================= #
|
193
|
+
# === EnvironmentInformation.is_this_component_included?
|
194
|
+
#
|
195
|
+
# This is a more extensive check than .is_this_program_included?()
|
196
|
+
# ========================================================================= #
|
197
|
+
def self.is_this_component_included?(i)
|
198
|
+
array = (
|
199
|
+
ARRAY_TRACKED_PROGRAMS +
|
200
|
+
ARRAY_XORG_COMPONENTS +
|
201
|
+
ARRAY_TRACKED_NON_PROGRAMS
|
202
|
+
)
|
203
|
+
array.flatten.include? i.to_sym # Need a Symbol as input.
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
if __FILE__ == $PROGRAM_NAME
|
209
|
+
pp EnvironmentInformation.lfs_core_programs?
|
210
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# This file will require the other .rb files in the environment/constants/
|
6
|
+
# subdirectory.
|
7
|
+
# =========================================================================== #
|
8
|
+
# require 'environment_information/constants/constants.rb'
|
9
|
+
# =========================================================================== #
|
10
|
+
require 'environment_information/constants/array_tracked_components.rb'
|
11
|
+
require 'environment_information/constants/encoding.rb'
|
12
|
+
require 'environment_information/constants/error_line.rb'
|
13
|
+
require 'environment_information/constants/file_constants.rb'
|
14
|
+
require 'environment_information/constants/misc.rb'
|
15
|
+
require 'environment_information/constants/namespace.rb'
|
16
|
+
require 'environment_information/constants/newline.rb'
|
17
|
+
require 'environment_information/constants/temp_directory.rb'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/encoding.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === EnvironmentInformation::UTF_ENCODING
|
11
|
+
#
|
12
|
+
# UTF-8 is the default encoding for the EnvironmentInformation namespace.
|
13
|
+
# ========================================================================= #
|
14
|
+
UTF_ENCODING = 'UTF-8'
|
15
|
+
|
16
|
+
# ========================================================================= #
|
17
|
+
# === EnvironmentInformation::MAIN_ENCODING
|
18
|
+
# ========================================================================= #
|
19
|
+
MAIN_ENCODING = UTF_ENCODING
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/error_line.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === ERROR_LINE
|
11
|
+
#
|
12
|
+
# The error line is the one that can be appended to system-related
|
13
|
+
# queries (e. g. via system()).
|
14
|
+
# ========================================================================= #
|
15
|
+
ERROR_LINE = '2>&1'
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/file_constants.rb'
|
6
|
+
# EnvironmentInformation.file_query_to_use_for_the_individual_components
|
7
|
+
# EnvironmentInformation.query_to_use_for_the_individual_components?
|
8
|
+
# =========================================================================== #
|
9
|
+
module EnvironmentInformation
|
10
|
+
|
11
|
+
require 'yaml'
|
12
|
+
require 'environment_information/project/project.rb'
|
13
|
+
|
14
|
+
# ========================================================================= #
|
15
|
+
# === @query_to_use_for_the_individual_components
|
16
|
+
# ========================================================================= #
|
17
|
+
@query_to_use_for_the_individual_components = nil
|
18
|
+
|
19
|
+
# ========================================================================= #
|
20
|
+
# === EnvironmentInformation::FILE_ARRAY_TRACKED_PROGRAMS
|
21
|
+
# ========================================================================= #
|
22
|
+
FILE_ARRAY_TRACKED_PROGRAMS =
|
23
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_tracked_programs.yml"
|
24
|
+
|
25
|
+
# ========================================================================= #
|
26
|
+
# === EnvironmentInformation::FILE_ARRAY_DEFAULT_PROGRAMS_ON_LINUX
|
27
|
+
# ========================================================================= #
|
28
|
+
FILE_ARRAY_DEFAULT_PROGRAMS_ON_LINUX =
|
29
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_default_programs_on_linux.yml"
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === EnvironmentInformation::FILE_ARRAY_TRACKED_NON_PROGRAMS
|
33
|
+
# ========================================================================= #
|
34
|
+
FILE_ARRAY_TRACKED_NON_PROGRAMS =
|
35
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_tracked_non_programs.yml"
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === EnvironmentInformation.load_file_array_tracked_non_programs
|
39
|
+
# ========================================================================= #
|
40
|
+
def self.load_file_array_tracked_non_programs(
|
41
|
+
i = FILE_ARRAY_TRACKED_NON_PROGRAMS
|
42
|
+
)
|
43
|
+
YAML.load_file(i)
|
44
|
+
end
|
45
|
+
|
46
|
+
# ========================================================================= #
|
47
|
+
# === EnvironmentInformation::FILE_ARRAY_TRACKED_XORG_COMPONENTS
|
48
|
+
# ========================================================================= #
|
49
|
+
FILE_ARRAY_TRACKED_XORG_COMPONENTS =
|
50
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_tracked_xorg_components.yml"
|
51
|
+
|
52
|
+
# ========================================================================= #
|
53
|
+
# === EnvironmentInformation::FILE_ARRAY_LFS_CORE_PROGRAMS
|
54
|
+
# ========================================================================= #
|
55
|
+
FILE_ARRAY_LFS_CORE_PROGRAMS =
|
56
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_lfs_core_programs.yml"
|
57
|
+
|
58
|
+
# ========================================================================= #
|
59
|
+
# === EnvironmentInformation::FILE_ARRAY_SCIENCE_CLUSTER
|
60
|
+
# ========================================================================= #
|
61
|
+
FILE_ARRAY_SCIENCE_CLUSTER =
|
62
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/array_science_cluster.yml"
|
63
|
+
|
64
|
+
# ========================================================================= #
|
65
|
+
# === EnvironmentInformation::FILE_QUERY_TO_USE_FOR_THE_INDIVIDUAL_COMPONENTS
|
66
|
+
# ========================================================================= #
|
67
|
+
FILE_QUERY_TO_USE_FOR_THE_INDIVIDUAL_COMPONENTS =
|
68
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/query_to_use_for_the_individual_components.yml"
|
69
|
+
|
70
|
+
# ========================================================================= #
|
71
|
+
# === EnvironmentInformation.file_query_to_use_for_the_individual_components
|
72
|
+
# ========================================================================= #
|
73
|
+
def self.file_query_to_use_for_the_individual_components
|
74
|
+
"#{PROJECT_BASE_DIRECTORY}yaml/query_to_use_for_the_individual_components.yml"
|
75
|
+
end
|
76
|
+
|
77
|
+
# ========================================================================= #
|
78
|
+
# === EnvironmentInformation.load_file_query_to_use_for_the_individual_components
|
79
|
+
# ========================================================================= #
|
80
|
+
def self.load_file_query_to_use_for_the_individual_components(
|
81
|
+
i = FILE_QUERY_TO_USE_FOR_THE_INDIVIDUAL_COMPONENTS
|
82
|
+
)
|
83
|
+
@query_to_use_for_the_individual_components = YAML.load_file(i)
|
84
|
+
return @query_to_use_for_the_individual_components
|
85
|
+
end; self.instance_eval { alias all_the_queries load_file_query_to_use_for_the_individual_components } # === EnvironmentInformation.all_the_queries
|
86
|
+
|
87
|
+
# ========================================================================= #
|
88
|
+
# === EnvironmentInformation.query_to_use_for_the_individual_components?
|
89
|
+
# ========================================================================= #
|
90
|
+
def self.query_to_use_for_the_individual_components?
|
91
|
+
@query_to_use_for_the_individual_components
|
92
|
+
end
|
93
|
+
|
94
|
+
# ========================================================================= #
|
95
|
+
# === FILE_THESE_PROGRAMS_CAN_BE_UPGRADED
|
96
|
+
#
|
97
|
+
# We may store which programs could be upgraded into a local file.
|
98
|
+
# ========================================================================= #
|
99
|
+
FILE_THESE_PROGRAMS_CAN_BE_UPGRADED =
|
100
|
+
'these_programs_can_be_upgraded.yml'
|
101
|
+
|
102
|
+
end
|