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
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Roebe::ReportHowManyFilesAreInThisDirectory
6
+ #
7
+ # Usage example:
8
+ #
9
+ # Roebe::ReportHowManyFilesAreInThisDirectory.new
10
+ #
11
+ # =========================================================================== #
12
+ # require 'classes/.rb'
13
+ # =========================================================================== #
14
+ require 'roebe/base/base.rb'
15
+
16
+ module Roebe
17
+
18
+ class ReportHowManyFilesAreInThisDirectory < Roebe::Base # === Roebe::ReportHowManyFilesAreInThisDirectory
19
+
20
+ # ========================================================================= #
21
+ # === initialize
22
+ # ========================================================================= #
23
+ def initialize(
24
+ i = ARGV,
25
+ run_already = true
26
+ )
27
+ reset
28
+ set_commandline_arguments(i)
29
+ run if run_already
30
+ end
31
+
32
+ # ========================================================================= #
33
+ # === reset (reset tag)
34
+ # ========================================================================= #
35
+ def reset
36
+ super()
37
+ infer_the_namespace
38
+ # ======================================================================= #
39
+ # === @hash_storing_all_directories
40
+ # ======================================================================= #
41
+ @hash_storing_all_directories = {}
42
+ @hash_storing_all_directories.default = 0
43
+ end
44
+
45
+ # ========================================================================= #
46
+ # === show_help (help tag)
47
+ # ========================================================================= #
48
+ def show_help
49
+ e
50
+ opne 'No help option is available right now.'
51
+ e
52
+ end
53
+
54
+ # ========================================================================= #
55
+ # === hash_storing_all_directories?
56
+ # ========================================================================= #
57
+ def hash_storing_all_directories?
58
+ @hash_storing_all_directories
59
+ end; alias hash? hash_storing_all_directories? # === hash?
60
+
61
+ # ========================================================================= #
62
+ # === run (run tag)
63
+ # ========================================================================= #
64
+ def run
65
+ all_files = Dir['**/**'].select {|entry| is_a_file?(entry) }
66
+ # ======================================================================= #
67
+ # Store it in our main Hash:
68
+ # ======================================================================= #
69
+ all_files.each {|this_file|
70
+ subdir = File.dirname(this_file)
71
+ @hash_storing_all_directories[subdir] += 1
72
+ }
73
+ hash?.each_pair {|this_directory, n_files|
74
+ e sdir((this_directory+':').ljust(70))+
75
+ ' '+steelblue(n_files.to_s.rjust(4))
76
+ }
77
+ end
78
+
79
+ end; end
80
+
81
+ if __FILE__ == $PROGRAM_NAME
82
+ Roebe::ReportHowManyFilesAreInThisDirectory.new(ARGV)
83
+ end # ReportHowManyFilesAreInThisDirectory
@@ -28,11 +28,13 @@ class RXinitrc < Base
28
28
  # === ARRAY_AUTOSTART_THESE_PROGRAMS_ON_ROEBE
29
29
  # ========================================================================= #
30
30
  ARRAY_AUTOSTART_THESE_PROGRAMS_ON_ROEBE = %w(
31
- bluefish
32
- konsole
33
- palemoon
31
+ konsole1
34
32
  xfce4-terminal
35
- )
33
+ thorium2
34
+ geany
35
+ ) # palemoon
36
+ # bluefish
37
+
36
38
 
37
39
  # ========================================================================= #
38
40
  # === HOME_DIR
@@ -98,4 +100,4 @@ class RXinitrc < Base
98
100
 
99
101
  ).sort
100
102
 
101
- end; end
103
+ end; end
@@ -9,15 +9,15 @@
9
9
  # require 'roebe/classes/rxinitrc/rxinitrc.rb'
10
10
  # =========================================================================== #
11
11
  require 'roebe/base/base.rb'
