environment_information 1.4.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1322 -0
  3. data/bin/envi +7 -0
  4. data/bin/fast_envi +7 -0
  5. data/doc/README.gen +1058 -0
  6. data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +55 -0
  7. data/environment_information.gemspec +135 -0
  8. data/lib/environment_information/base/base.rb +166 -0
  9. data/lib/environment_information/class/class.rb +2580 -0
  10. data/lib/environment_information/class/colours.rb +282 -0
  11. data/lib/environment_information/colours/colours.rb +224 -0
  12. data/lib/environment_information/colours/sfancy.rb +19 -0
  13. data/lib/environment_information/colours/simp.rb +19 -0
  14. data/lib/environment_information/constants/array_tracked_components.rb +210 -0
  15. data/lib/environment_information/constants/constants.rb +17 -0
  16. data/lib/environment_information/constants/encoding.rb +21 -0
  17. data/lib/environment_information/constants/error_line.rb +17 -0
  18. data/lib/environment_information/constants/file_constants.rb +102 -0
  19. data/lib/environment_information/constants/misc.rb +86 -0
  20. data/lib/environment_information/constants/namespace.rb +14 -0
  21. data/lib/environment_information/constants/newline.rb +16 -0
  22. data/lib/environment_information/constants/regex.rb +30 -0
  23. data/lib/environment_information/constants/temp_directory.rb +52 -0
  24. data/lib/environment_information/gui/jruby/environment_information.rb +77 -0
  25. data/lib/environment_information/gui/shared_code/environment_information/environment_information_module.rb +99 -0
  26. data/lib/environment_information/gui/universal_widgets/environment_information/environment_information.rb +419 -0
  27. data/lib/environment_information/misc_components/README.md +3 -0
  28. data/lib/environment_information/misc_components/cflags.rb +36 -0
  29. data/lib/environment_information/misc_components/cpuinfo.rb +64 -0
  30. data/lib/environment_information/misc_components/operating_system.rb +54 -0
  31. data/lib/environment_information/misc_components/operating_system_bit_type.rb +42 -0
  32. data/lib/environment_information/misc_components/ram.rb +30 -0
  33. data/lib/environment_information/misc_components/rubygems_installation_directory.rb +54 -0
  34. data/lib/environment_information/misc_components/screen_resolution.rb +50 -0
  35. data/lib/environment_information/project/project.rb +27 -0
  36. data/lib/environment_information/queries/README.md +2 -0
  37. data/lib/environment_information/queries/complex_version.rb +273 -0
  38. data/lib/environment_information/queries/pkg_config.rb +125 -0
  39. data/lib/environment_information/queries/simple_version.rb +272 -0
  40. data/lib/environment_information/requires/require_asciitable.rb +15 -0
  41. data/lib/environment_information/requires/require_the_constants.rb +7 -0
  42. data/lib/environment_information/requires/require_the_environment_information_project.rb +23 -0
  43. data/lib/environment_information/requires/require_the_individual_misc_components.rb +30 -0
  44. data/lib/environment_information/requires/require_the_toplevel_methods.rb +22 -0
  45. data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +153 -0
  46. data/lib/environment_information/toplevel_methods/cd.rb +16 -0
  47. data/lib/environment_information/toplevel_methods/e.rb +43 -0
  48. data/lib/environment_information/toplevel_methods/hash.rb +65 -0
  49. data/lib/environment_information/toplevel_methods/internet_is_available.rb +30 -0
  50. data/lib/environment_information/toplevel_methods/is_on_roebe.rb +16 -0
  51. data/lib/environment_information/toplevel_methods/menu.rb +90 -0
  52. data/lib/environment_information/toplevel_methods/misc.rb +324 -0
  53. data/lib/environment_information/toplevel_methods/n_subcommands.rb +31 -0
  54. data/lib/environment_information/toplevel_methods/prefix_to_use.rb +39 -0
  55. data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +61 -0
  56. data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +45 -0
  57. data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +84 -0
  58. data/lib/environment_information/toplevel_methods/return_alias_to.rb +30 -0
  59. data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +28 -0
  60. data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +54 -0
  61. data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +28 -0
  62. data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +182 -0
  63. data/lib/environment_information/toplevel_methods/show_all_available_components.rb +192 -0
  64. data/lib/environment_information/toplevel_methods/write_what_into.rb +24 -0
  65. data/lib/environment_information/version/version.rb +25 -0
  66. data/lib/environment_information/www/sinatra_interface.rb +213 -0
  67. data/lib/environment_information/www/webobject_interface.cgi +29 -0
  68. data/lib/environment_information/yaml/array_default_programs_on_linux.yml +15 -0
  69. data/lib/environment_information/yaml/array_lfs_core_programs.yml +37 -0
  70. data/lib/environment_information/yaml/array_science_cluster.yml +12 -0
  71. data/lib/environment_information/yaml/array_tracked_non_programs.yml +13 -0
  72. data/lib/environment_information/yaml/array_tracked_programs.yml +235 -0
  73. data/lib/environment_information/yaml/array_tracked_xorg_components.yml +37 -0
  74. data/lib/environment_information/yaml/colours.yml +3 -0
  75. data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +284 -0
  76. data/lib/environment_information.rb +5 -0
  77. data/test/testing_environment_information.rb +26 -0
  78. data/test/testing_missing_components.rb +9 -0
  79. data/test/testing_prefix_for_the_environment_information_project.rb +20 -0
  80. metadata +177 -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,77 @@
