environment_information 1.4.89
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 +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,283 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# require 'environment_information/class/colours.rb'
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
|
12
|
+
|
|
13
|
+
require 'environment_information/colours/colours.rb'
|
|
14
|
+
require 'environment_information/class/constants.rb'
|
|
15
|
+
|
|
16
|
+
# ========================================================================= #
|
|
17
|
+
# === colourize_this_in_the_right_side_colour
|
|
18
|
+
# ========================================================================= #
|
|
19
|
+
def colourize_this_in_the_right_side_colour(i)
|
|
20
|
+
if use_colours?
|
|
21
|
+
::Colours.send(::EnvironmentInformation.colour_for_the_right_side, i)
|
|
22
|
+
else
|
|
23
|
+
i
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# ========================================================================= #
|
|
28
|
+
# === set_use_colours
|
|
29
|
+
# ========================================================================= #
|
|
30
|
+
def set_use_colours(i = '')
|
|
31
|
+
::EnvironmentInformation.set_use_colours(true)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# ========================================================================= #
|
|
35
|
+
# === use_colours?
|
|
36
|
+
# ========================================================================= #
|
|
37
|
+
def use_colours?
|
|
38
|
+
::EnvironmentInformation.use_colours?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# ========================================================================= #
|
|
42
|
+
# === enable_colours
|
|
43
|
+
# ========================================================================= #
|
|
44
|
+
def enable_colours
|
|
45
|
+
::EnvironmentInformation.use_colours = true
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# ========================================================================= #
|
|
49
|
+
# === disable_colours
|
|
50
|
+
#
|
|
51
|
+
# Call this method when you wish to disable the colours. Note that
|
|
52
|
+
# this will disable colours on the toplevel.
|
|
53
|
+
# ========================================================================= #
|
|
54
|
+
def disable_colours
|
|
55
|
+
::EnvironmentInformation.use_colours = false
|
|
56
|
+
end; alias no_colours disable_colours # === no_colours()
|
|
57
|
+
|
|
58
|
+
# ========================================================================= #
|
|
59
|
+
# === rev
|
|
60
|
+
# ========================================================================= #
|
|
61
|
+
def rev
|
|
62
|
+
if use_colours?
|
|
63
|
+
Colours::GREEN
|
|
64
|
+
else
|
|
65
|
+
''
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# ========================================================================= #
|
|
70
|
+
# === true_rev
|
|
71
|
+
# ========================================================================= #
|
|
72
|
+
def true_rev
|
|
73
|
+
if use_colours?
|
|
74
|
+
Colours::REV
|
|
75
|
+
else
|
|
76
|
+
''
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# ========================================================================= #
|
|
81
|
+
# === col1
|
|
82
|
+
#
|
|
83
|
+
# The "first" colour to be used.
|
|
84
|
+
# ========================================================================= #
|
|
85
|
+
def col1
|
|
86
|
+
if use_colours?
|
|
87
|
+
Colours::BOLD_BLUE
|
|
88
|
+
else
|
|
89
|
+
''
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# ========================================================================= #
|
|
94
|
+
# === cyan
|
|
95
|
+
# ========================================================================= #
|
|
96
|
+
def cyan(i = '')
|
|
97
|
+
if i.empty?
|
|
98
|
+
Colours::CYAN
|
|
99
|
+
end if use_colours?
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# ========================================================================= #
|
|
103
|
+
# === blue
|
|
104
|
+
# ========================================================================= #
|
|
105
|
+
def blue(i = '')
|
|
106
|
+
if i.empty?
|
|
107
|
+
Colours::BLUE
|
|
108
|
+
end if use_colours?
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# ========================================================================= #
|
|
112
|
+
# === simp
|
|
113
|
+
# ========================================================================= #
|
|
114
|
+
def simp(i)
|
|
115
|
+
return ::Colours.simp(i) if use_colours?
|
|
116
|
+
return i
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# ========================================================================= #
|
|
120
|
+
# === sfile
|
|
121
|
+
# ========================================================================= #
|
|
122
|
+
def sfile(i)
|
|
123
|
+
return ::Colours.sfile(i) if use_colours?
|
|
124
|
+
return i
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# ========================================================================= #
|
|
128
|
+
# === sfancy
|
|
129
|
+
# ========================================================================= #
|
|
130
|
+
def sfancy(i = '')
|
|
131
|
+
return ::Colours.sfancy(i) if use_colours?
|
|
132
|
+
return i
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# ========================================================================= #
|
|
136
|
+
# === crimson
|
|
137
|
+
# ========================================================================= #
|
|
138
|
+
def crimson(i = '')
|
|
139
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
140
|
+
i = ::Colours.crimson(i)
|
|
141
|
+
end
|
|
142
|
+
return i
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# ========================================================================= #
|
|
146
|
+
# === darkgreen
|
|
147
|
+
# ========================================================================= #
|
|
148
|
+
def darkgreen(i = '')
|
|
149
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
150
|
+
i = ::Colours.darkgreen(i)
|
|
151
|
+
end
|
|
152
|
+
return i
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# ========================================================================= #
|
|
156
|
+
# === dimgray
|
|
157
|
+
# ========================================================================= #
|
|
158
|
+
def dimgray(i = '')
|
|
159
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
160
|
+
i = ::Colours.dimgray(i)
|
|
161
|
+
end
|
|
162
|
+
return i
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# ========================================================================= #
|
|
166
|
+
# === royalblue
|
|
167
|
+
# ========================================================================= #
|
|
168
|
+
def royalblue(i = '')
|
|
169
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
170
|
+
i = ::Colours.royalblue(i)
|
|
171
|
+
end
|
|
172
|
+
return i
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# ========================================================================= #
|
|
176
|
+
# === slateblue
|
|
177
|
+
# ========================================================================= #
|
|
178
|
+
def slateblue(i = '')
|
|
179
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
180
|
+
i = ::Colours.slateblue(i)
|
|
181
|
+
end
|
|
182
|
+
return i
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# ========================================================================= #
|
|
186
|
+
# === steelblue
|
|
187
|
+
# ========================================================================= #
|
|
188
|
+
def steelblue(i = '')
|
|
189
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
190
|
+
i = ::Colours.steelblue(i)
|
|
191
|
+
end
|
|
192
|
+
return i
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# ========================================================================= #
|
|
196
|
+
# === seagreen
|
|
197
|
+
# ========================================================================= #
|
|
198
|
+
def seagreen(i = '')
|
|
199
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
200
|
+
i = ::Colours.seagreen(i)
|
|
201
|
+
end
|
|
202
|
+
return i
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# ========================================================================= #
|
|
206
|
+
# === olivedrab
|
|
207
|
+
#
|
|
208
|
+
# This one will be used for the right-hand side.
|
|
209
|
+
# ========================================================================= #
|
|
210
|
+
def olivedrab(i = '')
|
|
211
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
212
|
+
i = ::Colours.olivedrab(i)
|
|
213
|
+
end
|
|
214
|
+
return i
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# ========================================================================= #
|
|
218
|
+
# === olive
|
|
219
|
+
# ========================================================================= #
|
|
220
|
+
def olive(i = '')
|
|
221
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
222
|
+
i = ::Colours.olive(i)
|
|
223
|
+
end
|
|
224
|
+
return i
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# ========================================================================= #
|
|
228
|
+
# === limegreen
|
|
229
|
+
# ========================================================================= #
|
|
230
|
+
def limegreen(i = '')
|
|
231
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
232
|
+
i = ::Colours.limegreen(i)
|
|
233
|
+
end
|
|
234
|
+
return i
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# ========================================================================= #
|
|
238
|
+
# === darkolivegreen
|
|
239
|
+
# ========================================================================= #
|
|
240
|
+
def darkolivegreen(i = '')
|
|
241
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
242
|
+
i = ::Colours.darkolivegreen(i)
|
|
243
|
+
end
|
|
244
|
+
return i
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# ========================================================================= #
|
|
248
|
+
# === lightgreen
|
|
249
|
+
# ========================================================================= #
|
|
250
|
+
def lightgreen(i = '')
|
|
251
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
252
|
+
i = ::Colours.lightgreen(i)
|
|
253
|
+
end
|
|
254
|
+
return i
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# ========================================================================= #
|
|
258
|
+
# === mediumpurple
|
|
259
|
+
# ========================================================================= #
|
|
260
|
+
def mediumpurple(i = '')
|
|
261
|
+
if use_colours? and TRY_TO_USE_HTML_COLOURS
|
|
262
|
+
i = ::Colours.mediumpurple(i)
|
|
263
|
+
end
|
|
264
|
+
return i
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# ========================================================================= #
|
|
268
|
+
# === teal
|
|
269
|
+
# ========================================================================= #
|
|
270
|
+
def teal(i = '')
|
|
271
|
+
return ::Colours.teal(i) if use_colours?
|
|
272
|
+
return i
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# ========================================================================= #
|
|
276
|
+
# === orange
|
|
277
|
+
# ========================================================================= #
|
|
278
|
+
def orange(i = '')
|
|
279
|
+
return ::Colours.orange(i) if use_colours?
|
|
280
|
+
return i
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end; end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# require 'environment_information/class/constants.rb'
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
|
12
|
+
|
|
13
|
+
# ========================================================================= #
|
|
14
|
+
# === EnvironmentInformation::EnvironmentInformation::THIS_FILE
|
|
15
|
+
#
|
|
16
|
+
# THIS_FILE = __FILE__
|
|
17
|
+
#
|
|
18
|
+
# We hardcode this since it is only relevant on my home system, anyway.
|
|
19
|
+
# ========================================================================= #
|
|
20
|
+
THIS_FILE =
|
|
21
|
+
'/home/x/programming/ruby/src/'\
|
|
22
|
+
'environment_information/lib/environment_information/class/'\
|
|
23
|
+
'environment_information.rb'
|
|
24
|
+
|
|
25
|
+
# ========================================================================= #
|
|
26
|
+
# === EnvironmentInformation::EnvironmentInformation::TRY_TO_USE_HTML_COLOURS
|
|
27
|
+
#
|
|
28
|
+
# If true then we will try to use the konsole-colours, when possible.
|
|
29
|
+
#
|
|
30
|
+
# These are part of the colours gem, so this adds a dependency on the
|
|
31
|
+
# colours gem.
|
|
32
|
+
# ========================================================================= #
|
|
33
|
+
TRY_TO_USE_HTML_COLOURS = true
|
|
34
|
+
|
|
35
|
+
end; end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# === EnvironmentInformation::EnvironmentInformation
|
|
6
|
+
#
|
|
7
|
+
# Usage example:
|
|
8
|
+
#
|
|
9
|
+
# EnvironmentInformation.new
|
|
10
|
+
#
|
|
11
|
+
# =========================================================================== #
|
|
12
|
+
# require 'environment_information/class/environment_information.rb'
|
|
13
|
+
# =========================================================================== #
|
|
14
|
+
require 'environment_information/base/base.rb'
|
|
15
|
+
|
|
16
|
+
module EnvironmentInformation
|
|
17
|
+
|
|
18
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
|
19
|
+
|
|
20
|
+
require 'environment_information/class/initialize.rb'
|
|
21
|
+
require 'environment_information/class/menu.rb'
|
|
22
|
+
require 'environment_information/class/register_sigint.rb'
|
|
23
|
+
require 'environment_information/class/reset.rb'
|
|
24
|
+
require 'environment_information/class/run.rb'
|
|
25
|
+
require 'environment_information/colours/colours.rb'
|
|
26
|
+
require 'environment_information/queries/complex_version.rb'
|
|
27
|
+
require 'environment_information/queries/pkg_config.rb'
|
|
28
|
+
require 'environment_information/queries/simple_version.rb'
|
|
29
|
+
require 'environment_information/toplevel_methods/hash.rb'
|
|
30
|
+
require 'environment_information/toplevel_methods/misc.rb'
|
|
31
|
+
require 'environment_information/toplevel_methods/return_pkgconfig_based_programs.rb'
|
|
32
|
+
require 'environment_information/toplevel_methods/return_simple_version_based_programs'
|
|
33
|
+
|
|
34
|
+
begin
|
|
35
|
+
require 'rbt/utility_scripts/report_mate_desktop_version.rb'
|
|
36
|
+
rescue LoadError; end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# =========================================================================== #
|
|
41
|
+
# === EnvironmentInformation.run
|
|
42
|
+
# =========================================================================== #
|
|
43
|
+
def self.run(i = ARGV)
|
|
44
|
+
::EnvironmentInformation::EnvironmentInformation.new(i)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
if __FILE__ == $PROGRAM_NAME
|
|
50
|
+
EnvironmentInformation::EnvironmentInformation.new(ARGV)
|
|
51
|
+
end # environment_information.rb
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# require 'environment_information/class/help.rb'
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
|
12
|
+
|
|
13
|
+
require 'environment_information/requires/require_asciitable.rb'
|
|
14
|
+
|
|
15
|
+
# ========================================================================= #
|
|
16
|
+
# === do_show_help (help tag)
|
|
17
|
+
#
|
|
18
|
+
# Show the commandline-usage through this method here.
|
|
19
|
+
#
|
|
20
|
+
# To invoke this, try:
|
|
21
|
+
#
|
|
22
|
+
# envi --help
|
|
23
|
+
#
|
|
24
|
+
# ========================================================================= #
|
|
25
|
+
def do_show_help
|
|
26
|
+
e
|
|
27
|
+
lpad = "#{col1} "
|
|
28
|
+
e "#{rev}The following options are available for "\
|
|
29
|
+
"#{simp('class EnvironmentInformation:')}#{rev}#{N}#{N}"
|
|
30
|
+
if ASCIITABLE_IS_AVAILABLE
|
|
31
|
+
e col1+' asciitable '+rev+'# Print in Ascii Table format'
|
|
32
|
+
end
|
|
33
|
+
e lpad+'html '+rev+'# Save the environment information '\
|
|
34
|
+
'into a .html file'
|
|
35
|
+
e lpad+'gui '+rev+'# Start the GTK gui bindings; some '\
|
|
36
|
+
'aliases are possible such as --GUI'
|
|
37
|
+
e lpad+'nocolours '+rev+'# Disable colours '\
|
|
38
|
+
'(--disable-colours also works)'
|
|
39
|
+
e lpad+'noruby '+rev+'# dont show ruby-related environment '\
|
|
40
|
+
'information'
|
|
41
|
+
e lpad+'help '+rev+'# show some help'
|
|
42
|
+
e lpad+'xorg '+rev+'# show some xorg-specific '\
|
|
43
|
+
'components (also --xorg-components)'
|
|
44
|
+
e lpad+'OS '+rev+'# show the OS then exit'
|
|
45
|
+
e lpad+'full '+rev+'# show full information, including '\
|
|
46
|
+
'GTK, Glib, Atk and Pango Version'
|
|
47
|
+
e ' # ^^^ This is probably the most useful usage.'
|
|
48
|
+
e lpad+'openssl '+rev+'# display openssl option'
|
|
49
|
+
e lpad+'REALLY_ALL '+rev+'# also compare the program_versions '\
|
|
50
|
+
'(--really-everything is an alias to this)'
|
|
51
|
+
e lpad+'save '+rev+'# display the result, then '\
|
|
52
|
+
'save it into a file'
|
|
53
|
+
e lpad+'sinatra '+rev+'# start the sinatra-interface '\
|
|
54
|
+
'of the environment_information project'
|
|
55
|
+
e lpad+'version '+rev+'# show the version of '\
|
|
56
|
+
'EnvironmentInformation in use'
|
|
57
|
+
e lpad+'--show-remote-url '+rev+'# show the remote URLs '\
|
|
58
|
+
'of a program (requires the RBT project)'
|
|
59
|
+
e lpad+'padding=value '+rev+'# set to another padding value'
|
|
60
|
+
e lpad+'--one-liner '+rev+'# show everything compacted, without a newline'
|
|
61
|
+
e lpad+'--nentries? '+rev+'# feedback how many entries are tracked in total'
|
|
62
|
+
e rev+N+'The above commands should be commandline arguments, '\
|
|
63
|
+
'such as: "'+teal('envi full')+rev+'".'
|
|
64
|
+
e
|
|
65
|
+
e "#{rev}Do note that you can prefix the above commands via "\
|
|
66
|
+
"a leading --, of course."
|
|
67
|
+
e
|
|
68
|
+
# ======================================================================= #
|
|
69
|
+
# Show a simple usage example next:
|
|
70
|
+
# ======================================================================= #
|
|
71
|
+
e 'Usage example:'
|
|
72
|
+
e
|
|
73
|
+
e steelblue(
|
|
74
|
+
' envi --version'
|
|
75
|
+
)
|
|
76
|
+
e
|
|
77
|
+
e rev+'If you wish to show only some programs, you could '\
|
|
78
|
+
'use the following:'
|
|
79
|
+
e
|
|
80
|
+
e steelblue(
|
|
81
|
+
' envi --use-these-programs=bash,binutils,bison,yacc,bzip2,coreutils,diff,find,gawk,gcc'
|
|
82
|
+
)
|
|
83
|
+
e steelblue(
|
|
84
|
+
' envi --use-these-programs=:lfs'
|
|
85
|
+
)
|
|
86
|
+
e true_rev # Reset via Colours.rev here.
|
|
87
|
+
do_exit_the_program
|
|
88
|
+
end; alias show_help do_show_help # === show_help
|
|
89
|
+
|
|
90
|
+
end; end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# require 'environment_information/class/html.rb'
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
|
|
12
|
+
|
|
13
|
+
require 'environment_information/class/opn.rb'
|
|
14
|
+
require 'environment_information/toplevel_methods/write_what_into.rb'
|
|
15
|
+
require 'environment_information/constants/temp_directory.rb'
|
|
16
|
+
|
|
17
|
+
# ========================================================================= #
|
|
18
|
+
# === do_generate_a_html_file (html tag)
|
|
19
|
+
#
|
|
20
|
+
# The action-method that will generate the html file. This depends
|
|
21
|
+
# on the gem html_tags, with module HtmlTags though.
|
|
22
|
+
#
|
|
23
|
+
# To invoke this method, do:
|
|
24
|
+
#
|
|
25
|
+
# envi --generate-html-file
|
|
26
|
+
#
|
|
27
|
+
# ========================================================================= #
|
|
28
|
+
def do_generate_a_html_file(
|
|
29
|
+
styling_instructions = :none
|
|
30
|
+
)
|
|
31
|
+
# ======================================================================= #
|
|
32
|
+
# === Ensure that the html_tags project is available
|
|
33
|
+
# ======================================================================= #
|
|
34
|
+
unless Object.const_defined? :HtmlTags
|
|
35
|
+
begin
|
|
36
|
+
require 'html_tags'
|
|
37
|
+
rescue LoadError
|
|
38
|
+
e 'html_tags is not available. Considering installing it via:'
|
|
39
|
+
e
|
|
40
|
+
e ' gem install html_tags'
|
|
41
|
+
e
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
# ======================================================================= #
|
|
45
|
+
# === Define where to store the .html file in question
|
|
46
|
+
# ======================================================================= #
|
|
47
|
+
this_html_file = "#{::EnvironmentInformation.temp_directory?}environment_information.html"
|
|
48
|
+
# ======================================================================= #
|
|
49
|
+
# Obtain the main dataset next.
|
|
50
|
+
# ======================================================================= #
|
|
51
|
+
what = dataset_as_string
|
|
52
|
+
case styling_instructions
|
|
53
|
+
when :bold
|
|
54
|
+
what = HtmlTags.b(what)
|
|
55
|
+
end
|
|
56
|
+
what = HtmlTags.html(
|
|
57
|
+
HtmlTags.title('Information about the local environment')+
|
|
58
|
+
HtmlTags.body(
|
|
59
|
+
HtmlTags.h1(
|
|
60
|
+
'Your environment',
|
|
61
|
+
css_style: 'margin-top: 0.5em; margin-bottom: 0.5em; padding: 2px;'
|
|
62
|
+
)+
|
|
63
|
+
HtmlTags.pre(
|
|
64
|
+
what,
|
|
65
|
+
css_style: 'font-weight: bold; font-size: 2em; padding-left: 1.0em; margin-top:2px;'
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
::EnvironmentInformation.write_what_into(what, this_html_file)
|
|
70
|
+
# ======================================================================= #
|
|
71
|
+
# Notify the user what has been done.
|
|
72
|
+
# ======================================================================= #
|
|
73
|
+
if File.exist? this_html_file
|
|
74
|
+
opnn; e "Generated a HTML file at `#{sfile(this_html_file)}`."
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end; end
|