12
- require 'roebe/classes/rxinitrc/constants.rb'
13
- require 'roebe/classes/rxinitrc/help.rb'
14
- require 'roebe/classes/rxinitrc/run.rb'
15
12
 
16
13
  module Roebe
17
14
 
18
15
  class RXinitrc < Roebe::Base # === Roebe::RXinitrc
19
16
 
20
17
  require 'roebe/classes/create_desktop_file.rb'
18
+ require 'roebe/classes/rxinitrc/constants.rb'
19
+ require 'roebe/classes/rxinitrc/help.rb'
20
+ require 'roebe/classes/rxinitrc/run.rb'
21
21
 
22
22
  # ========================================================================= #
23
23
  # === initalize
@@ -510,6 +510,10 @@ xsetroot -solid black
510
510
  def consider_adding_autostart_these_programs_if_on_roebe
511
511
  if is_on_roebe?
512
512
  ARRAY_AUTOSTART_THESE_PROGRAMS_ON_ROEBE.each {|this_program|
513
+ case this_program
514
+ when 'konsole1'
515
+ this_program = 'konsole --tabs-from-file /home/x/programming/ruby/src/roebe/lib/roebe/shell_scripts/konsole_tabs.sh &'
516
+ end
513
517
  @_ << this_program+' &'+N+N
514
518
  }
515
519
  end
@@ -528,4 +532,4 @@ end
528
532
 
529
533
  if __FILE__ == $PROGRAM_NAME
530
534
  Roebe::RXinitrc.new(ARGV.first)
531
- end # rxinit
535
+ end # rxinit
@@ -49,12 +49,26 @@ class SetBackground < Base # === Roebe::SetBackground
49
49
  @window_manager_currently_running = nil
50
50
  end
51
51
 
52
+ # ========================================================================= #
53
+ # === does_wmctrl_exist?
54
+ # ========================================================================= #
55
+ def does_wmctrl_exist?
56
+ result = `wmctrl 2>&1`
57
+ !result.include? 'wmctrl: command not found'
58
+ end
59
+
52
60
  # ========================================================================= #
53
61
  # === use_wmctrl_to_determine_which_window_manager_is_currently_running
54
62
  #
55
63
  # Note that this method depends on the external program called "wmctrl".
56
64
  # ========================================================================= #
57
65
  def use_wmctrl_to_determine_which_window_manager_is_currently_running
66
+ if is_on_roebe? and !does_wmctrl_exist?
67
+ require 'rbt'
68
+ opne 'Compiling wmctrl next, as we are on '\
69
+ 'a roebe-system and wmctrl is missing.'
70
+ RBT::Installer.new('wmctrl') {{ prefix: '/usr/' }}
71
+ end
58
72
  result = `wmctrl -m`.split("\n") # Note that result will be an Array.
59
73
  _ = result.first.to_s.dup
60
74
  case _
@@ -276,16 +276,28 @@ class ShowTenAliases < Roebe::Base # === Roebe::ShowTenAliases
276
276
  end
277
277
  right_arrow = right_arrow?
278
278
  # ======================================================================= #
279
- # Iterate over the specified keys next:
279
+ # Iterate over the specified keys next, while expanding the padding
280
+ # value if the key is higher than the default:
280
281
  # ======================================================================= #
