roebe 0.5.191 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +89 -41
  3. data/bin/create_my_directories +2 -2
  4. data/bin/{ruby_dhcpcd → dhcpcd_wrapper} +1 -1
  5. data/bin/start_lighty +1 -1
  6. data/doc/README.gen +78 -15
  7. data/doc/core/array.md +24 -23
  8. data/doc/core/gem_and_gemspec.md +12 -11
  9. data/doc/core/hash.md +6 -0
  10. data/doc/core/misc.md +23 -20
  11. data/doc/core/regex.md +1 -1
  12. data/doc/core/stderr.md +16 -0
  13. data/doc/deprecations/deprecations.md +2 -1
  14. data/doc/statistics/statistics.md +1 -0
  15. data/lib/roebe/actions/actions.rb +80 -0
  16. data/lib/roebe/base/colours.rb +52 -19
  17. data/lib/roebe/base/misc.rb +30 -1
  18. data/lib/roebe/base/opnn.rb +7 -0
  19. data/lib/roebe/browser/output_url_then_open_in_browser.rb +18 -15
  20. data/lib/roebe/classes/alltagsgeschichte.rb +1 -1
  21. data/lib/roebe/classes/at.rb +2 -2
  22. data/lib/roebe/classes/auto_rename_file_based_on_its_creation_date.rb +24 -12
  23. data/lib/roebe/classes/books/books.rb +234 -142
  24. data/lib/roebe/classes/books/finished_books/finished_books.rb +10 -3
  25. data/lib/roebe/classes/books/menu.rb +25 -16
  26. data/lib/roebe/classes/books/sanitize_this_book_path/sanitize_this_book_path.rb +0 -1
  27. data/lib/roebe/classes/check_yaml.rb +15 -11
  28. data/lib/roebe/classes/compile_kernel.rb +3 -1
  29. data/lib/roebe/classes/contacts/contacts.rb +104 -0
  30. data/lib/roebe/classes/contacts/gui/universal_widgets/contacts.rb +168 -0
  31. data/lib/roebe/classes/contacts/shared_code.rb +344 -0
  32. data/lib/roebe/classes/copy_kernel_config.rb +5 -3
  33. data/lib/roebe/classes/create_desktop_file.rb +1 -1
  34. data/lib/roebe/classes/create_file_skeleton/constants.rb +1 -1
  35. data/lib/roebe/classes/create_file_skeleton/generate_ruby_string.rb +20 -20
  36. data/lib/roebe/classes/create_file_skeleton/reset.rb +19 -16
  37. data/lib/roebe/classes/create_my_directories.rb +12 -10
  38. data/lib/roebe/classes/dhcpcd/{dhcpcd.rb → dhcpcd_wrapper.rb} +137 -95
  39. data/lib/roebe/classes/dhcpcd/kill_dhcpcd.rb +2 -2
  40. data/lib/roebe/classes/do_install.rb +7 -6
  41. data/lib/roebe/classes/done.rb +1 -1
  42. data/lib/roebe/classes/downcase_extension.rb +4 -4
  43. data/lib/roebe/classes/email.rb +44 -40
  44. data/lib/roebe/classes/enable.rb +1 -1
  45. data/lib/roebe/classes/generate_alsa_conf.rb +4 -4
  46. data/lib/roebe/classes/generate_overview_of_the_locally_available_books.rb +5 -3
  47. data/lib/roebe/classes/github.rb +1 -1
  48. data/lib/roebe/classes/kde/install_this_konsole_theme.rb +1 -1
  49. data/lib/roebe/classes/{handle_lighttpd.rb → lighttpd/lighttpd_wrapper.rb} +55 -47
  50. data/lib/roebe/classes/make_gem.rb +49 -35
  51. data/lib/roebe/classes/mbl.rb +6 -4
  52. data/lib/roebe/classes/readme_generator/readme_generator.rb +597 -1
  53. data/lib/roebe/classes/remove_trailing_newline.rb +82 -0
  54. data/lib/roebe/classes/report_how_many_files_are_in_this_directory.rb +83 -0
  55. data/lib/roebe/classes/rxinitrc/constants.rb +7 -5
  56. data/lib/roebe/classes/rxinitrc/rxinitrc.rb +8 -4
  57. data/lib/roebe/classes/set_background.rb +14 -0
  58. data/lib/roebe/classes/show_ten_aliases.rb +15 -3
  59. data/lib/roebe/classes/simple_boot_script.rb +1 -1
  60. data/lib/roebe/classes/size_of.rb +9 -7
  61. data/lib/roebe/classes/tales_from_the_crypt.rb +1 -1
  62. data/lib/roebe/classes/update.rb +4 -11
  63. data/lib/roebe/classes/upload_to_imgur.rb +64 -35
  64. data/lib/roebe/commandline/misc.rb +28 -28
  65. data/lib/roebe/constants/array_install_these_gem_projects.rb +1 -1
  66. data/lib/roebe/constants/constants.rb +8 -1
  67. data/lib/roebe/constants/emojis.rb +0 -19
  68. data/lib/roebe/constants/file_and_directory_constants.rb +2 -2
  69. data/lib/roebe/constants/misc.rb +10 -2
  70. data/lib/roebe/constants/roebe.rb +2 -0
  71. data/lib/roebe/custom_methods/module.rb +45 -16
  72. data/lib/roebe/fonts/fonts.rb +39 -0
  73. data/lib/roebe/gui/universal_widgets/books/books.rb +232 -0
  74. data/lib/roebe/hello_world/hello_world.rb +0 -0
  75. data/lib/roebe/irb/clean_irbrc +1 -0
  76. data/lib/roebe/math/log10.rb +3 -3
  77. data/lib/roebe/math/the_collatz_problem.rb +104 -0
  78. data/lib/roebe/{toplevel_methods/lighttpd.rb → requires/require_lighttpd.rb} +2 -2
  79. data/lib/roebe/shell/shell/shell.rb +6 -6
  80. data/lib/roebe/shell_scripts/README.md +0 -0
  81. data/lib/roebe/shell_scripts/bashrc +0 -0
  82. data/lib/roebe/shell_scripts/konsole_tabs.sh +6 -0
  83. data/lib/roebe/shell_scripts/lfs/001_binutils_1.sh +10 -2
  84. data/lib/roebe/shell_scripts/lfs/002_gcc_1.sh +33 -3
  85. data/lib/roebe/shell_scripts/lfs/003_linux_1.sh +1 -0
  86. data/lib/roebe/shell_scripts/lfs/004_glibc_1.sh +5 -2
  87. data/lib/roebe/shell_scripts/lfs/005_libstdc++_1.sh +8 -1
  88. data/lib/roebe/shell_scripts/lfs/007_ncurses_2.sh +5 -2
  89. data/lib/roebe/shell_scripts/lfs/020_xz_2.sh +5 -4
  90. data/lib/roebe/shell_scripts/lfs/022_gcc_2.sh +15 -1
  91. data/lib/roebe/shell_scripts/lfs/025_ruby_2.sh +13 -0
  92. data/lib/roebe/shell_scripts/lfs/README.md +0 -0
  93. data/lib/roebe/shell_scripts/lfs/lfs_build_variables.sh +56 -16
  94. data/lib/roebe/toplevel_methods/module_methods.rb +5 -3
  95. data/lib/roebe/toplevel_methods/to_mp3.rb +1 -1
  96. data/lib/roebe/version/version.rb +2 -2
  97. data/lib/roebe/wasm/README.md +7 -0
  98. data/lib/roebe/wasm/enable_simple_puts_output.rb +9 -0
  99. data/lib/roebe/wasm/wasm_examples.html +43 -0
  100. data/lib/roebe/www/LEDS/LEDS.rb +35 -25
  101. data/lib/roebe/www/RNA/RNA.cgi +42 -1
  102. data/lib/roebe/www/algorithms/algorithms.rb +40 -0
  103. data/lib/roebe/www/analytical_chemistry/content.md +6 -0
  104. data/lib/roebe/www/animals/animals.cgi +25 -0
  105. data/lib/roebe/www/bioanalytik/bioanalytik.cgi +90 -0
  106. data/lib/roebe/www/biotechnology/biotechnology.rb +39 -3
  107. data/lib/roebe/www/cellbiology/cellbiology.rb +19 -2
  108. data/lib/roebe/www/chemistry/S/303/244uren_Basen_und_der_pH_Wert/S/303/244uren_Basen_und_der_pH_Wert.cgi +242 -0
  109. data/lib/roebe/www/chemistry/chemistry.rb +10 -258
  110. data/lib/roebe/www/chemistry/css_rules.css +67 -0
  111. data/lib/roebe/www/chemistry/die_quantenzahlen/die_quantenzahlen.cgi +123 -0
  112. data/lib/roebe/www/chemistry/funktionelle_gruppen_in_der_chemie/funktionelle_gruppen_in_der_chemie.cgi +52 -0
  113. data/lib/roebe/www/chrome_and_chromium/chrome_and_chromium.rb +37 -42
  114. data/lib/roebe/www/chromium +1 -0
  115. data/lib/roebe/www/cognitive_biology/cognitive_biology.cgi +18 -3
  116. data/lib/roebe/www/erste_hilfe/erste_hilfe.cgi +215 -62
  117. data/lib/roebe/www/fonts/fonts.cgi +245 -0
  118. data/lib/roebe/www/genomics/genomics.rb +4 -0
  119. data/lib/roebe/www/hardware/computersysteme/computersysteme.rb +117 -102
  120. data/lib/roebe/www/hardware/netzteile/netzteile.cgi +94 -0
  121. data/lib/roebe/www/immunology/immunology.rb +131 -7
  122. data/lib/roebe/www/insekten/insekten.md +27 -0
  123. data/lib/roebe/www/lighttpd/autogenerated_lighttpd.conf +7 -3
  124. data/lib/roebe/www/lighttpd/configuration/index.conf +7 -4
  125. data/lib/roebe/www/lighttpd/lighttpd.rb +6 -6
  126. data/lib/roebe/www/linux/antiX/antiX.rb +7 -4
  127. data/lib/roebe/www/linux/linux.rb +9 -11
  128. data/lib/roebe/www/linux/linuxmint/linuxmint.rb +33 -0
  129. data/lib/roebe/www/linux/slackware/slackware.rb +136 -27
  130. data/lib/roebe/www/linux/void/void.rb +34 -8
  131. data/lib/roebe/www/linux_commands/linux_commands.rb +6 -6
  132. data/lib/roebe/www/lyrics/lyrics.rb +1 -1
  133. data/lib/roebe/www/metabolic_pathways/metabolic_pathways.rb +5 -1
  134. data/lib/roebe/www/microbiology/microbiology.rb +17 -2
  135. data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.cgi +1086 -2
  136. data/lib/roebe/www/mitochondria/mitochondria.cgi +16 -2
  137. data/lib/roebe/www/module_www.rb +2 -3
  138. data/lib/roebe/www/neurobiology/neurobiology.rb +20 -3
  139. data/lib/roebe/www/pdf/pdf.rb +13 -0
  140. data/lib/roebe/www/physics/physics.rb +20 -4
  141. data/lib/roebe/www/physiology/physiology.rb +5 -1
  142. data/lib/roebe/www/play_this_video_file/play_this_video_file.cgi +1 -1
  143. data/lib/roebe/www/programming_advice/programming_advice.cgi +36 -0
  144. data/lib/roebe/www/programming_advice/programming_advice.md +358 -0
  145. data/lib/roebe/www/psychologie/psychologie.rb +7 -1
  146. data/lib/roebe/www/science/science.rb +6 -0
  147. data/lib/roebe/www/sex_and_reproduction/sex_and_reproduction.cgi +18 -2
  148. data/lib/roebe/www/statistik/statistik.rb +6 -1
  149. data/lib/roebe/www/structural_biology/structural_biology.cgi +18 -0
  150. data/lib/roebe/www/the_cell_cycle/the_cell_cycle.cgi +27 -0
  151. data/lib/roebe/www/video/video.rb +1 -1
  152. data/lib/roebe/www/virology/virology.rb +12 -1
  153. data/lib/roebe/www/war_in_Ukraine_2022/war_in_Ukraine_2022.rb +70 -28
  154. data/lib/roebe/www/waschmaschinen/waschmaschinen.rb +5 -4
  155. data/lib/roebe/www/xfce/xfce.cgi +5 -4
  156. data/lib/roebe/www/xorg/xorg.rb +3 -202
  157. data/lib/roebe/www/yeast/yeast.rb +4 -2
  158. data/lib/roebe/www/yubiko/yubiko.cgi +49 -0
  159. data/lib/roebe/yaml/{autostart_these_programs.yml → autostart_these_programs/autostart_these_programs.yml} +7 -6
  160. data/lib/roebe/yaml/books/favourite_books.yml +11 -9
  161. data/lib/roebe/yaml/directory_structure.yml +2 -0
  162. data/lib/roebe/yaml/use_this_editor/use_this_editor.yml +1 -0
  163. metadata +39 -20
  164. data/lib/roebe/classes/readme_generator/constants.rb +0 -21
  165. data/lib/roebe/classes/readme_generator/initialize.rb +0 -38
  166. data/lib/roebe/classes/readme_generator/misc.rb +0 -548
  167. data/lib/roebe/classes/readme_generator/reset.rb +0 -28
  168. data/lib/roebe/classes/readme_generator/run.rb +0 -20
  169. data/lib/roebe/shell_scripts/lfs/lfs_variables.sh +0 -31
  170. data/lib/roebe/www/cognitive_biology/cognitive_biology.html +0 -40634
  171. data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.rb +0 -1055
  172. data/lib/roebe/www/programming_advice/programming_advice.yml +0 -31
  173. data/lib/roebe/yaml/main_editor.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a131bfe77e783074db388059a14ea1d5037e8d4c17902023575f1c56c33e13dc