1
+ # =========================================================================== #
2
+ # The idea for this .rb file is to showcase what can be done with
3
+ # buttons in jruby-swing.
4
+ # =========================================================================== #
5
+ include Java
6
+
7
+ java_import javax.swing.JFrame
8
+
9
+ module EnvironmentInformation
10
+
11
+ module GUI
12
+
13
+ class EnvironmentInformation < JFrame
14
+
15
+ require 'swing_paradise'
16
+ include SwingParadise::BaseModule
17
+
18
+ require 'environment_information/gui/shared_code/environment_information/environment_information_module.rb'
19
+ include ::EnvironmentInformation::GUI::UniversalWidgets::EnvironmentInformationModule
20
+
21
+ # ========================================================================= #
22
+ # === initialize
23
+ # ========================================================================= #
24
+ def initialize(
25
+ run_already = true
26
+ )
27
+ reset
28
+ run if run_already
29
+ end
30
+
31
+ # ========================================================================= #
32
+ # === reset
33
+ # ========================================================================= #
34
+ def reset
35
+ reset_the_variables
36
+ end
37
+
38
+ # ========================================================================= #
39
+ # === run
40
+ # ========================================================================= #
41
+ def run
42
+ frame = frame(TITLE)
43
+ panel = new_panel # This is an instance of Java::JavaxSwing::JPanel.
44
+ panel.use_this_font = :hack_40
45
+ frame.getContentPane.add(panel)
46
+ panel.setLayout(BoxLayout.new(panel, BoxLayout::PAGE_AXIS)) # FlowLayout.new)
47
+ panel.hint = 'Table example'
48
+
49
+ text_view = create_text_view
50
+ _ = ''.dup
51
+ @data.each_pair {|key, value|
52
+ key = "#{key}:"
53
+ key = key.ljust(25, ' ')
54
+ _ << "#{key}"\
55
+ "#{value}\n"
56
+ }
57
+ text_view.set_content(_)
58
+ # text_view.use_this_font = :hack_35
59
+ text_view.set_font(Font.new('Hack', Font::PLAIN, 30))
60
+ scrolled_window = create_scrolled_window(text_view)
61
+
62
+ panel << scrolled_window
63
+ panel << quit_button
64
+
65
+ frame.use_this_font = :hack_45
66
+ frame.exit_on_close
67
+
68
+ frame.set_size(1550, 900)
69
+ frame.setLocationRelativeTo(nil)
70
+ frame.show_all
71
+ end
72
+
73
+ end; end; end
74
+
75
+ if __FILE__ == $PROGRAM_NAME
76
+ EnvironmentInformation::GUI::EnvironmentInformation.new
77
+ end