282
+ use_this_as_ljust_value = @n_ljust_name_of_the_entry
283
+ highest_value = 0
284
+ dataset?.each {|key, value|
285
+ if value.size > highest_value
286
+ highest_value = value.size
287
+ end
288
+ }
289
+ if highest_value > use_this_as_ljust_value
290
+ use_this_as_ljust_value = highest_value
291
+ end
281
292
  dataset?.each_pair {|number, exam_topic|
282
293
  if main_array.include? number
283
294
  # =================================================================== #
284
- # Build up the resulting String for display to the user.
295
+ # Build up the resulting String for display to the user. This will
296
+ # use the default ljust-value.
285
297
  # =================================================================== #
286
298
  result = " #{lightblue(number.to_s.rjust(2))}"\
287
299
  " #{slategray(right_arrow)} "\
288
- "#{slateblue(exam_topic.to_s.ljust(@n_ljust_name_of_the_entry))} ".dup
300
+ "#{slateblue(exam_topic.to_s.ljust(use_this_as_ljust_value))} ".dup
289
301
  if @show_n_percent_of_the_exam_questions_that_were_already_solved
290
302
  this_topic = exam_topic.to_s.delete('?')
291
303
  if mini_dataset
@@ -21,7 +21,7 @@ module Roebe
21
21
 
22
22
  class SimpleBootScript < Base # === Roebe::SimpleBootScript
23
23
 
24
- require 'roebe/toplevel_methods/lighttpd.rb'
24
+ require 'roebe/requires/require_lighttpd.rb'
25
25
 
26
26
  # ========================================================================= #
27
27
  # === initialize
@@ -138,7 +138,7 @@ class SizeOf < ::Roebe::Base # === Roebe::SizeOf
138
138
  end
139
139
  result = 'Calculating the total size of: '+i
140
140
  if optional_filesize
141
- result << rev+' ('+sfancy(optional_filesize.to_s)+')'
141
+ result << rev+' ('+sfancy(optional_filesize.to_s)+rev+')'
142
142
  end
143
143
  opne result
144
144
  end
@@ -202,11 +202,13 @@ class SizeOf < ::Roebe::Base # === Roebe::SizeOf
202
202
  be_verbose = true
203
203
  end
204
204
  if be_verbose
205
- opne 'The total filesize of '+sdir(target?)+' is: '+
206
- simp(@total_filesize.to_s)+' Bytes.'
205
+ orev 'The total filesize of '+sdir(target?)+
206
+ rev+' is: '+
207
+ simp(@total_filesize.to_s)+
208
+ "#{rev} Bytes."
207
209
  rounded_result = (@total_filesize.to_f / 1024.0 / 1024.0).round(3).to_s
208
- opne 'This should be '+sfancy(rounded_result+' MB ')+
209
- add_result_in_gb(rounded_result)
210
+ orev 'This should be '+sfancy(rounded_result+' MB ')+
211
+ add_result_in_gb(rounded_result)
210
212
  end
211
213
  end
212
214
 
@@ -220,7 +222,7 @@ class SizeOf < ::Roebe::Base # === Roebe::SizeOf
220
222
  # ========================================================================= #
221
223
  # === Roebe::SizeOf[]
222
224
  # ========================================================================= #
223
- def self.[](i = '')
225
+ def self.[](i = ARGV)
224
226
  new(i)
225
227
  end
226
228
 
@@ -231,4 +233,4 @@ if __FILE__ == $PROGRAM_NAME
231
233
  _.be_verbose
232
234
  _.run
233
235
  end # sizeof /Depot/Temp/*
234
- # sizeof /home/x/songs/
236
+ # sizeof /home/x/songs/
@@ -29,7 +29,7 @@ class TalesFromTheCrypt < Base # === Roebe::TalesFromTheCrypt
29
29
  rescue LoadError; end
30
30
 
31
31
  begin
32
- require 'multimedia_paradise/constants/file_constants.rb'
32
+ require 'multimedia_paradise/constants/constants.rb'
33
33
  rescue LoadError; end
34
34
 
35
35
  begin
@@ -12,6 +12,7 @@ module Roebe
12
12
  class Update < Base # === Roebe::Update
13
13
 
14
14
  require 'roebe/constants/array_install_these_gem_projects.rb'
15
+ require 'roebe/classes/make_gem.rb'
15
16
 
16
17
  # ========================================================================= #
17
18
  # === ARCHIVE_DIRECTORY
@@ -50,7 +51,8 @@ class Update < Base # === Roebe::Update
50
51
  # Display the directory on which we are currently working on.
51
52
  # ===================================================================== #
52
53
  e
53
- e index+') '+sfancy(name)+': -> Directory is: '+sfancy(location)
54
+ e "#{rev}#{index}) #{sfancy(name)}#{rev}"\
55
+ ": → Directory is: #{sfancy(location)}"
54
56
  e
55
57
  cd(location) # Now we must be in the target location.
56
58
  case @install_how # case tag
@@ -310,15 +312,6 @@ end
310
312
  remove_file(this_gem) if this_gem
311
313
  end
312
314
 
313
- # ========================================================================= #
314
- # === Roebe.make_gem
315
- # ========================================================================= #
316
- def self.make_gem
317
- if Dir['*.gemspec'].size > 0
318
- system 'gem build *.gemspec'
319
- end
320
- end
321
-
322
315
  # ========================================================================= #
323
316
  # === Roebe.gem_install
324
317
  #
@@ -344,7 +337,7 @@ end
344
337
  def self.install_in_ruby_gem_manner(
345
338
  optional_copy_the_gem_to_this_location = nil
346
339
  )
347
- make_gem
340
+ Roebe.make_gem
348
341
  gem_install
349
342
  if optional_copy_the_gem_to_this_location and
350
343
  !optional_copy_the_gem_to_this_location.is_a?(Symbol)
@@ -1,18 +1,22 @@
1
1
  #!/usr/bin/ruby -w
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
- # =========================================================================== #
4
+ # ============================================================================ #
5
5
  # === Roebe::UploadToImgur
6
6
  #
7
7
  # This class can be used to upload an image to imgur.
8
8
  #
9
+ # Since as of April 2024 it no longer works. I don't understand the
10
+ # HTML dump from imgur, so it is unlikely I will be able to fix this
11
+ # class.
12
+ #
9
13
  # Usage example:
10
14
  #
11
15
  # Roebe::UploadToImgur.new(ARGV)
12
16
  #
13
- # =========================================================================== #
17
+ # ============================================================================ #
14
18
  # require 'roebe/classes/upload_to_imgur.rb'
15
- # =========================================================================== #
19
+ # ============================================================================ #
16
20
  require 'roebe/base/base.rb'
17
21
 
18
22
  module Roebe
@@ -21,36 +25,39 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
21
25
 
22
26
  require 'net/https'
23
27
 
24
- # ========================================================================= #
28
+ # ========================================================================== #
25
29
  # === ENDPOINTS
26
- # ========================================================================= #
30
+ # ========================================================================== #
27
31
  ENDPOINTS = {
28
32
  image: '/3/image/',
29
33
  gallery: '/3/gallery/'
30
34
  }
31
35
 
32
- # ========================================================================= #
36
+ # ========================================================================== #
33
37
  # === API_PUBLIC_KEY
34
38
  #
35
39
  # This is the public imgur API key.
36
- # ========================================================================= #
40
+ # ========================================================================== #
37
41
  API_PUBLIC_KEY = 'Client-ID 70ff50b8dfc3a53'
38
42
 
39
- # ========================================================================= #
43
+ # ========================================================================== #
40
44
  # === API_URI
41
- # ========================================================================= #
42
- API_URI = URI.parse('https://api.imgur.com')
45
+ # ========================================================================== #
46
+ API_URI = URI.parse('https://apidocs.imgur.com/') # 'https://api.imgur.com')
43
47
 
44
- # ========================================================================= #
48
+ # ========================================================================== #
45
49
  # === REGEX_FOR_THE_LINK_ENTRY
46
50
  #
47
- # See this URL: https://rubular.com/r/4scnVyZWGOETJr
48
- # ========================================================================= #
51
+ # See this URL:
52
+ #
53
+ # https://rubular.com/r/4scnVyZWGOETJr
54
+ #
55
+ # ========================================================================== #
49
56
  REGEX_FOR_THE_LINK_ENTRY = /"link":"(.+)"}/
