environment_information 1.4.99

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of environment_information might be problematic. Click here for more details.

Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +1287 -0
  3. data/bin/envi +7 -0
  4. data/bin/fast_envi +7 -0
  5. data/doc/README.gen +1044 -0
  6. data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +48 -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 +2829 -0
  10. data/lib/environment_information/colours/colours.rb +224 -0
  11. data/lib/environment_information/colours/sfancy.rb +19 -0
  12. data/lib/environment_information/colours/simp.rb +19 -0
  13. data/lib/environment_information/constants/array_tracked_components.rb +210 -0
  14. data/lib/environment_information/constants/constants.rb +17 -0
  15. data/lib/environment_information/constants/encoding.rb +21 -0
  16. data/lib/environment_information/constants/error_line.rb +17 -0
  17. data/lib/environment_information/constants/file_constants.rb +102 -0
  18. data/lib/environment_information/constants/misc.rb +86 -0
  19. data/lib/environment_information/constants/namespace.rb +14 -0
  20. data/lib/environment_information/constants/newline.rb +16 -0
  21. data/lib/environment_information/constants/regex.rb +30 -0
  22. data/lib/environment_information/constants/temp_directory.rb +52 -0
  23. data/lib/environment_information/gui/gtk2/environment_information.rb +35 -0
  24. data/lib/environment_information/gui/gtk3/environment_information.rb +34 -0
  25. data/lib/environment_information/gui/libui/environment_information.rb +74 -0
  26. data/lib/environment_information/gui/shared_code/environment_information_module.rb +409 -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 +217 -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 +152 -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 +60 -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 +322 -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 +215 -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 +264 -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,86 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/constants/misc.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ require 'environment_information/constants/encoding.rb'
