environment_information 1.4.124 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +91 -15
- data/doc/README.gen +42 -14
- data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +16 -12
- data/lib/environment_information/base/base.rb +483 -99
- data/lib/environment_information/colours/colours.rb +92 -66
- data/lib/environment_information/commandline/commandline.rb +137 -0
- data/lib/environment_information/constants/constants.rb +372 -11
- data/lib/environment_information/project/project.rb +1 -1
- data/lib/environment_information/query/constants.rb +46 -0
- data/lib/environment_information/query/help.rb +88 -0
- data/lib/environment_information/query/menu.rb +487 -0
- data/lib/environment_information/query/misc.rb +2006 -0
- data/lib/environment_information/query/query.rb +245 -0
- data/lib/environment_information/query/reset.rb +202 -0
- data/lib/environment_information/query/run.rb +70 -0
- data/lib/environment_information/requires/require_the_environment_information_project.rb +2 -7
- data/lib/environment_information/requires/require_the_toplevel_methods.rb +1 -3
- data/lib/environment_information/toplevel_methods/toplevel_methods.rb +2258 -0
- data/lib/environment_information/version/version.rb +2 -2
- data/lib/environment_information/www/sinatra_interface.rb +20 -17
- data/lib/environment_information/www/webobject_interface.cgi +6 -7
- data/lib/environment_information/yaml/colours.yml +3 -3
- data/lib/environment_information/yaml/query_to_use_for_all_components.yml +284 -0
- data/lib/environment_information/yaml/{array_tracked_programs.yml → track_these_components.yml} +77 -11
- metadata +18 -60
- data/lib/environment_information/class/class.rb +0 -2580
- data/lib/environment_information/class/colours.rb +0 -282
- data/lib/environment_information/colours/sfancy.rb +0 -19
- data/lib/environment_information/colours/simp.rb +0 -19
- data/lib/environment_information/constants/array_tracked_components.rb +0 -210
- data/lib/environment_information/constants/encoding.rb +0 -21
- data/lib/environment_information/constants/error_line.rb +0 -17
- data/lib/environment_information/constants/file_constants.rb +0 -102
- data/lib/environment_information/constants/misc.rb +0 -86
- data/lib/environment_information/constants/namespace.rb +0 -14
- data/lib/environment_information/constants/newline.rb +0 -16
- data/lib/environment_information/constants/regex.rb +0 -30
- data/lib/environment_information/constants/temp_directory.rb +0 -52
- data/lib/environment_information/misc_components/README.md +0 -3
- data/lib/environment_information/misc_components/cflags.rb +0 -36
- data/lib/environment_information/misc_components/cpuinfo.rb +0 -64
- data/lib/environment_information/misc_components/operating_system.rb +0 -54
- data/lib/environment_information/misc_components/operating_system_bit_type.rb +0 -42
- data/lib/environment_information/misc_components/ram.rb +0 -30
- data/lib/environment_information/misc_components/rubygems_installation_directory.rb +0 -54
- data/lib/environment_information/misc_components/screen_resolution.rb +0 -50
- data/lib/environment_information/queries/README.md +0 -2
- data/lib/environment_information/queries/complex_version.rb +0 -273
- data/lib/environment_information/queries/pkg_config.rb +0 -125
- data/lib/environment_information/queries/simple_version.rb +0 -272
- data/lib/environment_information/requires/require_the_individual_misc_components.rb +0 -30
- data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +0 -153
- data/lib/environment_information/toplevel_methods/cd.rb +0 -16
- data/lib/environment_information/toplevel_methods/e.rb +0 -43
- data/lib/environment_information/toplevel_methods/hash.rb +0 -65
- data/lib/environment_information/toplevel_methods/internet_is_available.rb +0 -30
- data/lib/environment_information/toplevel_methods/is_on_roebe.rb +0 -16
- data/lib/environment_information/toplevel_methods/menu.rb +0 -90
- data/lib/environment_information/toplevel_methods/misc.rb +0 -324
- data/lib/environment_information/toplevel_methods/n_subcommands.rb +0 -31
- data/lib/environment_information/toplevel_methods/prefix_to_use.rb +0 -39
- data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +0 -61
- data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +0 -45
- data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +0 -84
- data/lib/environment_information/toplevel_methods/return_alias_to.rb +0 -30
- data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +0 -28
- data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +0 -54
- data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +0 -28
- data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +0 -182
- data/lib/environment_information/toplevel_methods/show_all_available_components.rb +0 -192
- data/lib/environment_information/toplevel_methods/write_what_into.rb +0 -24
- data/lib/environment_information/yaml/array_default_programs_on_linux.yml +0 -15
- data/lib/environment_information/yaml/array_lfs_core_programs.yml +0 -37
- data/lib/environment_information/yaml/array_science_cluster.yml +0 -12
- data/lib/environment_information/yaml/array_tracked_non_programs.yml +0 -13
- data/lib/environment_information/yaml/array_tracked_xorg_components.yml +0 -37
- data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +0 -284
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# ============================================================================ #
|
|
5
|
+
# === EnvironmentInformation::Query
|
|
6
|
+
#
|
|
7
|
+
# The primary purpose of this class is to provide information about
|
|
8
|
+
# the computer environment ruby is running on. Obviously ruby must
|
|
9
|
+
# be available on the target computer, in order for this class (this
|
|
10
|
+
# program) to work.
|
|
11
|
+
#
|
|
12
|
+
# By default, class EnvironmentInformation will run in
|
|
13
|
+
# "commandline mode", that is, it will output information
|
|
14
|
+
# onto the console/terminal.
|
|
15
|
+
#
|
|
16
|
+
# The dataset is of course also available internally, though, so you
|
|
17
|
+
# can query this information and display it e. g. in a traditional
|
|
18
|
+
# GUI or WWW setting, like for a webpage.
|
|
19
|
+
#
|
|
20
|
+
# Usage example:
|
|
21
|
+
#
|
|
22
|
+
# EnvironmentInformation::Query.new(ARGV)
|
|
23
|
+
#
|
|
24
|
+
# ============================================================================ #
|
|
25
|
+
# A complete usage example for the main class follows next:
|
|
26
|
+
#
|
|
27
|
+
# require 'environment_information'
|
|
28
|
+
#
|
|
29
|
+
# _ = EnvironmentInformation::EnvironmentInformation.new(:do_not_run_yet)
|
|
30
|
+
# _.disable_colours
|
|
31
|
+
# _.be_silent
|
|
32
|
+
# _.run
|
|
33
|
+
# _.string
|
|
34
|
+
#
|
|
35
|
+
# Another usage example:
|
|
36
|
+
#
|
|
37
|
+
# EnvironmentInformation.new('--kdeversions?')
|
|
38
|
+
#
|
|
39
|
+
# ============================================================================ #
|
|
40
|
+
# require 'environment_information/query/query.rb'
|
|
41
|
+
# ============================================================================ #
|
|
42
|
+
require 'environment_information/base/base.rb'
|
|
43
|
+
|
|
44
|
+
module EnvironmentInformation
|
|
45
|
+
|
|
46
|
+
class Query < ::EnvironmentInformation::Base # === EnvironmentInformation::Query
|
|
47
|
+
|
|
48
|
+
require 'colours/autogenerated/html_colours_methods.rb'
|
|
49
|
+
require 'environment_information/commandline/commandline.rb'
|
|
50
|
+
require 'environment_information/constants/constants.rb'
|
|
51
|
+
require 'environment_information/project/project.rb'
|
|
52
|
+
require 'environment_information/version/version.rb'
|
|
53
|
+
require 'environment_information/requires/require_asciitable.rb'
|
|
54
|
+
require 'environment_information/query/constants.rb'
|
|
55
|
+
require 'environment_information/query/help.rb'
|
|
56
|
+
require 'environment_information/query/menu.rb'
|
|
57
|
+
require 'environment_information/query/misc.rb'
|
|
58
|
+
require 'environment_information/query/reset.rb'
|
|
59
|
+
require 'environment_information/query/run.rb'
|
|
60
|
+
|
|
61
|
+
begin
|
|
62
|
+
require 'opn'
|
|
63
|
+
rescue LoadError; end
|
|
64
|
+
|
|
65
|
+
begin
|
|
66
|
+
require 'rbt/toplevel_methods/url.rb'
|
|
67
|
+
rescue LoadError
|
|
68
|
+
if ::EnvironmentInformation.is_on_roebe?
|
|
69
|
+
puts 'The file rbt/toplevel_methods/url.rb is not available.'
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
begin
|
|
74
|
+
require 'rbt/requires/swift_version.rb'
|
|
75
|
+
rescue LoadError
|
|
76
|
+
if ::EnvironmentInformation.is_on_roebe?
|
|
77
|
+
puts 'The file rbt/toplevel_methods/swift_return_version_of_this_program.rb is not available.'
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
begin
|
|
82
|
+
require 'rbt/actions/individual_actions/information/report_mate_desktop_version.rb'
|
|
83
|
+
rescue LoadError; end
|
|
84
|
+
|
|
85
|
+
# ========================================================================== #
|
|
86
|
+
# === initialize
|
|
87
|
+
# ========================================================================== #
|
|
88
|
+
def initialize(
|
|
89
|
+
commandline_arguments = nil,
|
|
90
|
+
run_already = true,
|
|
91
|
+
&block
|
|
92
|
+
)
|
|
93
|
+
register_sigint
|
|
94
|
+
reset
|
|
95
|
+
# ======================================================================== #
|
|
96
|
+
# And set :run_already, so that menu() can overrule it lateron. This
|
|
97
|
+
# should come before we call set_commandline_arguments().
|
|
98
|
+
# ======================================================================== #
|
|
99
|
+
@internal_hash[:run_already] = run_already
|
|
100
|
+
set_commandline_arguments(
|
|
101
|
+
commandline_arguments
|
|
102
|
+
)
|
|
103
|
+
# ======================================================================== #
|
|
104
|
+
# Next, we handle special run-mode variants.
|
|
105
|
+
# ======================================================================== #
|
|
106
|
+
case run_already?
|
|
107
|
+
when :do_not_run_yet
|
|
108
|
+
@internal_hash[:run_already] = false
|
|
109
|
+
# ======================================================================== #
|
|
110
|
+
# === do_show_everything
|
|
111
|
+
# ======================================================================== #
|
|
112
|
+
when :do_show_everything
|
|
113
|
+
do_show_everything
|
|
114
|
+
@internal_hash[:run_already] = true
|
|
115
|
+
end
|
|
116
|
+
# ======================================================================== #
|
|
117
|
+
# === Handle blocks next
|
|
118
|
+
#
|
|
119
|
+
# Next blocks will be handled. This must come after the reset() method.
|
|
120
|
+
# ======================================================================== #
|
|
121
|
+
if block_given?
|
|
122
|
+
yielded = yield
|
|
123
|
+
if yielded.is_a? Symbol
|
|
124
|
+
case yielded # case tag
|
|
125
|
+
# ==================================================================== #
|
|
126
|
+
# === :be_quiet
|
|
127
|
+
# ==================================================================== #
|
|
128
|
+
when :be_quiet
|
|
129
|
+
set_be_verbose(:be_quiet)
|
|
130
|
+
# ==================================================================== #
|
|
131
|
+
# === :do_not_use_rbt
|
|
132
|
+
# ==================================================================== #
|
|
133
|
+
when :do_not_use_rbt
|
|
134
|
+
@internal_hash[:may_we_try_to_use_rbt] = false
|
|
135
|
+
# ==================================================================== #
|
|
136
|
+
# === :disable_colours
|
|
137
|
+
# ==================================================================== #
|
|
138
|
+
when :disable_colours
|
|
139
|
+
disable_colours
|
|
140
|
+
# ==================================================================== #
|
|
141
|
+
# === :disable_colours_and_do_not_store_into_a_local_file
|
|
142
|
+
# ==================================================================== #
|
|
143
|
+
when :disable_colours_and_do_not_store_into_a_local_file
|
|
144
|
+
disable_colours
|
|
145
|
+
do_not_save_anything
|
|
146
|
+
# ==================================================================== #
|
|
147
|
+
# === :do_not_run_yet
|
|
148
|
+
# ==================================================================== #
|
|
149
|
+
when :do_not_run_yet,
|
|
150
|
+
:dont_run_yet
|
|
151
|
+
@internal_hash[:run_already] = false
|
|
152
|
+
end
|
|
153
|
+
# ====================================================================== #
|
|
154
|
+
# === Handle Hashes given in the block next.
|
|
155
|
+
# ====================================================================== #
|
|
156
|
+
elsif yielded.is_a? Hash
|
|
157
|
+
# ==================================================================== #
|
|
158
|
+
# === :use_n_tokens
|
|
159
|
+
# ==================================================================== #
|
|
160
|
+
if yielded.has_key? :use_n_tokens
|
|
161
|
+
set_use_n_tokens(yielded.delete(:use_n_tokens))
|
|
162
|
+
# ==================================================================== #
|
|
163
|
+
# === :n_tokens
|
|
164
|
+
# ==================================================================== #
|
|
165
|
+
elsif yielded.has_key? :n_tokens
|
|
166
|
+
set_use_n_tokens(yielded.delete(:n_tokens))
|
|
167
|
+
end
|
|
168
|
+
# ==================================================================== #
|
|
169
|
+
# === :use_colours
|
|
170
|
+
# ==================================================================== #
|
|
171
|
+
if yielded.has_key? :use_colours
|
|
172
|
+
set_use_colours(yielded.delete(:use_colours))
|
|
173
|
+
end
|
|
174
|
+
# ==================================================================== #
|
|
175
|
+
# === :be_silent
|
|
176
|
+
# ==================================================================== #
|
|
177
|
+
if yielded.has_key? :be_silent
|
|
178
|
+
set_be_silent(yielded.delete(:be_silent))
|
|
179
|
+
end
|
|
180
|
+
# ==================================================================== #
|
|
181
|
+
# === :show_ruby_stuff
|
|
182
|
+
# ==================================================================== #
|
|
183
|
+
if yielded.has_key? :show_ruby_stuff
|
|
184
|
+
if yielded.delete(:show_ruby_stuff) == false
|
|
185
|
+
dont_show_ruby_stuff
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
run if run_already?
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# ========================================================================== #
|
|
194
|
+
# === EnvironmentInformation::Query[]
|
|
195
|
+
# ========================================================================== #
|
|
196
|
+
def self.[](
|
|
197
|
+
i = ARGV, &block
|
|
198
|
+
)
|
|
199
|
+
new(i, &block)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# ============================================================================ #
|
|
205
|
+
# === EnvironmentInformation.return_version_of_sed?
|
|
206
|
+
#
|
|
207
|
+
# This method will return the version of sed.
|
|
208
|
+
# ============================================================================ #
|
|
209
|
+
def self.return_version_of_sed?(
|
|
210
|
+
i = :sed
|
|
211
|
+
)
|
|
212
|
+
_ = ::EnvironmentInformation::Query.new(i, :do_not_run_yet) { :be_quiet }
|
|
213
|
+
_.clear_old_dataset
|
|
214
|
+
_.add_the_commandline_arguments
|
|
215
|
+
_.do_work_through_all_the_specified_components
|
|
216
|
+
return _.version?
|
|
217
|
+
end; self.instance_eval { alias return_sed_version return_version_of_sed? } # === EnvironmentInformation.return_sed_version
|
|
218
|
+
self.instance_eval { alias return_version_of_sed return_version_of_sed? } # === EnvironmentInformation.return_version_of_sed
|
|
219
|
+
|
|
220
|
+
# =========================================================================== #
|
|
221
|
+
# === EnvironmentInformation.environment_information?
|
|
222
|
+
#
|
|
223
|
+
# This method will return a very long string containing all
|
|
224
|
+
# information about the locally installed/available programs.
|
|
225
|
+
# =========================================================================== #
|
|
226
|
+
def self.environment_information?
|
|
227
|
+
::EnvironmentInformation::Query.new(:full_be_silent).stringified
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# ============================================================================ #
|
|
231
|
+
# === EnvironmentInformation.run
|
|
232
|
+
# ============================================================================ #
|
|
233
|
+
def self.run(i = ARGV, &block)
|
|
234
|
+
::EnvironmentInformation::Query.new(i, &block)
|
|
235
|
+
end; self.instance_eval { alias new run } # === EnvironmentInformation.new
|
|
236
|
+
self.instance_eval { alias [] run } # === EnvironmentInformation[]
|
|
237
|
+
self.instance_eval { alias run_the_main_class run } # === EnvironmentInformation.run_the_main_class
|
|
238
|
+
self.instance_eval { alias result run } # === EnvironmentInformation.result
|
|
239
|
+
self.instance_eval { alias show run } # === EnvironmentInformation.show
|
|
240
|
+
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if __FILE__ == $PROGRAM_NAME
|
|
244
|
+
EnvironmentInformation.run(ARGV)
|
|
245
|
+
end # mainclass
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# ============================================================================ #
|
|
5
|
+
# require 'environment_information/query/reset.rb'
|
|
6
|
+
# ============================================================================ #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class Query < ::EnvironmentInformation::Base # === EnvironmentInformation::Query
|
|
12
|
+
|
|
13
|
+
# ========================================================================== #
|
|
14
|
+
# === reset (reset tag)
|
|
15
|
+
# ========================================================================== #
|
|
16
|
+
def reset
|
|
17
|
+
super()
|
|
18
|
+
set_be_verbose
|
|
19
|
+
# ======================================================================== #
|
|
20
|
+
# === :the_primary_hash
|
|
21
|
+
#
|
|
22
|
+
# This Hash will keep track as to which programs will be displayed.
|
|
23
|
+
#
|
|
24
|
+
# The version must be registered into this primary Hash.
|
|
25
|
+
#
|
|
26
|
+
# This hash's keys will contain the components that will be reported,
|
|
27
|
+
# such as on the commandline.
|
|
28
|
+
#
|
|
29
|
+
# Take note that the order is important: the entries that appear first
|
|
30
|
+
# will be displayed earlier. In other words: first entries will be
|
|
31
|
+
# shown first as well.
|
|
32
|
+
#
|
|
33
|
+
# By default it is empty, naturally.
|
|
34
|
+
# ======================================================================== #
|
|
35
|
+
@internal_hash[:the_primary_hash] = {}
|
|
36
|
+
# ======================================================================== #
|
|
37
|
+
# === :display_the_results_at_once
|
|
38
|
+
# ======================================================================== #
|
|
39
|
+
@internal_hash[:display_the_results_at_once] = true
|
|
40
|
+
# ======================================================================== #
|
|
41
|
+
# === :display_everything_in_short_format
|
|
42
|
+
#
|
|
43
|
+
# This variable determines whether we will use a compact-display or
|
|
44
|
+
# whether there will be one-entry-per-program instead.
|
|
45
|
+
# ======================================================================== #
|
|
46
|
+
@internal_hash[:display_everything_in_short_format] = false
|
|
47
|
+
# ======================================================================== #
|
|
48
|
+
# === :may_we_try_to_use_rbt
|
|
49
|
+
#
|
|
50
|
+
# Whether we may query RBT for additional help or not. By default
|
|
51
|
+
# we will try to make use of RBT.
|
|
52
|
+
# ======================================================================== #
|
|
53
|
+
@internal_hash[:may_we_try_to_use_rbt] = true
|
|
54
|
+
# ======================================================================== #
|
|
55
|
+
# === :namespace
|
|
56
|
+
# ======================================================================== #
|
|
57
|
+
@internal_hash[:namespace] = NAMESPACE
|
|
58
|
+
# ======================================================================== #
|
|
59
|
+
# === :runmode
|
|
60
|
+
#
|
|
61
|
+
# The :runmode variable can be :commandline or :gui or :www.
|
|
62
|
+
# ======================================================================== #
|
|
63
|
+
@internal_hash[:runmode] = :commandline
|
|
64
|
+
# ======================================================================== #
|
|
65
|
+
# === :generate_a_html_file
|
|
66
|
+
#
|
|
67
|
+
# If the next instance variable is set to true then a html file will
|
|
68
|
+
# be generated. By default this will not happen, though.
|
|
69
|
+
# ======================================================================== #
|
|
70
|
+
@internal_hash[:generate_a_html_file] = false
|
|
71
|
+
# ======================================================================== #
|
|
72
|
+
# === :do_exit_the_program
|
|
73
|
+
#
|
|
74
|
+
# The following variable can determine when we exit from this class.
|
|
75
|
+
# By default we will not exist early.
|
|
76
|
+
# ======================================================================== #
|
|
77
|
+
@internal_hash[:do_exit_the_program] = false
|
|
78
|
+
# ======================================================================== #
|
|
79
|
+
# === :array_unavailable_programs
|
|
80
|
+
#
|
|
81
|
+
# Programs which could not be found can be registered into the following
|
|
82
|
+
# Array.
|
|
83
|
+
# ======================================================================== #
|
|
84
|
+
@internal_hash[:array_unavailable_programs] = []
|
|
85
|
+
# ======================================================================== #
|
|
86
|
+
# === :use_one_line_to_show_the_result
|
|
87
|
+
# ======================================================================== #
|
|
88
|
+
@internal_hash[:use_one_line_to_show_the_result] = false
|
|
89
|
+
# ======================================================================== #
|
|
90
|
+
# === :try_to_rename_the_kde_konsole_tab
|
|
91
|
+
#
|
|
92
|
+
# The following instance variable will determine as to whether we will
|
|
93
|
+
# try to make use of the KDE Konsole and rename the tab of the konsole
|
|
94
|
+
# there.
|
|
95
|
+
#
|
|
96
|
+
# Since as of October 2018 we will not use the KDE konsole by default
|
|
97
|
+
# anymore. This may change at a later moment in time, though, hence
|
|
98
|
+
# why this remains part of reset(). I tried this again in April 2024,
|
|
99
|
+
# but it is too spammy, so I will most likely no longer use it anyway.
|
|
100
|
+
# ======================================================================== #
|
|
101
|
+
@internal_hash[:try_to_rename_the_kde_konsole_tab] = false
|
|
102
|
+
# ======================================================================== #
|
|
103
|
+
# === :compare_program_versions
|
|
104
|
+
#
|
|
105
|
+
# This instance variable can be used to also compare the program
|
|
106
|
+
# versions, if the RBT project is available.
|
|
107
|
+
#
|
|
108
|
+
# By default this will not be done, though, hence the value of false.
|
|
109
|
+
# ======================================================================== #
|
|
110
|
+
@internal_hash[:compare_program_versions] = false
|
|
111
|
+
# ======================================================================== #
|
|
112
|
+
# === :store_the_results_into_local_files
|
|
113
|
+
#
|
|
114
|
+
# If the following variable is set to true then the project will
|
|
115
|
+
# generate local files too, e. g. yaml files and what not.
|
|
116
|
+
# ======================================================================== #
|
|
117
|
+
@internal_hash[:store_the_results_into_local_files] = true
|
|
118
|
+
# ======================================================================== #
|
|
119
|
+
# === @internal_hash[:run_already]
|
|
120
|
+
#
|
|
121
|
+
# This variable will be true by default.
|
|
122
|
+
# ======================================================================== #
|
|
123
|
+
@internal_hash[:run_already] = true
|
|
124
|
+
# ======================================================================== #
|
|
125
|
+
# === :sort_alphabetically
|
|
126
|
+
#
|
|
127
|
+
# Whether to sort the main Hash alphabetically or not.
|
|
128
|
+
# ======================================================================== #
|
|
129
|
+
@internal_hash[:sort_alphabetically] = false
|
|
130
|
+
# ======================================================================== #
|
|
131
|
+
# === :dataset_containing_all_tracked_programs
|
|
132
|
+
#
|
|
133
|
+
# This will always contain all tracked programs, taken from a
|
|
134
|
+
# .yml file.
|
|
135
|
+
# ======================================================================== #
|
|
136
|
+
@internal_hash[:dataset_containing_all_tracked_programs] = ::EnvironmentInformation::ARRAY_TRACKED_PROGRAMS
|
|
137
|
+
# ======================================================================== #
|
|
138
|
+
# === :table
|
|
139
|
+
#
|
|
140
|
+
# This variable keeps track over as to whether this class will make
|
|
141
|
+
# use of an ASCII table or whether it will not.
|
|
142
|
+
# ======================================================================== #
|
|
143
|
+
@internal_hash[:table] = nil
|
|
144
|
+
# ======================================================================== #
|
|
145
|
+
# === :use_ascii_table
|
|
146
|
+
#
|
|
147
|
+
# Whether to use an ASCII table or whether we will not.
|
|
148
|
+
# ======================================================================== #
|
|
149
|
+
@internal_hash[:use_ascii_table] = false
|
|
150
|
+
# ======================================================================== #
|
|
151
|
+
# === :report_the_remote_urls
|
|
152
|
+
#
|
|
153
|
+
# If this instance variable is set to true then the remote URLs will
|
|
154
|
+
# be shown as well, on the commandline.
|
|
155
|
+
# ======================================================================== #
|
|
156
|
+
@internal_hash[:report_the_remote_urls] = false
|
|
157
|
+
# ======================================================================== #
|
|
158
|
+
# === :show_everything
|
|
159
|
+
#
|
|
160
|
+
# If the following instance variable is set to true then this class
|
|
161
|
+
# will try to show every registered (and thus, available) component.
|
|
162
|
+
#
|
|
163
|
+
# By default this is not wanted, so it is disabled. The user has to
|
|
164
|
+
# specifically enable this option via the commandline, if so
|
|
165
|
+
# desired, and thus overrule this default value.
|
|
166
|
+
# ======================================================================== #
|
|
167
|
+
@internal_hash[:show_everything] = false
|
|
168
|
+
# ======================================================================== #
|
|
169
|
+
# === :show_ruby_version_and_gem_version
|
|
170
|
+
#
|
|
171
|
+
# This instance variable determines whether class EnvironmentInformation
|
|
172
|
+
# will display the ruby version and the gem version.
|
|
173
|
+
#
|
|
174
|
+
# By default we will do so, but there may be situations where this
|
|
175
|
+
# may be unwanted, or not a good idea, such as in a minimal system
|
|
176
|
+
# where no ruby is running, or if the user only wants to display
|
|
177
|
+
# very little information.
|
|
178
|
+
# ======================================================================== #
|
|
179
|
+
@internal_hash[:show_ruby_version_and_gem_version] = true
|
|
180
|
+
# ======================================================================== #
|
|
181
|
+
# === :display_result
|
|
182
|
+
#
|
|
183
|
+
# If the following instance variable is true, which is the case by
|
|
184
|
+
# default, then this class will report to the user on the commandline.
|
|
185
|
+
#
|
|
186
|
+
# If it is set to false then nothing will be displayed; this is
|
|
187
|
+
# useful when you only want to obtain the dataset, without
|
|
188
|
+
# showing anything to the user.
|
|
189
|
+
# ======================================================================== #
|
|
190
|
+
@internal_hash[:display_result] = true
|
|
191
|
+
# ======================================================================== #
|
|
192
|
+
# === :array_these_programs_not_up_to_date
|
|
193
|
+
#
|
|
194
|
+
# This Array can be used to save into a local file which programs
|
|
195
|
+
# are not up to date.
|
|
196
|
+
# ======================================================================== #
|
|
197
|
+
if is_on_roebe?
|
|
198
|
+
@internal_hash[:array_these_programs_not_up_to_date] = []
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end; end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# ============================================================================ #
|
|
5
|
+
# require 'environment_information/query/run.rb'
|
|
6
|
+
# ============================================================================ #
|
|
7
|
+
require 'environment_information/base/base.rb'
|
|
8
|
+
|
|
9
|
+
module EnvironmentInformation
|
|
10
|
+
|
|
11
|
+
class Query < ::EnvironmentInformation::Base # === EnvironmentInformation::Query
|
|
12
|
+
|
|
13
|
+
# ========================================================================== #
|
|
14
|
+
# === run (run tag)
|
|
15
|
+
# ========================================================================== #
|
|
16
|
+
def run
|
|
17
|
+
# ======================================================================== #
|
|
18
|
+
# Reset the toplevel-array keeping track of all missing components.
|
|
19
|
+
# ======================================================================== #
|
|
20
|
+
::EnvironmentInformation.clear_array_missing_components
|
|
21
|
+
# ======================================================================== #
|
|
22
|
+
# Try to rename the KDE konsole first. This will happen on
|
|
23
|
+
# roebe-systems only.
|
|
24
|
+
# ======================================================================== #
|
|
25
|
+
do_rename_kde_konsole
|
|
26
|
+
# ======================================================================== #
|
|
27
|
+
# Find the appropriate version next:
|
|
28
|
+
# ======================================================================== #
|
|
29
|
+
# add(return_all_available_components)
|
|
30
|
+
# ======================================================================== #
|
|
31
|
+
# Invoke menu() to query the commandline arguments.
|
|
32
|
+
# ======================================================================== #
|
|
33
|
+
menu
|
|
34
|
+
if display_everything_in_short_format?
|
|
35
|
+
assign_components_for_the_short_format # Handle the short format here.
|
|
36
|
+
end
|
|
37
|
+
if sort_alphabetically? # ← Must come before the report-step.
|
|
38
|
+
do_sort_alphabetically
|
|
39
|
+
end
|
|
40
|
+
if insta_show?
|
|
41
|
+
# ====================================================================== #
|
|
42
|
+
# In this case we already showed every component.
|
|
43
|
+
# ====================================================================== #
|
|
44
|
+
else
|
|
45
|
+
check_this_hash_for_unavailable_programs(the_primary_hash?)
|
|
46
|
+
display_these_components
|
|
47
|
+
end
|
|
48
|
+
# ======================================================================== #
|
|
49
|
+
# === Consider generating a .html file
|
|
50
|
+
#
|
|
51
|
+
# The user may want to generate a .html file, so the following
|
|
52
|
+
# functionality allows the user to do so. This check should
|
|
53
|
+
# ideally come before other local files are generated.
|
|
54
|
+
# ======================================================================== #
|
|
55
|
+
do_generate_a_html_file if generate_a_html_file?
|
|
56
|
+
sync_the_primary_hash_onto_the_toplevel_hash
|
|
57
|
+
if commandline? and shall_we_store_the_main_hash_into_a_local_file?
|
|
58
|
+
store_this_hash_into_a_local_file(the_primary_hash?)
|
|
59
|
+
# ====================================================================== #
|
|
60
|
+
# Only store local files if the variable
|
|
61
|
+
# @store_the_results_into_local_files is true.
|
|
62
|
+
# ====================================================================== #
|
|
63
|
+
consider_storing_which_programs_are_not_up_to_date
|
|
64
|
+
end
|
|
65
|
+
end; alias feedback_everything run # === feedback_everything
|
|
66
|
+
alias do_feedback_everything run # === do_feedback_everything
|
|
67
|
+
alias output run # === output
|
|
68
|
+
alias feedback run # === feedback
|
|
69
|
+
|
|
70
|
+
end; end
|
|
@@ -5,14 +5,9 @@
|
|
|
5
5
|
# require 'environment_information/requires/require_the_environment_information_project.rb'
|
|
6
6
|
# =========================================================================== #
|
|
7
7
|
require 'environment_information/requires/require_the_constants.rb'
|
|
8
|
-
require 'environment_information/colours/
|
|
9
|
-
require 'environment_information/colours/simp.rb'
|
|
8
|
+
require 'environment_information/colours/colours.rb'
|
|
10
9
|
require 'environment_information/version/version.rb'
|
|
11
10
|
# =========================================================================== #
|
|
12
|
-
# Next, require the individual components:
|
|
13
|
-
# =========================================================================== #
|
|
14
|
-
require 'environment_information/requires/require_the_individual_misc_components.rb'
|
|
15
|
-
# =========================================================================== #
|
|
16
11
|
# Next, require the toplevel-methods of environment_information/:
|
|
17
12
|
# =========================================================================== #
|
|
18
13
|
require 'environment_information/requires/require_the_toplevel_methods.rb'
|
|
@@ -20,4 +15,4 @@ require 'environment_information/requires/require_the_toplevel_methods.rb'
|
|
|
20
15
|
# And then we will require the main class of the environment information
|
|
21
16
|
# project:
|
|
22
17
|
# =========================================================================== #
|
|
23
|
-
require 'environment_information/
|
|
18
|
+
require 'environment_information/query/query.rb'
|
|
@@ -12,9 +12,7 @@ module EnvironmentInformation
|
|
|
12
12
|
# === EnvironmentInformation.require_the_toplevel_methods
|
|
13
13
|
# ========================================================================= #
|
|
14
14
|
def self.require_the_toplevel_methods
|
|
15
|
-
|
|
16
|
-
require "environment_information/toplevel_methods/#{File.basename(this_file)}"
|
|
17
|
-
}
|
|
15
|
+
require 'environment_information/toplevel_methods/toplevel_methods.rb'
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
require_the_toplevel_methods # And require them at once.
|