50
57
 
51
- # ========================================================================= #
58
+ # ========================================================================== #
52
59
  # === initialize
53
- # ========================================================================= #
60
+ # ========================================================================== #
54
61
  def initialize(
55
62
  commandline_arguments = ARGV,
56
63
  run_already = true
@@ -62,9 +69,9 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
62
69
  run if run_already
63
70
  end
64
71
 
65
- # ========================================================================= #
72
+ # ========================================================================== #
66
73
  # === reset
67
- # ========================================================================= #
74
+ # ========================================================================== #
68
75
  def reset
69
76
  super()
70
77
  infer_the_namespace
@@ -80,28 +87,27 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
80
87
  @remote_URL = nil
81
88
  end
82
89
 
83
- # ========================================================================= #
90
+ # ========================================================================== #
84
91
  # === open_via_the_browser?
85
- # ========================================================================= #
92
+ # ========================================================================== #
86
93
  def open_via_the_browser?
87
94
  @open_via_the_browser
88
95
  end
89
96
 
90
- # ========================================================================= #
97
+ # ========================================================================== #
91
98
  # === considering_opening_the_remote_URL_via_a_browser_tab
92
- # ========================================================================= #
99
+ # ========================================================================== #
93
100
  def considering_opening_the_remote_URL_via_a_browser_tab(
94
- i = @remote_URL
101
+ i = remote_URL?
95
102
  )
96
103
  if open_via_the_browser?
97
- require 'open'
98
- Open.in_browser(i)
104
+ open_in_browser(i)
99
105
  end
100
106
  end
101
107
 
102
- # ========================================================================= #
108
+ # ========================================================================== #
103
109
  # === run (run tag)
104
- # ========================================================================= #
110
+ # ========================================================================== #
105
111
  def run
106
112
  image_path = first_commandline_argument?
107
113
  if image_path.nil?
@@ -120,7 +126,7 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
120
126
  # ===================================================================== #
121
127
  # Download it first in this case.
122
128
  # ===================================================================== #
123
- opne "Trying to download #{steelblue(image_path)} next:"
129
+ orev "Trying to download #{steelblue(image_path)} next:"
124
130
  require 'wget'
125
131
  result = Wget.new(image_path) { :no_check_certificate }
126
132
  image_path = File.absolute_path(File.basename(result.url?))
@@ -132,7 +138,11 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
132
138
  params = {
133
139
  image: File.read(image_path)
134
140
  }
135
- request = Net::HTTP::Post.new(API_URI.request_uri + ENDPOINTS[:image])
141
+ request_URL = API_URI.request_uri + ENDPOINTS[:image]
142
+ pp request_URL
143
+ pp request_URL
144
+ pp request_URL
145
+ request = Net::HTTP::Post.new(request_URL)
136
146
  # ===================================================================== #
137
147
  # Put in the proper form-data into the params next:
138
148
  # ===================================================================== #
@@ -144,11 +154,19 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
144
154
  web_client.verify_mode = OpenSSL::SSL::VERIFY_NONE
145
155
  response = web_client.request(request)
146
156
  response_body = response.body
147
- opne "The whole #{steelblue('response.body')} was:"
148
- opne 'The local image is at:'
157
+ orev "The whole #{steelblue('response.body')} #{rev}was:"
149
158
  e
150
- e " #{tomato(File.absolute_path(image_path))}"
159
+ e tomato(response_body)
151
160
  e
161
+ new_target = File.absolute_path(image_path)
162
+ if File.exist? new_target
163
+ orev 'The local image is at:'
164
+ e
165
+ e " #{tomato(new_target)}"
166
+ e
167
+ else
168
+ orev 'No local image was found at '+sfile(new_target)+rev+'.'
169
+ end
152
170
  opne 'The remote image can be found at:'
153
171
  e
154
172
  response_body =~ REGEX_FOR_THE_LINK_ENTRY
@@ -163,15 +181,26 @@ class UploadToImgur < ::Roebe::Base # === Roebe::UploadToImgur
163
181
  end
164
182
  end
165
183
 
166
- # ========================================================================= #
184
+ # ========================================================================== #
167
185
  # === remote_URL?
168
- # ========================================================================= #
186
+ # ========================================================================== #
169
187
  def remote_URL?
170
188
  @remote_URL
171
189
  end; alias remote_url? remote_URL? # === remote_url?
172
190
 
173
- end; end
191
+ end
192
+
193
+ # ============================================================================ #
194
+ # === Roebe.upload_to_imgur
195
+ # ============================================================================ #
196
+ def self.upload_to_imgur(
197
+ i = ARGV
198
+ )
199
+ Roebe::UploadToImgur.new(i)
200
+ end
201
+
202
+ end
174
203
 
175
204
  if __FILE__ == $PROGRAM_NAME
176
205
  Roebe::UploadToImgur.new(ARGV)
177
- end # upload_to_imgur
206
+ end # uploadtoimgur
@@ -11,6 +11,33 @@ module Roebe
11
11
  require 'roebe/toplevel_methods/is_on_roebe.rb'
12
12
  require 'roebe/toplevel_methods/move_file.rb'
13
13
 
14
+ # ========================================================================= #
15
+ # === Roebe.append_this_program_to_the_autostart_array
16
+ #
17
+ # This method can be used to add a program to the applications that
18
+ # will be autostarted.
19
+ # ========================================================================= #
20
+ def self.append_this_program_to_the_autostart_array(i)
21
+ what = i.to_s.dup
22
+ unless what.start_with? '- '
23
+ what.prepend('- ')
24
+ end
25
+ unless what.start_with? "\n"
26
+ what.prepend("\n")
27
+ end
28
+ into = FILE_AUTOSTART_THESE_PROGRAMS
29
+ e 'Now appending `'+what.delete("\n")+'` into '+into+'.'
30
+ append_what_into(what, into)
31
+ if is_on_roebe?
32
+ # ===================================================================== #
33
+ # Hardcoded will do fine for now.
34
+ # ===================================================================== #
35
+ into = Roebe.ruby_src_dir_at_home'+roebe/lib/roebe/yaml/autostart_these_programs.yml'
36
+ e 'Now appending `'+what.delete("\n")+'` into '+into+'.'
37
+ append_what_into(what, into)
38
+ end
39
+ end
40
+
14
41
  # ========================================================================= #
15
42
  # === Roebe.do_compile_this_java_file_statically
16
43
  #
@@ -203,33 +230,6 @@ module Roebe
203
230
  end
204
231
  end
205
232
 
206
- # ========================================================================= #
207
- # === Roebe.append_this_program_to_the_autostart_array
208
- #
209
- # This method can be used to add a program to the applications that
210
- # will be autostarted.
211
- # ========================================================================= #
212
- def self.append_this_program_to_the_autostart_array(i)
213
- what = i.to_s.dup
214
- unless what.start_with? '- '
215
- what.prepend('- ')
216
- end
217
- unless what.start_with? "\n"
218
- what.prepend("\n")
219
- end
220
- into = FILE_AUTOSTART_THESE_PROGRAMS
221
- e 'Now appending `'+what.delete("\n")+'` into '+into+'.'
222
- append_what_into(what, into)
223
- if is_on_roebe?
224
- # ===================================================================== #
225
- # Hardcoded will do fine for now.
226
- # ===================================================================== #
227
- into = HOME_DIRECTORY_OF_USER_X+'DATA/PROGRAMMING_LANGUAGES/RUBY/src/roebe/lib/roebe/yaml/autostart_these_programs.yml'
228
- e 'Now appending `'+what.delete("\n")+'` into '+into+'.'
229
- append_what_into(what, into)
230
- end
231
- end
232
-
233
233
  # ========================================================================= #
234
234
  # === Roebe.download_autogenerated_rcfiles
235
235
  #
@@ -275,4 +275,4 @@ module Roebe
275
275
  }