4
- data.tar.gz: aa0e3baec297cc14136f29f35f9231af91731f7f629702c8dfc3d266e46fadce
3
+ metadata.gz: 34c4a26f5398c7f87161b0277adbab0453229262790bad3057efd370de501144
4
+ data.tar.gz: bded795ea514ac1d525ec28c8dcb68f4b5dc1fc996d02526bbccf3a3eb702161
5
5
  SHA512:
6
- metadata.gz: e1d7fc582dc0543e5136d803f8f8b43c5b8b6fbf036fa7c14ba2ec4fb51bd5558f19ab42ba52cf98f67c576499fe3d28e78eecc7c0bab46df08310f8adcbb11e
7
- data.tar.gz: 22de8a6e62bb77fab48cad54b76d7b7417e65fa7077eae864605514c906c6f3cbd84581246fbf3ba86336265dc7a038ad0847ecc49fd5ea0f271d5da547de0af
6
+ metadata.gz: 67d16f6eabc5801c459f503feda415b098ad7cf68d8b3ac10f7113182a748ea05c01263c5002fa2b1ee6ce41a149d70669086b179c2dc0656fb640026a64f83e
7
+ data.tar.gz: 6412467df95da8c46101b046df6784b390f66dcbc1d9483e91a46e2c7cdd3b41dd949201aa017bb8ec4f41fa7a011f39654a77ce5d33dce72a745d8b2ec3000d
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
3
  [![Gem Version](https://badge.fury.io/rb/roebe.svg)](https://badge.fury.io/rb/roebe)
4
4
 
5
- This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">31.01.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">00:15:47</span> o'clock.
5
+ This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">17.04.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">20:42:27</span> o'clock.
6
6
 
7
7
  ## Introducing the Roebe project
8
8
 
@@ -50,41 +50,92 @@ project, called open, via the Open namespace, so that I can do:
50
50
  Open.in_browser(remote_URL_here)
51
51
  Open.in_editor('/tmp/foobar.md')
52
52
 
53
- Additionally, the Roebe project may serve as **an entry point to other
54
- gems**, thus tapping into the larger ruby gem ecosystem as a whole. This
53
+ Additionally, the Roebe project may serve as <b>an entry point to other
54
+ gems</b>, thus tapping into the larger ruby gem ecosystem as a whole. This
55
55
  is an important **side-goal** for this project, as it is, to word this
56
56
  differently, my main "jumping point" for ruby these days. If I need
57
57
  specialized functionality, I tend to write some ruby code, put it into
58
58
  the roebe project, and then move on from there.
59
59
 
60
+ ## Policy in effect in regards to the roebe project
61
+
62
+ The roebe-project is adjusted to my own use cases. This also means that
63
+ other users of this gem may not find the project all that terribly
64
+ useful, which is understandable.
65
+
66
+ Yet, at the same time, this gem is also my most popular gem. I am not
67
+ sure why that is the case, but perhaps other users found some of the
68
+ code or content in this gem useful.
69
+
70
+ Either way, no matter as to the underlying reason for this, I thought
71
+ about how to make the roebe-gem more useful to other people. So, in
72
+ April 2024 I decided to add a policy-directive to this gem, so that
73
+ other users of this gem may understand how they could benefit from
74
+ the project, as well as - even more importantly - <b>how to
75
+ adjust the project to their own use cases</b>.
76
+
77
+ I will try to adjust the code so that people can overrule behaviour
78
+ that they may want to have via the commandline. Furthermore, hardcoded
79
+ paths should be avoided, if possible; at the least some flexibility
80
+ should be kept in mind with regard to the roebe-gem, where methods
81
+ should be usable by other users, aiming to adjust the behaviour of
82
+ the classes to their use cases.
83
+
84
+ Let me try to explain the above rationale with a specific example -
85
+ this may make it easier to understand the changed approach I will
86
+ use past April 2024.
87
+
88
+ In the past I had a GUI application called <b>contacts</b>. This
89
+ file, unsurprisingly, contained contacts-information I would use.
90
+ This information I kept in a spearate .yml file which I did not
91
+ publish - after all that information is not useful to anyone else,
92
+ but simply refers to my own use case here, and my own contacts
93
+ file.
94
+
95
+ But, for other people, they may want to use their own .yml file.
96
+ So I needed to change the code to allow custom loading of
97
+ .yml files in general. I also decided to add support for a
98
+ special ENV variable, so that people can simply use that
99
+ variable to override any other value in the contacts.rb file.
100
+
101
+ The file contacts.rb also comes with GUI code - the old
102
+ ruby-gtk3 code, libui-code as well as jruby-SWING bindings.
103
+
104
+ Starting the gtk3 bindings, for instance, can be done via:
105
+
106
+ contacts --gtk3
107
+
108
+ The long-term goal is to extend this to many more .rb files
109
+ in the roebe project, when it makes sense to offer a GUI.
110
+
60
111
  ## General remarks about the Layout and Structure of the roebe project
61
112
 
62
- The **roebe-project** is fairly large. Most code can be found within
63
- the **classes/** subdirectory of the <b>roebe</b> gem, as well as the
64
- **toplevel_methods/** subdirectory of the <b>roebe</b> gem - so,
65
- **roebe/classes/** and **roebe/toplevel_methods/** are the two
113
+ The <b>roebe-project</b> is fairly large. Most code can be found within
114
+ the <b>classes/</b> subdirectory of the <b>roebe</b> gem, as well as the
115
+ <b>toplevel_methods/</b> subdirectory of the <b>roebe</b> gem - so,
116
+ <b>roebe/classes/</b> and <b>roebe/toplevel_methods/</b> are the two
66
117
  primary subdirectories of this gem.
67
118
 
68
- Following that, a few classes will be described **below this section**
69
- in this document (**README.md**) - but keep in mind that this is <b>not</b>
119
+ Following that, a few classes will be described <b>below this section</b>
120
+ in this document (<b>README.md</b>) - but keep in mind that this is <b>not</b>
70
121
  a "complete" documentation of all the available classes that are
71
122
  distributed in this gem. Only some of these classes
72
- will be described in this file here (**README.md**).
123
+ will be described in this file here (<b>README.md</b>).
73
124
 
74
- **Before running any of the code, I recommend to you to have a
125
+ <b>Before running any of the code, I recommend to you to have a
75
126
  look at the source code of the corresponding .rb file - that way
76
127
  you may be able to judge whether the functionality is desired
77
- by you or whether it may need any modifications.**
128
+ by you or whether it may need any modifications.</b>
78
129
 
79
130
  Keep in mind that the functionality defaults to my own use case,
80
- which **may easily differ from your use case**. Some of these
131
+ which <b>may easily differ from your use case</b>. Some of these
81
132
  classes have not been updated in years, so again: have a look
82
- at the source code before running **any** of these classes, in
133
+ at the source code before running <b>any</b> of these classes, in
83
134
  particular for larger classes or classes that remove files or
84
- directories (you can grep for **delete** and **remove** to
135
+ directories (you can grep for <b>delete</b> and <b>remove</b> to
85
136
  find these).
86
137
 
87
- Presently the **roebe-project** has only a **very few external
138
+ Presently the <b>roebe-project</b> has only a **very few external
88
139
  dependencies** - but in theory, all external dependencies could be
89
140
  removed altogether. I like to make use of some external code,
90
141
  though, which is why most .rb files within this project require
@@ -5752,6 +5803,18 @@ have to install the emoji_paradise gem, via:
5752
5803
 
5753
5804
  gem install emoji_paradise
5754
5805
 
5806
+ ## Roebe.actions()
5807
+
5808
+ Roebe.actions() was added in March 2024. The idea is that for every
5809
+ important (major) activity, related to the roebe gem, we bundle
5810
+ this through the method Roebe.actions().
5811
+
5812
+ This thus constitutes a generic entry point, which in turn can then
5813
+ be used towards other entry points of other gems, without needing
5814
+ to require any specific .rb file or know the class-names of such
5815
+ files, as-is. We thus gain a <b>lot</b> more flexibility that
5816
+ way.
5817
+
5755
5818
  ## Useful links, blogs, articles about the Ruby programming language
5756
5819
 
5757
5820
  This subsection contains some links that may possibly be useful to you when
@@ -5840,29 +5903,14 @@ gem owner eventually:
5840
5903
  see
5841
5904
  https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
5842
5905
 
5843
- Mandatory 2FA will eventually be extended to all rubygems.org developers and
5844
- maintainers. As I can not use 2FA, for reasons I will skip explaining here,
5845
- this means that my projects will eventually be removed, as I no longer
5846
- have any control over my projects hosted on rubygems.org (because I
5847
- can not use 2FA).
5848
-
5849
- At that point, I no longer have any control what is done to my projects
5850
- since whoever is controlling the gems ecosystem took away our control
5851
- here. I am not sure at which point ruby became corporate-controlled -
5852
- that was not the case several years ago, so something has
5853
- changed.
5854
-
5855
- Ruby also only allows 2FA users to participate on the issue tracker these
5856
- days:
5857
-
5858
- https://bugs.ruby-lang.org/issues/18800
5859
-
5860
- But this has been reverted some months ago, so it is no longer applicable.
5861
- Suffice to say that I do not think that we should only be allowed to
5862
- interact on the world wide web when some 'authority' authenticated us,
5863
- such as via mandatory 2FA, so I hope this won't come back again.
5864
-
5865
- Fighting spam is a noble goal, but when it also means you lock out
5866
- real human people then this is definitely NOT a good situation
5867
- to be had.
5906
+ However had, that has been reverted again, so I decided to shorten
5907
+ this paragraph. Mandatory 2FA may exclude users who do not have a
5908
+ smartphone device or other means to 'identify'. I do not feel it is
5909
+ a fair assumption by others to be made that non-identified people may
5910
+ not contribute code, which is why I reject it. Mandatory 2FA would mean
5911
+ an end to all my projects on rubygems.org, so let's hope it will never
5912
+ happen. (Keep in mind that I refer to mandatory 2FA; I have no qualms
5913
+ for people who use 2FA on their own, but this carrot-and-stick strategy
5914
+ by those who control the rubygems infrastructure is a very bad one to
5915
+ pursue.
5868
5916
 
@@ -2,6 +2,6 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- require 'roebe/classes/create_my_directories.rb'
5
+ require 'roebe/actions/actions.rb'
6
6
 
7
- Roebe::CreateMyDirectories.new(ARGV)
7
+ Roebe.actions(:CreateMyDirectories, ARGV)
@@ -2,6 +2,6 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- require 'roebe/classes/dhcpcd/dhcpcd.rb'
5
+ require 'roebe/classes/dhcpcd/dhcpcd_wrapper.rb'
6
6
 
7
7
  Roebe.dhcpcd(ARGV)
data/bin/start_lighty CHANGED
@@ -2,6 +2,6 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- require 'roebe/toplevel_methods/lighttpd.rb'
5
+ require 'roebe/requires/require_lighttpd.rb'
6
6
 
7
7
  Roebe.start_lighttpd
data/doc/README.gen CHANGED
@@ -46,41 +46,92 @@ project, called open, via the Open namespace, so that I can do:
46
46
  Open.in_browser(remote_URL_here)
47
47
  Open.in_editor('/tmp/foobar.md')
48
48
 
49
- Additionally, the Roebe project may serve as **an entry point to other
50
- gems**, thus tapping into the larger ruby gem ecosystem as a whole. This
49
+ Additionally, the Roebe project may serve as <b>an entry point to other
50
+ gems</b>, thus tapping into the larger ruby gem ecosystem as a whole. This
51
51
  is an important **side-goal** for this project, as it is, to word this
52
52
  differently, my main "jumping point" for ruby these days. If I need
53
53
  specialized functionality, I tend to write some ruby code, put it into
54
54
  the roebe project, and then move on from there.
55
55
 
56
+ ## Policy in effect in regards to the roebe project
57
+
58
+ The roebe-project is adjusted to my own use cases. This also means that
59
+ other users of this gem may not find the project all that terribly
60
+ useful, which is understandable.
61
+
62
+ Yet, at the same time, this gem is also my most popular gem. I am not
63
+ sure why that is the case, but perhaps other users found some of the
64
+ code or content in this gem useful.
65
+
66
+ Either way, no matter as to the underlying reason for this, I thought
67
+ about how to make the roebe-gem more useful to other people. So, in
68
+ April 2024 I decided to add a policy-directive to this gem, so that
69
+ other users of this gem may understand how they could benefit from
70
+ the project, as well as - even more importantly - <b>how to
71
+ adjust the project to their own use cases</b>.
72
+
73
+ I will try to adjust the code so that people can overrule behaviour
74
+ that they may want to have via the commandline. Furthermore, hardcoded
75
+ paths should be avoided, if possible; at the least some flexibility
76
+ should be kept in mind with regard to the roebe-gem, where methods
77
+ should be usable by other users, aiming to adjust the behaviour of
78
+ the classes to their use cases.
79
+
80
+ Let me try to explain the above rationale with a specific example -
81
+ this may make it easier to understand the changed approach I will
82
+ use past April 2024.
83
+
84
+ In the past I had a GUI application called <b>contacts</b>. This
85
+ file, unsurprisingly, contained contacts-information I would use.
86
+ This information I kept in a spearate .yml file which I did not
87
+ publish - after all that information is not useful to anyone else,
88
+ but simply refers to my own use case here, and my own contacts
89
+ file.
90
+
91
+ But, for other people, they may want to use their own .yml file.
92
+ So I needed to change the code to allow custom loading of
93
+ .yml files in general. I also decided to add support for a
94
+ special ENV variable, so that people can simply use that
95
+ variable to override any other value in the contacts.rb file.
96
+
97
+ The file contacts.rb also comes with GUI code - the old
98
+ ruby-gtk3 code, libui-code as well as jruby-SWING bindings.
99
+
100
+ Starting the gtk3 bindings, for instance, can be done via:
101
+
102
+ contacts --gtk3
103
+
104
+ The long-term goal is to extend this to many more .rb files
105
+ in the roebe project, when it makes sense to offer a GUI.
106
+
56
107
  ## General remarks about the Layout and Structure of the roebe project
57
108
 
58
- The **roebe-project** is fairly large. Most code can be found within
59
- the **classes/** subdirectory of the <b>roebe</b> gem, as well as the
60
- **toplevel_methods/** subdirectory of the <b>roebe</b> gem - so,
61
- **roebe/classes/** and **roebe/toplevel_methods/** are the two
109
+ The <b>roebe-project</b> is fairly large. Most code can be found within
110
+ the <b>classes/</b> subdirectory of the <b>roebe</b> gem, as well as the
111
+ <b>toplevel_methods/</b> subdirectory of the <b>roebe</b> gem - so,
112
+ <b>roebe/classes/</b> and <b>roebe/toplevel_methods/</b> are the two
62
113
  primary subdirectories of this gem.
63
114
 
64
- Following that, a few classes will be described **below this section**
65
- in this document (**README.md**) - but keep in mind that this is <b>not</b>
115
+ Following that, a few classes will be described <b>below this section</b>
116
+ in this document (<b>README.md</b>) - but keep in mind that this is <b>not</b>
66
117
  a "complete" documentation of all the available classes that are
67
118
  distributed in this gem. Only some of these classes
68
- will be described in this file here (**README.md**).
119
+ will be described in this file here (<b>README.md</b>).
69
120
 
70
- **Before running any of the code, I recommend to you to have a
121
+ <b>Before running any of the code, I recommend to you to have a
71
122
  look at the source code of the corresponding .rb file - that way
72
123
  you may be able to judge whether the functionality is desired
73
- by you or whether it may need any modifications.**
124
+ by you or whether it may need any modifications.</b>
74
125
 
75
126
  Keep in mind that the functionality defaults to my own use case,
76
- which **may easily differ from your use case**. Some of these
127
+ which <b>may easily differ from your use case</b>. Some of these
77
128
  classes have not been updated in years, so again: have a look
78
- at the source code before running **any** of these classes, in
129
+ at the source code before running <b>any</b> of these classes, in
79
130
  particular for larger classes or classes that remove files or
80
- directories (you can grep for **delete** and **remove** to
131
+ directories (you can grep for <b>delete</b> and <b>remove</b> to
81
132
  find these).
82
133
 
83
- Presently the **roebe-project** has only a **very few external
134
+ Presently the <b>roebe-project</b> has only a **very few external
84
135
  dependencies** - but in theory, all external dependencies could be
85
136
  removed altogether. I like to make use of some external code,
86
137
  though, which is why most .rb files within this project require
@@ -5748,6 +5799,18 @@ have to install the emoji_paradise gem, via:
5748
5799
 
5749
5800
  gem install emoji_paradise
5750
5801
 
5802
+ ## Roebe.actions()
5803
+
5804
+ Roebe.actions() was added in March 2024. The idea is that for every
5805
+ important (major) activity, related to the roebe gem, we bundle
5806
+ this through the method Roebe.actions().
5807
+
5808
+ This thus constitutes a generic entry point, which in turn can then
5809
+ be used towards other entry points of other gems, without needing
5810
+ to require any specific .rb file or know the class-names of such
5811
+ files, as-is. We thus gain a <b>lot</b> more flexibility that
5812
+ way.
5813
+
5751
5814
  ## Useful links, blogs, articles about the Ruby programming language
5752
5815
 
5753
5816
  This subsection contains some links that may possibly be useful to you when
data/doc/core/array.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## How can we check whether something is included in an array or not? (inarray, is in array, in_array)
2
+
3
+ a = [ "a", "b", "c" ] #
4
+ a.include?("b") # true
5
+
6
+ If you want to do this for an object called x and the array y
7
+
8
+ y.member?(x)
9
+
10
+ ## I am used to perl's qw(). How to make this in ruby? Is there a shortcut for creating arrays? (quoted words)
11
+
12
+ x = %w(63 362 63632 dog cat)
13
+
14
+ The lowercased %w extracts space-separated tokens into array elements.
15
+
16
+ The uppercased %W does double-quoted string subtiutions, which is
17
+ useful if you want to use variables.
18
+
19
+ Examples for %W:
20
+
21
+ x = %W( one two -#{Time.now}-)
22
+ x = %W( one #two three #{Time.now} ) # => ["one", "#two", "three", "2024-02-25 02:46:21 +0000"]
23
+
24
+
1
25
  ## Create an Array with 5 random numbers:
2
26
 
3
27
  Array.new(5) { rand(10) }
@@ -602,29 +626,6 @@
602
626
  (1..5000).select {|i| i % 3 == 0 } # Wählt 3,6,9,12
603
627
  etc.. aus
604
628
 
605
- ## How can I check whether something is included in
606
- an array or not? (inarray, is in array, in_array)
607
- a = [ "a", "b", "c" ] #
608
- a.include?("b") # true
609
-
610
- If you want to do this for an object called x and the array y
611
-
612
- y.member?(x)
613
-
614
- frage("I am used to perl's qw(). How to make this in ruby? Is
615
- there a shortcut for creating arrays? (quoted words)")+
616
- x = %w(63 362 63632 dog cat)
617
-
618
- The lowercased %w extracts space-separated
619
- tokens into array elements.
620
-
621
- The uppercased %W does double-quoted string subtiutions.
622
- Useful if you want to use variables.
623
-
624
- Beispiel für %W:
625
-
626
- x=%W( one two -#{Time.now}-)
627
-
628
629
  ## Wie suche ich nach einem String in einem Array?','grep
629
630
  array = ["one","two","three","four"]
630
631
  array.grep("three")
@@ -373,22 +373,23 @@
373
373
  include Gem::Text
374
374
  levenshtein_distance 'shevy', 'chevy' # => 1
375
375
 
376
- # ===================================================================== #
377
- # === How to compare two program versions with one another
378
- # ===================================================================== #
379
- ## Wie kann ich verschiedene Versionen
380
- miteinander vergleichen?
381
- Gem::Version.new('0.4.1') > Gem::Version.new('0.10.1')
382
376
 
383
- Um den <b>dependency check</b> zu ignorieren (force install)
384
- geht dies hier (bzw <b>gemif</b>):
377
+ ## How to compare two program versions with one another
378
+
379
+ Use:
385
380
 
386
- gem install -f lalala
381
+ Gem::Version.new('0.4.1') > Gem::Version.new('0.10.1')
382
+
383
+ Um den <b>dependency check</b> zu ignorieren (force install)
384
+ geht dies hier (bzw <b>gemif</b>):
385
+
386
+ gem install -f lalala
387
387
 
388
388
  ## Kann ich es vermeiden, .gemrc zu laden?
389
- Ja. Verwende:
390
389
 
391
- --config-file
390
+ Yes. Make use of:
391
+
392
+ --config-file
392
393
 
393
394
  ## Wie erhalte ich das Bindir Verzeichnis von Gem?
394
395
 
data/doc/core/hash.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## How to transform every key in a Hash?
2
+
3
+ hash = { name: 'Rob', age: '28' }
4
+ hash.transform_keys { |entry| entry.to_s.upcase } # => { "NAME" => "Rob", "AGE" => "28" }
5
+ hash.transform_keys! { |entry| entry.to_s.upcase } # => { "NAME" => "Rob", "AGE" => "28" }
6
+
1
7
  ## How can we convert an Array into a Hash, in Ruby? (array2hash)
2
8
 
3
9
  j = Hash[*array] # => {"a"=>"b", "c"=>"d", "e"=>"Jkl"}
data/doc/core/misc.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## How can we read data from a .rb file without ruby evaluating this data?
2
+
3
+ Make use of:
4
+
5
+ p DATA.read
6
+ __END__
7
+
8
+ DATA.read liest die Information ein, die nach __END__ geschrieben
9
+ ist. Man kann dies sogar verwenden um Configurations-Dateien in
10
+ einer .rb Datei zu speichern.
11
+
12
+ Die Konstante <b>DATA</b> ist verfügbar sobald die __END__
13
+ Direktive in einer .rb Datei drinnen steht. Alles was dieser
14
+ __END__ Direktive folgt ist dann Inhalt von DATA.
15
+
16
+ DATA ist leider nur für $0 verfügbar.
17
+
18
+ DATA ist ein File Objekt. Man kann daher auch <b>DATA.pos</b>
19
+ verwenden.
20
+
21
+ Man kann mittels <b>__END__</b> auch direkt YAML Code in
22
+ ein .rb <b>Skript</b> einfügen.
23
+
1
24
  ## How do we find out how many arguments a method will accept? (alos known as arity)
2
25
 
3
26
  This is possible via the <b>.arity</b> method.
@@ -1150,26 +1173,6 @@
1150
1173
 
1151
1174
  d.send(:attr=, 99) # macht das selbe wie oben, nur verboser.
1152
1175
 
1153
- ## Wie lese ich Daten von einer .rb Datei ohne das Ruby
1154
- diese Daten interpretiert?','__END__
1155
- p DATA.read
1156
- __END__
1157
-
1158
- DATA.read liest die Information ein, die nach __END__ geschrieben
1159
- ist. Man kann dies sogar verwenden um Configurations-Dateien in
1160
- einer .rb Datei zu speichern.
1161
-
1162
- anm('Die Konstante <b>DATA</b> ist verfügbar sobald die __END__
1163
- Direktive in einer .rb Datei drinnen steht. Alles was dieser
1164
- __END__ Direktive folgt ist dann Inhalt von DATA.
1165
- anm('DATA ist leider nur für $0 verfügbar.
1166
-
1167
- anm('DATA ist ein File Objekt. Man kann daher auch <b>DATA.pos</b>
1168
- verwenden.
1169
-
1170
- Man kann mittels <b>__END__</b> auch direkt YAML Code in
1171
- ein .rb <b>Skript</b> einfügen.
1172
-
1173
1176
  ## Wie erhalte ich das Default External Ruby Encoding via
1174
1177
  Commandline?
1175
1178
  ruby -e 'p Encoding.default_external'
data/doc/core/regex.md CHANGED
@@ -397,7 +397,7 @@ https://github.com/perlpilot/perl6-docs/blob/master/intro/p6-regex-intro.pod
397
397
 
398
398
  '$1
399
399
 
400
- bzw in Verbindung mit <b>.gsub</b>
400
+ or alternative, in conjunction with <b>.gsub</b>
401
401
 
402
402
  line = "Tennis/Soccer/Balls"
403
403
  " line.gsub!(%r{Tennis/Soccer/(.+?)}, '\\1')
data/doc/core/stderr.md CHANGED
@@ -1,3 +1,19 @@
1
1
  ## How to redirect $stderr in ruby?
2
2
 
3
3
  $stderr.reopen("err.txt", "w")
4
+
5
+ ## How can we silence $stderr in ruby but then restore it again?
6
+
7
+ Use something like:
8
+
9
+ @original_stderr = $stderr.clone
10
+ STDERR.puts('Hello, from STDERR') # this will go to standard error
11
+ $stderr.reopen('/dev/null', 'w')
12
+ STDERR.puts('Hello, from STDERR') # this will go to standard error
13
+ result = `tmux -V `
14
+ pp result
15
+ pp 'OK'
16
+ $stderr.reopen(@original_stderr)
17
+ result = `tmux -V `
18
+ pp result
19
+ pp 'OK'
@@ -9,7 +9,8 @@ Roebe::Shell instance then you should simply use
9
9
  Roebe::Shell.home_directory? instead.
10
10
 
11
11
  On the 30.05.2023, the old NAMESPACE constant of the Roebe::Shell
12
- was removed - it was no longer needed.
12
+ was removed - it was no longer needed, as the method .infer_the_namespace()
13
+ takes care of that nowadays.
13
14
 
14
15
  On the 30.05.2023 the constant FILE_DIAMONDRC was removed. Use
15
16
  a separate method call if you need to obtain the path to the
@@ -94,5 +94,6 @@ Total gems (ideally store it at the end of the month):
94
94
  Total gems 172,440 (Jul 2022), Total users 169,484 # ← 14.07.2022
95
95
  Total gems 174,304 (Dec 2022), Total users 172,523 # ← 04.12.2022
96
96
  Total gems 178,865 (Nov 2023), Total users 183,129 # ← 16.11.2023
97
+ Total gems 179,738 (Feb 2024), Total users 186,502 # ← 02.02.2024
97
98
 
98
99
  # https://rubygems.org/stats
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Roebe::Actions
6
+ # =========================================================================== #
7
+ # require 'roebe/actions/actions.rb'
8
+ # dataset = Roebe.actions(:contacts_dataset)
9
+ # Roebe.actions(ARGV)
10
+ # =========================================================================== #
11
+ module Roebe
12
+
13
+ require 'roebe/constants/roebe.rb'
14
+
15
+ # ========================================================================= #
16
+ # === Roebe.actions (action tag, actions tag)
17
+ # ========================================================================= #
18
+ def self.actions(
19
+ action_that_is_desired = nil,
20
+ optional_argument1 = ARGV, # This is typically the main input to this method.
21
+ options_hash = {},
22
+ &block
23
+ )
24
+ # ======================================================================= #
25
+ # First this method will handle Arrays:
26
+ # ======================================================================= #
27
+ if action_that_is_desired.is_a? Array
28
+ action_that_is_desired.each {|this_action|
29
+ Roebe.actions(
30
+ this_action,
31
+ optional_argument1,
32
+ options_hash,
33
+ &block
34
+ )
35
+ }
36
+ else
37
+ _ = optional_argument1 # Easier "pointer" here.
38
+ case action_that_is_desired # (case tag)
39
+ # ======================================================================= #
40
+ # === :make_gem
41
+ #
42
+ # Usage example:
43
+ #
44
+ # dataset = Roebe.actions(:make_gem)
45
+ #
46
+ # ======================================================================= #
47
+ when :make_gem,
48
+ :MakeGem
49
+ require 'roebe/classes/make_gem.rb'
50
+ Roebe.make_gem(_, &block)
51
+ # ======================================================================= #
52
+ # === :contacts_dataset
53
+ #
54
+ # Usage example:
55
+ #
56
+ # dataset = Roebe.actions(:contacts)
57
+ #
58
+ # ======================================================================= #
59
+ when :contacts_dataset,
60
+ :ContactsDataset,
61
+ :contacts
62
+ require 'yaml'
63
+ this_file = Roebe.file_contacts
64
+ return YAML.load_file(this_file)
65
+ # ======================================================================= #
66
+ # === :create_my_directories
67
+ # ======================================================================= #
68
+ when :create_my_directories,
69
+ :CreateMyDirectories
70
+ require 'roebe/classes/create_my_directories.rb'
71
+ Roebe::CreateMyDirectories.new(_, &block)
72
+ end
73
+ end
74
+ end; self.instance_eval { alias action actions } # === Roebe.action
75
+
76
+ end
77
+
78
+ if __FILE__ == $PROGRAM_NAME
79
+ Roebe.actions(ARGV)
80
+ end # roebe_actions