environment_information 1.4.89
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of environment_information might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +1276 -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 +159 -0
- data/lib/environment_information/class/add.rb +187 -0
- data/lib/environment_information/class/colours.rb +283 -0
- data/lib/environment_information/class/constants.rb +35 -0
- data/lib/environment_information/class/environment_information.rb +51 -0
- data/lib/environment_information/class/help.rb +90 -0
- data/lib/environment_information/class/html.rb +78 -0
- data/lib/environment_information/class/initialize.rb +177 -0
- data/lib/environment_information/class/menu.rb +465 -0
- data/lib/environment_information/class/misc.rb +897 -0
- data/lib/environment_information/class/opn.rb +33 -0
- data/lib/environment_information/class/register_sigint.rb +20 -0
- data/lib/environment_information/class/reset.rb +217 -0
- data/lib/environment_information/class/ruby.rb +79 -0
- data/lib/environment_information/class/run.rb +61 -0
- data/lib/environment_information/class/show_display_and_report.rb +355 -0
- data/lib/environment_information/colours/colours.rb +211 -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 +272 -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 +309 -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 +207 -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 +256 -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 +191 -0
@@ -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
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/misc.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
require 'environment_information/constants/encoding.rb'
|
10
|
+
require 'environment_information/constants/temp_directory.rb'
|
11
|
+
|
12
|
+
# ========================================================================= #
|
13
|
+
# === EnvironmentInformation::NOT_INSTALLED_OR_NOT_FOUND
|
14
|
+
# ========================================================================= #
|
15
|
+
NOT_INSTALLED_OR_NOT_FOUND = '[Not installed or not found.]'
|
16
|
+
|
17
|
+
# ========================================================================= #
|
18
|
+
# === EnvironmentInformation::COMMAND_NOT_FOUND
|
19
|
+
# ========================================================================= #
|
20
|
+
COMMAND_NOT_FOUND = 'command not found'
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === EnvironmentInformation::NOT_FOUND
|
24
|
+
# ========================================================================= #
|
25
|
+
NOT_FOUND = 'not found'
|
26
|
+
|
27
|
+
# ========================================================================= #
|
28
|
+
# === EnvironmentInformation::VERSION_STRING
|
29
|
+
# ========================================================================= #
|
30
|
+
VERSION_STRING = 'version'
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === EnvironmentInformation::NOT_FOUND_IN_PKG_CONFIG_SEARCH_PATH
|
34
|
+
#
|
35
|
+
# This constant is specifically for missing (or not found) .pc
|
36
|
+
# files.
|
37
|
+
# ========================================================================= #
|
38
|
+
NOT_FOUND_IN_PKG_CONFIG_SEARCH_PATH =
|
39
|
+
'as not found in the pkg-config search path'
|
40
|
+
|
41
|
+
# ========================================================================= #
|
42
|
+
# === EnvironmentInformation::THE_PROGRAM_WAS_NOT_FOUND
|
43
|
+
# ========================================================================= #
|
44
|
+
THE_PROGRAM_WAS_NOT_FOUND =
|
45
|
+
'[The program was not found.]'
|
46
|
+
|
47
|
+
# ========================================================================= #
|
48
|
+
# === EnvironmentInformation::PKGCONFIG_COMMAND_NOT_FOUND
|
49
|
+
#
|
50
|
+
# The constant that follows next is used to determine whether
|
51
|
+
# pkg-config could find a corresponding .pc file. If not then
|
52
|
+
# pkg-config will typically report a line such as this:
|
53
|
+
#
|
54
|
+
# Package libdr was not found in the pkg-config search path.
|
55
|
+
#
|
56
|
+
# We will include the last part of this string, as a generic
|
57
|
+
# message that can be used to indicate "this package could
|
58
|
+
# not be found on the given computer system at hand".
|
59
|
+
# ========================================================================= #
|
60
|
+
PKGCONFIG_COMMAND_NOT_FOUND =
|
61
|
+
' was not found in the pkg-config search path.'
|
62
|
+
|
63
|
+
# ========================================================================= #
|
64
|
+
# === EnvironmentInformation::NO_SUCH_FILE_OR_DIRECTORY
|
65
|
+
# ========================================================================= #
|
66
|
+
NO_SUCH_FILE_OR_DIRECTORY =
|
67
|
+
'No such file or directory'
|
68
|
+
|
69
|
+
# ========================================================================= #
|
70
|
+
# === TRY_TO_MAKE_USE_OF_THE_OPN_GEM_IF_IT_IS_AVAILABLE
|
71
|
+
#
|
72
|
+
# This gem is closely connected to the NAMESPACE constant, so it
|
73
|
+
# will also reside in this file here.
|
74
|
+
# ========================================================================= #
|
75
|
+
TRY_TO_MAKE_USE_OF_THE_OPN_GEM_IF_IT_IS_AVAILABLE = true
|
76
|
+
|
77
|
+
# ========================================================================= #
|
78
|
+
# === EnvironmentInformation::SAVE_FILE
|
79
|
+
#
|
80
|
+
# Where to save stuff to. This depends on a proper setting of the
|
81
|
+
# toplevel variable called @temp_directory.
|
82
|
+
# ========================================================================= #
|
83
|
+
SAVE_FILE =
|
84
|
+
"#{@temp_directory}EnvironmentInformation.md"
|
85
|
+
|
86
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/namespace.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === NAMESPACE
|
11
|
+
# ========================================================================= #
|
12
|
+
NAMESPACE = inspect
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/newline.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === EnvironmentInformation::N
|
11
|
+
#
|
12
|
+
# A newline constant to simplify our life.
|
13
|
+
# ========================================================================= #
|
14
|
+
N = "\n"
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# All regexes that relate to EnvironmentInformation project should be
|
6
|
+
# stored in this file here.
|
7
|
+
# =========================================================================== #
|
8
|
+
# require 'environment_information/constants/regex.rb'
|
9
|
+
# =========================================================================== #
|
10
|
+
module EnvironmentInformation
|
11
|
+
|
12
|
+
# ========================================================================= #
|
13
|
+
# === EnvironmentInformation::ARRAY_VERSION
|
14
|
+
# ========================================================================= #
|
15
|
+
ARRAY_VERSION = [
|
16
|
+
/^-?-?version\??$/i
|
17
|
+
]
|
18
|
+
|
19
|
+
# ========================================================================= #
|
20
|
+
# === EnvironmentInformation::ARRAY_COMPARE_PROGRAM_VERSIONS
|
21
|
+
# ========================================================================= #
|
22
|
+
ARRAY_COMPARE_PROGRAM_VERSIONS = [
|
23
|
+
/^-?-?compare(-|_)?to(-|_)?program(-|_)?versions$/i,
|
24
|
+
/^-?-?compare(-|_)?program(-|_)?versions$/i,
|
25
|
+
/^-?-?compare(-|_)?programs$/i,
|
26
|
+
/^-?-?compare$/i,
|
27
|
+
/^-?-?compare(-|_)?version$/i
|
28
|
+
]
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# require 'environment_information/constants/temp_directory.rb'
|
6
|
+
# =========================================================================== #
|
7
|
+
module EnvironmentInformation
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === EnvironmentInformation::TEMP_DIRECTORY
|
11
|
+
#
|
12
|
+
# This constant denotes into which directory files should be stored,
|
13
|
+
# e. g. autogenerated files from the EnvironmentInformation project.
|
14
|
+
#
|
15
|
+
# This constant MUST have a trailing '/' character.
|
16
|
+
#
|
17
|
+
# The environment variable called MY_TEMP_DIR can overrule all
|
18
|
+
# other guesses made here, but it is not always available,
|
19
|
+
# e. g. in a .cgi file such an environment variable may not
|
20
|
+
# be available.
|
21
|
+
# ========================================================================= #
|
22
|
+
if ENV.has_key? 'MY_TEMP_DIR'
|
23
|
+
TEMP_DIRECTORY = ENV['MY_TEMP_DIR'].to_s
|
24
|
+
elsif File.directory? '/home/Temp/' # ← My main directory.
|
25
|
+
TEMP_DIRECTORY = '/home/Temp/'
|
26
|
+
elsif File.directory? '/Depot/Temp/'
|
27
|
+
TEMP_DIRECTORY = '/Depot/Temp/'
|
28
|
+
else
|
29
|
+
TEMP_DIRECTORY = '/tmp/' # ← "Rescue" for most other users on linux.
|
30
|
+
end
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === @temp_directory
|
34
|
+
# ========================================================================= #
|
35
|
+
@temp_directory = TEMP_DIRECTORY
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === EnvironmentInformation.temp_directory?
|
39
|
+
#
|
40
|
+
# This method will refer to the temp-directory in use for this project.
|
41
|
+
#
|
42
|
+
# It is advised to make use of the method, rather than the
|
43
|
+
# TEMP_DIRECTORY constant, as that is more convenient in the
|
44
|
+
# long run.
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.temp_directory?(
|
47
|
+
i = @temp_directory
|
48
|
+
)
|
49
|
+
i.squeeze('/').dup
|
50
|
+
end; self.instance_eval { alias temp_dir? temp_directory? } # === EnvironmentInformation.temp_dir?
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation
|
6
|
+
# =========================================================================== #
|
7
|
+
# require 'environment_information/gui/gtk2/environment_information.rb'
|
8
|
+
# EnvironmentInformation::EnvironmentInformation::GUI::GtkE::nvironmentInformation.run
|
9
|
+
# EnvironmentInformation.run_gtk
|
10
|
+
# =========================================================================== #
|
11
|
+
begin # Pull in the gtk_paradise project next.
|
12
|
+
require 'gtk_paradise/require_gtk2'
|
13
|
+
rescue LoadError; end
|
14
|
+
|
15
|
+
module EnvironmentInformation
|
16
|
+
|
17
|
+
require 'environment_information/base/base.rb'
|
18
|
+
require 'environment_information/requires/require_the_environment_information_project.rb'
|
19
|
+
|
20
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
21
|
+
|
22
|
+
module GUI
|
23
|
+
|
24
|
+
module Gtk
|
25
|
+
|
26
|
+
class EnvironmentInformation < ::Gtk::VBox
|
27
|
+
|
28
|
+
require 'environment_information/gui/shared_code/binding_module.rb'
|
29
|
+
include ::EnvironmentInformation::EnvironmentInformation::GUI::Gtk::BindingModule
|
30
|
+
|
31
|
+
end; end; end; end; end
|
32
|
+
|
33
|
+
if __FILE__ == $PROGRAM_NAME
|
34
|
+
EnvironmentInformation.run_gtk
|
35
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation
|
6
|
+
# =========================================================================== #
|
7
|
+
# require 'environment_information/gui/gtk3/environment_information.rb'
|
8
|
+
# EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation.run
|
9
|
+
# =========================================================================== #
|
10
|
+
begin # Pull in the gtk_paradise project next.
|
11
|
+
require 'gtk_paradise/require_gtk3'
|
12
|
+
rescue LoadError; end
|
13
|
+
|
14
|
+
module EnvironmentInformation
|
15
|
+
|
16
|
+
require 'environment_information/base/base.rb'
|
17
|
+
require 'environment_information/requires/require_the_environment_information_project.rb'
|
18
|
+
|
19
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
20
|
+
|
21
|
+
module GUI
|
22
|
+
|
23
|
+
module Gtk
|
24
|
+
|
25
|
+
class EnvironmentInformation < ::Gtk::Box
|
26
|
+
|
27
|
+
require 'environment_information/gui/shared_code/environment_information_module.rb'
|
28
|
+
include ::EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformationModule
|
29
|
+
|
30
|
+
end; end; end; end; end
|
31
|
+
|
32
|
+
if __FILE__ == $PROGRAM_NAME
|
33
|
+
EnvironmentInformation.run_gtk
|
34
|
+
end
|