276
276
  end
277
277
 
278
- end
278
+ end
@@ -109,7 +109,7 @@ module PostInstall
109
109
  # ========================================================================= #
110
110
  def self.run
111
111
  begin
112
- require 'rbt/utility_scripts/expand_cookbooks.rb'
112
+ require 'rbt/actions/individual_actions/cookbooks/expand_cookbooks/expand_cookbooks.rb'
113
113
  RBT.expand_cookbooks
114
114
  rescue LoadError; end
115
115
  end
@@ -50,6 +50,13 @@ module Roebe
50
50
  RUBY_SRC_DIR = HOME_OF_THE_USER_CALLED_X+'programming/ruby/src/'
51
51
  end; RUBY_SRC = RUBY_SRC_DIR # === RUBY_SRC
52
52
 
53
+ # ========================================================================= #
54
+ # === Roebe.ruby_src_dir_at_home
55
+ # ========================================================================= #
56
+ def self.ruby_src_dir_at_home
57
+ RUBY_SRC_DIR
58
+ end
59
+
53
60
  # ========================================================================= #
54
61
  # === STD_COMMENT
55
62
  # ========================================================================= #
@@ -93,4 +100,4 @@ module Roebe
93
100
  # =========================================================================== #
94
101
  '
95
102
 
96
- end
103
+ end
@@ -1,19 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # Encoding: UTF-8
3
- # frozen_string_literal: true
4
- # =========================================================================== #
5
- # require 'roebe/constants/emojis.rb'
6
- # =========================================================================== #
7
- module Roebe
8
-
9
- # ========================================================================= #
10
- # === Roebe::BOOK_EMOJI
11
- #
12
- # This is specifically used for .pdf-related functionality, to show a
13
- # useful book-icon to the user - both on the commandline, as well as
14
- # for web-related sites. See class
15
- # Roebe::GenerateOverviewOfTheLocallyAvailableBooks.
16
- # ========================================================================= #
17
- BOOK_EMOJI = '📚'
18
-
19
- end
@@ -92,7 +92,7 @@ module Roebe
92
92
  #