10
+ require 'environment_information/constants/temp_directory.rb'
11
+
12
+ # ========================================================================= #
13
+ # === EnvironmentInformation::NOT_INSTALLED_OR_NOT_FOUND
14
+ # ========================================================================= #
15
+ NOT_INSTALLED_OR_NOT_FOUND = '[Not installed or not found.]'
16
+
17
+ # ========================================================================= #
18
+ # === EnvironmentInformation::COMMAND_NOT_FOUND
19
+ # ========================================================================= #
20
+ COMMAND_NOT_FOUND = 'command not found'
21
+
22
+ # ========================================================================= #
23
+ # === EnvironmentInformation::NOT_FOUND
24
+ # ========================================================================= #
25
+ NOT_FOUND = 'not found'
26
+
27
+ # ========================================================================= #
28
+ # === EnvironmentInformation::VERSION_STRING
29
+ # ========================================================================= #
30
+ VERSION_STRING = 'version'
31
+
32
+ # ========================================================================= #
33
+ # === EnvironmentInformation::NOT_FOUND_IN_PKG_CONFIG_SEARCH_PATH
34
+ #
35
+ # This constant is specifically for missing (or not found) .pc
36
+ # files.
37
+ # ========================================================================= #
38
+ NOT_FOUND_IN_PKG_CONFIG_SEARCH_PATH =
39
+ 'as not found in the pkg-config search path'
40
+
41
+ # ========================================================================= #
42
+ # === EnvironmentInformation::THE_PROGRAM_WAS_NOT_FOUND
43
+ # ========================================================================= #
44
+ THE_PROGRAM_WAS_NOT_FOUND =
45
+ '[The program was not found.]'
46
+
47
+ # ========================================================================= #
48
+ # === EnvironmentInformation::PKGCONFIG_COMMAND_NOT_FOUND
49
+ #
50
+ # The constant that follows next is used to determine whether
51
+ # pkg-config could find a corresponding .pc file. If not then
52
+ # pkg-config will typically report a line such as this:
53
+ #
54
+ # Package libdr was not found in the pkg-config search path.
55
+ #
56
+ # We will include the last part of this string, as a generic
57
+ # message that can be used to indicate "this package could
58
+ # not be found on the given computer system at hand".
59
+ # ========================================================================= #
60
+ PKGCONFIG_COMMAND_NOT_FOUND =
61
+ ' was not found in the pkg-config search path.'
62
+
63
+ # ========================================================================= #
64
+ # === EnvironmentInformation::NO_SUCH_FILE_OR_DIRECTORY
65
+ # ========================================================================= #
66
+ NO_SUCH_FILE_OR_DIRECTORY =
67
+ 'No such file or directory'
68
+
69
+ # ========================================================================= #
70
+ # === TRY_TO_MAKE_USE_OF_THE_OPN_GEM_IF_IT_IS_AVAILABLE
71
+ #
72
+ # This gem is closely connected to the NAMESPACE constant, so it
73
+ # will also reside in this file here.
74
+ # ========================================================================= #
75
+ TRY_TO_MAKE_USE_OF_THE_OPN_GEM_IF_IT_IS_AVAILABLE = true
76
+
77
+ # ========================================================================= #
78
+ # === EnvironmentInformation::SAVE_FILE
79
+ #
80
+ # Where to save stuff to. This depends on a proper setting of the
81
+ # toplevel variable called @temp_directory.
82
+ # ========================================================================= #
83
+ SAVE_FILE =
84
+ "#{@temp_directory}EnvironmentInformation.md"
85
+
86
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/constants/namespace.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ # ========================================================================= #
10
+ # === NAMESPACE
11
+ # ========================================================================= #
12
+ NAMESPACE = inspect
13
+
14
+ end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/constants/newline.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ # ========================================================================= #
10
+ # === EnvironmentInformation::N
11
+ #
12
+ # A newline constant to simplify our life.
13
+ # ========================================================================= #
14
+ N = "\n"
15
+
16
+ end
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # All regexes that relate to EnvironmentInformation project should be
6
+ # stored in this file here.
7
+ # =========================================================================== #
8
+ # require 'environment_information/constants/regex.rb'
9
+ # =========================================================================== #
10
+ module EnvironmentInformation
11
+
12
+ # ========================================================================= #
13
+ # === EnvironmentInformation::ARRAY_VERSION
14
+ # ========================================================================= #
15
+ ARRAY_VERSION = [
16
+ /^-?-?version\??$/i
17
+ ]
18
+
19
+ # ========================================================================= #
20
+ # === EnvironmentInformation::ARRAY_COMPARE_PROGRAM_VERSIONS
21
+ # ========================================================================= #
22
+ ARRAY_COMPARE_PROGRAM_VERSIONS = [
23
+ /^-?-?compare(-|_)?to(-|_)?program(-|_)?versions$/i,
24
+ /^-?-?compare(-|_)?program(-|_)?versions$/i,
25
+ /^-?-?compare(-|_)?programs$/i,
26
+ /^-?-?compare$/i,
27
+ /^-?-?compare(-|_)?version$/i
28
+ ]
29
+
30
+ end
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'environment_information/constants/temp_directory.rb'
6
+ # =========================================================================== #
7
+ module EnvironmentInformation
8
+
9
+ # ========================================================================= #
10
+ # === EnvironmentInformation::TEMP_DIRECTORY
11
+ #
12
+ # This constant denotes into which directory files should be stored,
13
+ # e. g. autogenerated files from the EnvironmentInformation project.
14
+ #
15
+ # This constant MUST have a trailing '/' character.
16
+ #
17
+ # The environment variable called MY_TEMP_DIR can overrule all
18
+ # other guesses made here, but it is not always available,
19
+ # e. g. in a .cgi file such an environment variable may not
20
+ # be available.
21
+ # ========================================================================= #
22
+ if ENV.has_key? 'MY_TEMP_DIR'
23
+ TEMP_DIRECTORY = ENV['MY_TEMP_DIR'].to_s
24
+ elsif File.directory? '/home/Temp/' # ← My main directory.
25
+ TEMP_DIRECTORY = '/home/Temp/'
26
+ elsif File.directory? '/Depot/Temp/'
27
+ TEMP_DIRECTORY = '/Depot/Temp/'
28
+ else
29
+ TEMP_DIRECTORY = '/tmp/' # ← "Rescue" for most other users on linux.
30
+ end
31
+
32
+ # ========================================================================= #
33
+ # === @temp_directory
34
+ # ========================================================================= #
35
+ @temp_directory = TEMP_DIRECTORY
36
+
37
+ # ========================================================================= #
38
+ # === EnvironmentInformation.temp_directory?
39
+ #
40
+ # This method will refer to the temp-directory in use for this project.
41
+ #
42
+ # It is advised to make use of the method, rather than the
43
+ # TEMP_DIRECTORY constant, as that is more convenient in the
44
+ # long run.
45
+ # ========================================================================= #
46
+ def self.temp_directory?(
47
+ i = @temp_directory
48
+ )
49
+ i.squeeze('/').dup
50
+ end; self.instance_eval { alias temp_dir? temp_directory? } # === EnvironmentInformation.temp_dir?
51
+
52
+ end
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation
6
+ # =========================================================================== #
7
+ # require 'environment_information/gui/gtk2/environment_information.rb'
8
+ # EnvironmentInformation::EnvironmentInformation::GUI::GtkE::nvironmentInformation.run
9
+ # EnvironmentInformation.run_gtk
10
+ # =========================================================================== #
11
+ begin # Pull in the gtk_paradise project next.
12
+ require 'gtk_paradise/require_gtk2'
13
+ rescue LoadError; end
14
+
15
+ module EnvironmentInformation
16
+
17
+ require 'environment_information/base/base.rb'
18
+ require 'environment_information/requires/require_the_environment_information_project.rb'
19
+
20
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
21
+
22
+ module GUI
23
+
24
+ module Gtk
25
+
26
+ class EnvironmentInformation < ::Gtk::VBox
27
+
28
+ require 'environment_information/gui/shared_code/binding_module.rb'
29
+ include ::EnvironmentInformation::EnvironmentInformation::GUI::Gtk::BindingModule
30
+
31
+ end; end; end; end; end
32
+
33
+ if __FILE__ == $PROGRAM_NAME
34
+ EnvironmentInformation.run_gtk
35
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation
6
+ # =========================================================================== #
7
+ # require 'environment_information/gui/gtk3/environment_information.rb'
8
+ # EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformation.run
9
+ # =========================================================================== #
10
+ begin # Pull in the gtk_paradise project next.
11
+ require 'gtk_paradise/require_gtk3'
12
+ rescue LoadError; end
13
+
14
+ module EnvironmentInformation
15
+
16
+ require 'environment_information/base/base.rb'
17
+ require 'environment_information/requires/require_the_environment_information_project.rb'
18
+
19
+ class EnvironmentInformation < ::EnvironmentInformation::Base # === EnvironmentInformation::EnvironmentInformation
20
+
21
+ module GUI
22
+
23
+ module Gtk
24
+
25
+ class EnvironmentInformation < ::Gtk::Box
26
+
27
+ require 'environment_information/gui/shared_code/environment_information_module.rb'
28
+ include ::EnvironmentInformation::EnvironmentInformation::GUI::Gtk::EnvironmentInformationModule
29
+
30
+ end; end; end; end; end
31
+
32
+ if __FILE__ == $PROGRAM_NAME
33
+ EnvironmentInformation.run_gtk
34
+ end
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === EnvironmentInformation::GUI::Libui::EnvironmentInformation
6
+ # =========================================================================== #
7
+ # require 'environment_information/gui/libui/environment_information.rb'
8
+ # EnvironmentInformation::GUI::Libui::EnvironmentInformation.new
9
+ # =========================================================================== #
10
+ module EnvironmentInformation
11
+
12
+ module GUI
13
+
14
+ module Libui
15
+
16
+ class EnvironmentInformation # === EnvironmentInformation::GUI::Libui::EnvironmentInformation
17
+
18
+ require 'libui_paradise/autoinclude'
19
+ require 'environment_information'
20
+
21
+ TITLE = 'Environment Information GUI'
22
+ WIDTH = 500
23
+ HEIGHT = 500
24
+
25
+ # ========================================================================= #
26
+ # === initialize
27
+ # ========================================================================= #
28
+ def initialize
29
+ reset
30
+ create_skeleton
31
+ @main_window = ui_margined_main_window(
32
+ TITLE, WIDTH, HEIGHT, 0
33
+ )
34
+ outer_vbox = ui_padded_vbox
35
+ label = ui_label('Environment Information GUI')
36
+
37
+ outer_vbox.minimal(
38
+ label
39
+ )
40
+ text_view = ui_text_view
41
+ _ = ''.dup
42
+ ::EnvironmentInformation.initialize_hash
43
+ ::EnvironmentInformation.hash.each_pair {|key, value|
44
+ _ << "#{(key.to_s+':').ljust(25)} #{value}\n"
45
+ }
46
+ text_view.set_text(_)
47
+ outer_vbox.maximal(text_view)
48
+ @main_window.child = outer_vbox
49
+ @main_window.intelligent_exit
50
+ end
51
+
52
+ # ========================================================================= #
53
+ # === reset (reset tag)
54
+ # ========================================================================= #
55
+ def reset
56
+ end
57
+
58
+ # ========================================================================= #
59
+ # === create_skeleton
60
+ # ========================================================================= #
61
+ def create_skeleton
62
+ end
63
+
64
+ # ========================================================================= #
65
+ # === create_buttons
66
+ # ========================================================================= #
67
+ def create_buttons
68
+ end
69
+
70
+ end; end; end; end
71
+
72
+ if __FILE__ == $PROGRAM_NAME
73
+ EnvironmentInformation::GUI::Libui::EnvironmentInformation.new
74
+ end