93
93
  # ========================================================================= #
94
94
  FILE_AUTOSTART_THESE_PROGRAMS =
95
- "#{Roebe.project_base_dir?}yaml/autostart_these_programs.yml"
95
+ "#{Roebe.project_base_dir?}yaml/autostart_these_programs/autostart_these_programs.yml"
96
96
 
97
97
  # ========================================================================= #
98
98
  # === Roebe.file_network
@@ -156,4 +156,4 @@ module Roebe
156
156
  "#{project_yaml_directory?}binäre_einheiten/binäre_einheiten.yml"
157
157
  end
158
158
 
159
- end
159
+ end
@@ -19,8 +19,16 @@ module Roebe
19
19
  # === MAIN_EDITOR_TO_USE
20
20
  #
21
21
  # This used to be bluefish until May 2019 where it was changed to geany.
22
+ #
23
+ # Since as of March 2024 this will be queried from a .yml file.
22
24
  # =========================================================================== #
23
- MAIN_EDITOR_TO_USE = 'bluefish' # 'geany'
25
+ _ = Roebe.project_yaml_directory?+'use_this_editor/use_this_editor.yml'
26
+ if File.exist?(_)
27
+ require 'yaml'
28
+ MAIN_EDITOR_TO_USE = YAML.load_file(_).rstrip
29
+ else
30
+ MAIN_EDITOR_TO_USE = 'geany'
31
+ end
24
32
 
25
33
  # =========================================================================== #
26
34
  # === Roebe.editor?
@@ -140,4 +148,4 @@ module Roebe
140
148
  '/home/x/Temp/' # This is currently hardcoded.
141
149
  end; self.instance_eval { alias temp_directory? temp_dir? } # === Roebe.temp_directory?
142
150
 
143
- end
151
+ end