roebe 0.5.191 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of roebe might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +23 -26
- data/bin/create_my_directories +2 -2
- data/bin/{ruby_dhcpcd → dhcpcd_wrapper} +1 -1
- data/doc/README.gen +12 -0
- data/doc/core/array.md +24 -23
- data/doc/core/gem_and_gemspec.md +12 -11
- data/doc/core/misc.md +23 -20
- data/doc/statistics/statistics.md +1 -0
- data/lib/roebe/actions/actions.rb +68 -0
- data/lib/roebe/base/misc.rb +14 -1
- data/lib/roebe/browser/output_url_then_open_in_browser.rb +8 -6
- data/lib/roebe/classes/alltagsgeschichte.rb +1 -1
- data/lib/roebe/classes/at.rb +2 -2
- data/lib/roebe/classes/auto_rename_file_based_on_its_creation_date.rb +24 -12
- data/lib/roebe/classes/books/books.rb +159 -117
- data/lib/roebe/classes/books/menu.rb +8 -7
- data/lib/roebe/classes/books/sanitize_this_book_path/sanitize_this_book_path.rb +0 -1
- data/lib/roebe/classes/check_yaml.rb +15 -11
- data/lib/roebe/classes/compile_kernel.rb +3 -1
- data/lib/roebe/classes/copy_kernel_config.rb +5 -3
- data/lib/roebe/classes/create_desktop_file.rb +1 -1
- data/lib/roebe/classes/create_my_directories.rb +12 -10
- data/lib/roebe/classes/dhcpcd/{dhcpcd.rb → dhcpcd_wrapper.rb} +137 -95
- data/lib/roebe/classes/dhcpcd/kill_dhcpcd.rb +2 -2
- data/lib/roebe/classes/do_install.rb +7 -6
- data/lib/roebe/classes/done.rb +1 -1
- data/lib/roebe/classes/downcase_extension.rb +4 -4
- data/lib/roebe/classes/email.rb +44 -40
- data/lib/roebe/classes/enable.rb +1 -1
- data/lib/roebe/classes/github.rb +1 -1
- data/lib/roebe/classes/kde/install_this_konsole_theme.rb +1 -1
- data/lib/roebe/classes/make_gem.rb +29 -27
- data/lib/roebe/classes/readme_generator/readme_generator.rb +597 -1
- data/lib/roebe/classes/report_how_many_files_are_in_this_directory.rb +83 -0
- data/lib/roebe/classes/set_background.rb +14 -0
- data/lib/roebe/classes/show_ten_aliases.rb +15 -3
- data/lib/roebe/classes/tales_from_the_crypt.rb +1 -1
- data/lib/roebe/classes/update.rb +2 -1
- data/lib/roebe/constants/array_install_these_gem_projects.rb +1 -1
- data/lib/roebe/constants/roebe.rb +2 -0
- data/lib/roebe/custom_methods/module.rb +16 -0
- data/lib/roebe/fonts/fonts.rb +39 -0
- data/lib/roebe/hello_world/hello_world.rb +0 -0
- data/lib/roebe/math/log10.rb +3 -3
- data/lib/roebe/math/the_collatz_problem.rb +104 -0
- data/lib/roebe/shell/shell/shell.rb +6 -6
- data/lib/roebe/shell_scripts/lfs/002_gcc_1.sh +13 -1
- data/lib/roebe/shell_scripts/lfs/003_linux_1.sh +1 -0
- data/lib/roebe/shell_scripts/lfs/007_ncurses_2.sh +4 -1
- data/lib/roebe/shell_scripts/lfs/020_xz_2.sh +5 -5
- data/lib/roebe/shell_scripts/lfs/021_binutils_2.sh +1 -0
- data/lib/roebe/shell_scripts/lfs/022_gcc_2.sh +12 -1
- data/lib/roebe/shell_scripts/lfs/025_ruby_2.sh +13 -0
- data/lib/roebe/shell_scripts/lfs/lfs_build_variables.sh +48 -8
- data/lib/roebe/toplevel_methods/to_mp3.rb +1 -1
- data/lib/roebe/version/version.rb +2 -2
- data/lib/roebe/wasm/README.md +7 -0
- data/lib/roebe/wasm/enable_simple_puts_output.rb +9 -0
- data/lib/roebe/wasm/wasm_examples.html +43 -0
- data/lib/roebe/www/RNA/RNA.cgi +42 -1
- data/lib/roebe/www/algorithms/algorithms.rb +22 -0
- data/lib/roebe/www/analytical_chemistry/content.md +3 -0
- data/lib/roebe/www/animals/animals.cgi +25 -0
- data/lib/roebe/www/bioanalytik/bioanalytik.cgi +90 -0
- data/lib/roebe/www/cellbiology/cellbiology.rb +16 -2
- data/lib/roebe/www/chemistry/S/303/244uren_Basen_und_der_pH_Wert/S/303/244uren_Basen_und_der_pH_Wert.cgi +242 -0
- data/lib/roebe/www/chemistry/chemistry.rb +10 -258
- data/lib/roebe/www/chemistry/css_rules.css +67 -0
- data/lib/roebe/www/chemistry/die_quantenzahlen/die_quantenzahlen.cgi +123 -0
- data/lib/roebe/www/chemistry/funktionelle_gruppen_in_der_chemie/funktionelle_gruppen_in_der_chemie.cgi +52 -0
- data/lib/roebe/www/erste_hilfe/erste_hilfe.cgi +212 -62
- data/lib/roebe/www/fonts/fonts.cgi +245 -0
- data/lib/roebe/www/hardware/computersysteme/computersysteme.rb +117 -102
- data/lib/roebe/www/hardware/netzteile/netzteile.cgi +94 -0
- data/lib/roebe/www/immunology/immunology.rb +101 -7
- data/lib/roebe/www/linux/antiX/antiX.rb +7 -4
- data/lib/roebe/www/linux/linux.rb +9 -11
- data/lib/roebe/www/linux/linuxmint/linuxmint.rb +33 -0
- data/lib/roebe/www/linux/slackware/slackware.rb +136 -27
- data/lib/roebe/www/lyrics/lyrics.rb +1 -1
- data/lib/roebe/www/microbiology/microbiology.rb +17 -2
- data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.cgi +1086 -2
- data/lib/roebe/www/mitochondria/mitochondria.cgi +16 -2
- data/lib/roebe/www/module_www.rb +2 -3
- data/lib/roebe/www/neurobiology/neurobiology.rb +20 -3
- data/lib/roebe/www/pdf/pdf.rb +13 -0
- data/lib/roebe/www/physics/physics.rb +20 -4
- data/lib/roebe/www/physiology/physiology.rb +5 -1
- data/lib/roebe/www/play_this_video_file/play_this_video_file.cgi +1 -1
- data/lib/roebe/www/programming_advice/programming_advice.cgi +36 -0
- data/lib/roebe/www/programming_advice/programming_advice.md +349 -0
- data/lib/roebe/www/psychologie/psychologie.rb +7 -1
- data/lib/roebe/www/science/science.rb +6 -0
- data/lib/roebe/www/sex_and_reproduction/sex_and_reproduction.cgi +18 -2
- data/lib/roebe/www/structural_biology/structural_biology.cgi +16 -0
- data/lib/roebe/www/the_cell_cycle/the_cell_cycle.cgi +27 -0
- data/lib/roebe/www/video/video.rb +1 -1
- data/lib/roebe/www/virology/virology.rb +12 -1
- data/lib/roebe/www/war_in_Ukraine_2022/war_in_Ukraine_2022.rb +26 -8
- data/lib/roebe/www/xorg/xorg.rb +3 -202
- data/lib/roebe/yaml/books/favourite_books.yml +6 -8
- data/lib/roebe/yaml/directory_structure.yml +1 -0
- metadata +26 -15
- data/lib/roebe/classes/readme_generator/constants.rb +0 -21
- data/lib/roebe/classes/readme_generator/initialize.rb +0 -38
- data/lib/roebe/classes/readme_generator/misc.rb +0 -548
- data/lib/roebe/classes/readme_generator/reset.rb +0 -28
- data/lib/roebe/classes/readme_generator/run.rb +0 -20
- data/lib/roebe/shell_scripts/lfs/lfs_variables.sh +0 -31
- data/lib/roebe/www/mikrobielle_physiologie/mikrobielle_physiologie.rb +0 -1055
- data/lib/roebe/www/programming_advice/programming_advice.yml +0 -31
@@ -56,6 +56,9 @@ class Books < Base # === Roebe::Books
|
|
56
56
|
set_commandline_arguments(
|
57
57
|
commandline_arguments
|
58
58
|
)
|
59
|
+
# ======================================================================= #
|
60
|
+
# === Handle blocks given to the method next
|
61
|
+
# ======================================================================= #
|
59
62
|
if block_given?
|
60
63
|
yielded = yield
|
61
64
|
case yielded
|
@@ -93,7 +96,7 @@ class Books < Base # === Roebe::Books
|
|
93
96
|
# === :store_the_timestamps_into_this_local_file
|
94
97
|
# ======================================================================= #
|
95
98
|
@internal_hash[:store_the_timestamps_into_this_local_file] =
|
96
|
-
|
99
|
+
the_stored_timestamps_of_all_opened_pdf_books_are_where?
|
97
100
|
consider_loading_and_sanitizing_the_timestamps_from_a_local_yaml_file
|
98
101
|
try_to_require_the_open_gem
|
99
102
|
end
|
@@ -293,13 +296,6 @@ class Books < Base # === Roebe::Books
|
|
293
296
|
end
|
294
297
|
end
|
295
298
|
|
296
|
-
# ========================================================================= #
|
297
|
-
# === into?
|
298
|
-
# ========================================================================= #
|
299
|
-
def into?
|
300
|
-
"#{log_dir?}roebe/favourite_books.yml"
|
301
|
-
end; alias yaml_location? into? # === yaml_location?
|
302
|
-
|
303
299
|
# ========================================================================= #
|
304
300
|
# === show_help (help tag)
|
305
301
|
# ========================================================================= #
|
@@ -313,7 +309,7 @@ class Books < Base # === Roebe::Books
|
|
313
309
|
eparse ' books --open=2 # open only the .pdf file at entry #2'
|
314
310
|
eparse ' books --real # show the real path to the .pdf files'
|
315
311
|
eparse ' books --reopen # reopen all .pdf files that are '\
|
316
|
-
'registered'
|
312
|
+
'registered; --open-all is an alias to this'
|
317
313
|
eparse ' books --store # store the favourites'
|
318
314
|
eparse ' books --restore # restore the default from the '+
|
319
315
|
steelblue('.yml')+
|
@@ -362,13 +358,13 @@ class Books < Base # === Roebe::Books
|
|
362
358
|
unless @internal_hash[:favourite_books].include? i
|
363
359
|
if File.exist? i
|
364
360
|
if be_verbose
|
365
|
-
opne "Adding the file"
|
361
|
+
opne "#{rev}Adding the file"
|
366
362
|
opne "#{sfancy(i)} #{rev}to the favourites."
|
367
363
|
end
|
368
364
|
@internal_hash[:favourite_books] << i
|
369
365
|
store_the_favourites
|
370
366
|
else
|
371
|
-
|
367
|
+
opnn; no_file_exists_at(i)
|
372
368
|
end
|
373
369
|
end
|
374
370
|
end; alias add add_to_the_favourites # === add
|
@@ -385,6 +381,8 @@ class Books < Base # === Roebe::Books
|
|
385
381
|
YAML.load_file(i).each {|entry|
|
386
382
|
open_this_pdf_file(entry)
|
387
383
|
}
|
384
|
+
else
|
385
|
+
no_file_exists_at(i)
|
388
386
|
end
|
389
387
|
end
|
390
388
|
|
@@ -447,111 +445,6 @@ class Books < Base # === Roebe::Books
|
|
447
445
|
show_the_favourites(nil, i)
|
448
446
|
end
|
449
447
|
|
450
|
-
# ========================================================================= #
|
451
|
-
# === show_the_favourites
|
452
|
-
#
|
453
|
-
# This method will show all favourite books.
|
454
|
-
# ========================================================================= #
|
455
|
-
def show_the_favourites(
|
456
|
-
optional_arguments = nil, # or :full_path
|
457
|
-
_ = favourite_books?
|
458
|
-
)
|
459
|
-
n_favourite_books = _.size
|
460
|
-
if _.empty?
|
461
|
-
opne tomato('No .pdf books are available for the current library.')
|
462
|
-
opne tomato("Normally these would be found at the following location:")
|
463
|
-
e
|
464
|
-
e " #{sfile(yaml_location?)}"
|
465
|
-
e
|
466
|
-
if is_on_roebe?
|
467
|
-
e "#{rev}You can also use:"
|
468
|
-
e
|
469
|
-
e ' books --restore'
|
470
|
-
e
|
471
|
-
e 'To copy the old books.' # In fact, we will do this now, anyway.'
|
472
|
-
e
|
473
|
-
# do_restore_the_original_yaml_file
|
474
|
-
end
|
475
|
-
else
|
476
|
-
n_pdf_pages_in_total = 0
|
477
|
-
e "#{rev}#{grey('The following ')}#{royalblue(_.size)} #{rev}"\
|
478
|
-
"#{grey('books are stored as favourites:')}"
|
479
|
-
e
|
480
|
-
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
481
|
-
e skyblue('-'*80)
|
482
|
-
end
|
483
|
-
# ===================================================================== #
|
484
|
-
# Iterate over all entries next:
|
485
|
-
# ===================================================================== #
|
486
|
-
_.each_with_index {|this_book, index| index += 1
|
487
|
-
absolute_path = File.absolute_path(this_book)
|
488
|
-
if @internal_hash[:hash_store_the_timestamps].has_key?(absolute_path)
|
489
|
-
else # else must create a new entry.
|
490
|
-
@internal_hash[:hash_store_the_timestamps][absolute_path] = []
|
491
|
-
# ================================================================= #
|
492
|
-
# First add when it was last modified:
|
493
|
-
# ================================================================= #
|
494
|
-
if File.exist? absolute_path
|
495
|
-
@internal_hash[:hash_store_the_timestamps][absolute_path] <<
|
496
|
-
File.mtime(absolute_path)
|
497
|
-
end
|
498
|
-
end
|
499
|
-
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
500
|
-
current_array = @internal_hash[:hash_store_the_timestamps][absolute_path]
|
501
|
-
if current_array.size > 1 # In this case we assume a page.
|
502
|
-
first = current_array.first # n pages in this pdf file.
|
503
|
-
if first.is_a?(String) # Do nothing in this case.
|
504
|
-
else
|
505
|
-
# =============================================================== #
|
506
|
-
# Here, we must compare the File.mtime data.
|
507
|
-
# =============================================================== #
|
508
|
-
if File.exist? absolute_path
|
509
|
-
modification = File.mtime(absolute_path) - first
|
510
|
-
end
|
511
|
-
if modification and modification > 1
|
512
|
-
n_pages = ::PdfParadise.n_pages_in_this_pdf_file(this_book) { :be_quiet }
|
513
|
-
else
|
514
|
-
n_pages = current_array.last
|
515
|
-
end
|
516
|
-
end
|
517
|
-
else
|
518
|
-
n_pages = ::PdfParadise.n_pages_in_this_pdf_file(this_book) { :be_quiet }
|
519
|
-
@internal_hash[:hash_store_the_timestamps][absolute_path] << n_pages
|
520
|
-
end
|
521
|
-
end
|
522
|
-
n_pdf_pages_in_total += n_pages.to_i
|
523
|
-
case optional_arguments
|
524
|
-
# =================================================================== #
|
525
|
-
# === :full_path
|
526
|
-
# =================================================================== #
|
527
|
-
when :full_path
|
528
|
-
else
|
529
|
-
this_book = File.basename(this_book)
|
530
|
-
end
|
531
|
-
result = ''.dup
|
532
|
-
result << ' ' if (n_favourite_books > 9) and (index < 10)
|
533
|
-
result << "#{green('(')}"\
|
534
|
-
"#{steelblue(index)}"\
|
535
|
-
"#{green(')')} "\
|
536
|
-
"#{sfancy(this_book)}".dup
|
537
|
-
result << lightsteelblue(
|
538
|
-
" (#{n_pages} pages)"
|
539
|
-
) if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
540
|
-
result.prepend(' ')
|
541
|
-
e result
|
542
|
-
}
|
543
|
-
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
544
|
-
e skyblue('-'*80)
|
545
|
-
e royalblue(
|
546
|
-
(n_pdf_pages_in_total.to_s+' pages in total').
|
547
|
-
rjust(66)
|
548
|
-
)
|
549
|
-
end
|
550
|
-
e
|
551
|
-
end
|
552
|
-
store_the_timestamps_into_a_local_yaml_file
|
553
|
-
end; alias do_query_favourites show_the_favourites # === do_query_favourites
|
554
|
-
|
555
448
|
# ========================================================================= #
|
556
449
|
# === restore_the_original_yaml_file
|
557
450
|
#
|
@@ -562,7 +455,11 @@ class Books < Base # === Roebe::Books
|
|
562
455
|
new_target = '/home/x/Temp/roebe/favourite_books.yml'
|
563
456
|
mkdir(File.dirname(new_target))
|
564
457
|
original_file = "#{project_base_dir?}yaml/books/favourite_books.yml"
|
565
|
-
|
458
|
+
if File.exist? original_file
|
459
|
+
opnn; copy_file(original_file, new_target) { :be_verbose }
|
460
|
+
else
|
461
|
+
opnn; no_file_exists_at(original_file)
|
462
|
+
end
|
566
463
|
end; alias do_restore_the_original_yaml_file restore_the_original_yaml_file # === do_restore_the_original_yaml_file
|
567
464
|
|
568
465
|
# ========================================================================= #
|
@@ -770,6 +667,151 @@ class Books < Base # === Roebe::Books
|
|
770
667
|
}
|
771
668
|
end; alias open_in_pdf_viewer open_this_pdf_file # === open_in_pdf_viewer
|
772
669
|
|
670
|
+
# ========================================================================= #
|
671
|
+
# === inform_the_user_how_to_restore_the_books
|
672
|
+
# ========================================================================= #
|
673
|
+
def inform_the_user_how_to_restore_the_books
|
674
|
+
e "#{rev}You can also use:"
|
675
|
+
e
|
676
|
+
e ' books --restore'
|
677
|
+
e
|
678
|
+
e 'To copy the old books.' # In fact, we will do this now, anyway.'
|
679
|
+
e
|
680
|
+
# do_restore_the_original_yaml_file
|
681
|
+
end
|
682
|
+
|
683
|
+
# ========================================================================= #
|
684
|
+
# === elegantly_show_all_favourites
|
685
|
+
#
|
686
|
+
#
|
687
|
+
# This method will show all favourite books.
|
688
|
+
#
|
689
|
+
# This method, rewritten in January 2024, will make use of unicode
|
690
|
+
# horizontal bars, and also show more information than the old
|
691
|
+
# method did.
|
692
|
+
# ========================================================================= #
|
693
|
+
def elegantly_show_all_favourites(
|
694
|
+
optional_arguments = nil, # or :full_path
|
695
|
+
_ = favourite_books?
|
696
|
+
)
|
697
|
+
n_favourite_books = _.size
|
698
|
+
if _.empty? # No books were found.
|
699
|
+
opne tomato('No .pdf books are available for the current library.')
|
700
|
+
opne tomato("Normally these would be found at the following location:")
|
701
|
+
e
|
702
|
+
e " #{sfile(yaml_location?)}"
|
703
|
+
e
|
704
|
+
if is_on_roebe?
|
705
|
+
inform_the_user_how_to_restore_the_books
|
706
|
+
end
|
707
|
+
else
|
708
|
+
n_pdf_pages_in_total = 0
|
709
|
+
unicode_horizontal_bar = EmojiParadise.unicode_horizontal_bar
|
710
|
+
e "#{rev}#{grey('The following ')}#{royalblue(_.size)} #{rev}"\
|
711
|
+
"#{grey('books are stored as favourites:')}"
|
712
|
+
e
|
713
|
+
e olivedrab(' Index | Title'\
|
714
|
+
' '\
|
715
|
+
'| n pages')
|
716
|
+
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
717
|
+
e olivedrab(unicode_horizontal_bar * 108)
|
718
|
+
end
|
719
|
+
# ===================================================================== #
|
720
|
+
# Iterate over all entries next:
|
721
|
+
# ===================================================================== #
|
722
|
+
_.each_with_index {|this_book, index| index += 1
|
723
|
+
absolute_path = File.absolute_path(this_book)
|
724
|
+
if @internal_hash[:hash_store_the_timestamps].has_key?(absolute_path)
|
725
|
+
else # else must create a new entry.
|
726
|
+
@internal_hash[:hash_store_the_timestamps][absolute_path] = []
|
727
|
+
# ================================================================= #
|
728
|
+
# First add when it was last modified:
|
729
|
+
# ================================================================= #
|
730
|
+
if File.exist? absolute_path
|
731
|
+
@internal_hash[:hash_store_the_timestamps][absolute_path] <<
|
732
|
+
File.mtime(absolute_path)
|
733
|
+
end
|
734
|
+
end
|
735
|
+
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
736
|
+
current_array = @internal_hash[:hash_store_the_timestamps][absolute_path]
|
737
|
+
if current_array.size > 1 # In this case we assume a page.
|
738
|
+
first = current_array.first # n pages in this pdf file.
|
739
|
+
if first.is_a?(String) # Do nothing in this case.
|
740
|
+
else
|
741
|
+
# =============================================================== #
|
742
|
+
# Here, we must compare the File.mtime data.
|
743
|
+
# =============================================================== #
|
744
|
+
if File.exist? absolute_path
|
745
|
+
modification = File.mtime(absolute_path) - first
|
746
|
+
end
|
747
|
+
begin
|
748
|
+
if modification and modification > 1
|
749
|
+
n_pages = ::PdfParadise.n_pages_in_this_pdf_file(this_book) { :be_quiet }
|
750
|
+
else
|
751
|
+
n_pages = current_array.last
|
752
|
+
end
|
753
|
+
rescue ArgumentError => error
|
754
|
+
pp error
|
755
|
+
e sfile(yaml_file?)
|
756
|
+
e sfile(the_stored_timestamps_of_all_opened_pdf_books_are_where?)
|
757
|
+
end
|
758
|
+
end
|
759
|
+
else
|
760
|
+
n_pages = ::PdfParadise.n_pages_in_this_pdf_file(this_book) { :be_quiet }
|
761
|
+
@internal_hash[:hash_store_the_timestamps][absolute_path] << n_pages
|
762
|
+
end
|
763
|
+
end
|
764
|
+
n_pdf_pages_in_total += n_pages.to_i
|
765
|
+
case optional_arguments
|
766
|
+
# =================================================================== #
|
767
|
+
# === :full_path
|
768
|
+
# =================================================================== #
|
769
|
+
when :full_path
|
770
|
+
else
|
771
|
+
this_book = File.basename(this_book)
|
772
|
+
end
|
773
|
+
result = ' '.dup
|
774
|
+
result << ' ' if (n_favourite_books > 9) and (index < 10)
|
775
|
+
result << "#{green('(')}"\
|
776
|
+
"#{steelblue(index)}"\
|
777
|
+
"#{green(')')} #{olivedrab('|')} "\
|
778
|
+
"#{sfancy(this_book.ljust(86, ' '))}".dup
|
779
|
+
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
780
|
+
result << olivedrab(' |')+lightsteelblue(
|
781
|
+
" #{n_pages.to_s.rjust(3,' ')} pages"
|
782
|
+
)
|
783
|
+
end
|
784
|
+
result.prepend(' ')
|
785
|
+
e result # Display the result.
|
786
|
+
}
|
787
|
+
if SHOW_HOW_MANY_PAGES_ARE_IN_THAT_PDF_FILE
|
788
|
+
e olivedrab(unicode_horizontal_bar * 108)
|
789
|
+
e royalblue(
|
790
|
+
(n_pdf_pages_in_total.to_s+' pages in total').
|
791
|
+
rjust(108)
|
792
|
+
)
|
793
|
+
end
|
794
|
+
e
|
795
|
+
store_the_timestamps_into_a_local_yaml_file
|
796
|
+
end
|
797
|
+
end; alias do_query_favourites elegantly_show_all_favourites # === do_query_favourites
|
798
|
+
alias show_the_favourites elegantly_show_all_favourites # === do_query_favourites
|
799
|
+
|
800
|
+
# ========================================================================= #
|
801
|
+
# === into?
|
802
|
+
# ========================================================================= #
|
803
|
+
def into?
|
804
|
+
"#{log_dir?}roebe/favourite_books.yml"
|
805
|
+
end; alias yaml_location? into? # === yaml_location?
|
806
|
+
alias yaml_file? into? # === yaml_file?
|
807
|
+
|
808
|
+
# ========================================================================= #
|
809
|
+
# === the_stored_timestamps_of_all_opened_pdf_books_are_where?
|
810
|
+
# ========================================================================= #
|
811
|
+
def the_stored_timestamps_of_all_opened_pdf_books_are_where?
|
812
|
+
roebe_log_directory?+'stored_timestamps_of_all_opened_pdf_books.yml'
|
813
|
+
end
|
814
|
+
|
773
815
|
# ========================================================================= #
|
774
816
|
# === run (run tag)
|
775
817
|
# ========================================================================= #
|
@@ -29,6 +29,14 @@ class Books < ::Roebe::Base # === Roebe::Books
|
|
29
29
|
else
|
30
30
|
case i # case tag
|
31
31
|
# ===================================================================== #
|
32
|
+
# === books --reopen
|
33
|
+
# ===================================================================== #
|
34
|
+
when /^-?-?reopen/i,
|
35
|
+
/^-?-?restore/i,
|
36
|
+
/^-?-?open(-|_)?all/i
|
37
|
+
do_reopen_all_tracked_pdf_files
|
38
|
+
exit
|
39
|
+
# ===================================================================== #
|
32
40
|
# === books 10
|
33
41
|
# ===================================================================== #
|
34
42
|
when /^\d+$/ # Input is only numbers.
|
@@ -171,13 +179,6 @@ class Books < ::Roebe::Base # === Roebe::Books
|
|
171
179
|
renew_the_timestamps
|
172
180
|
exit
|
173
181
|
# ===================================================================== #
|
174
|
-
# === books --reopen
|
175
|
-
# ===================================================================== #
|
176
|
-
when /^-?-?reopen/i,
|
177
|
-
/^-?-?restore/i
|
178
|
-
do_reopen_all_tracked_pdf_files
|
179
|
-
exit
|
180
|
-
# ===================================================================== #
|
181
182
|
# === books --exchange=6,1
|
182
183
|
#
|
183
184
|
# This entry point allows the user to exchange two positions
|
@@ -16,7 +16,6 @@ module Roebe
|
|
16
16
|
|
17
17
|
class SanitizeThisBookPath < ::Roebe::Base # === Roebe::SanitizeThisBookPath
|
18
18
|
|
19
|
-
require 'pdf_paradise/toplevel_methods/automatic_pdf_title.rb'
|
20
19
|
require 'pdf_paradise/utility_scripts/automatic_pdf_title.rb'
|
21
20
|
|
22
21
|
# ========================================================================= #
|
@@ -44,23 +44,27 @@ class CheckYaml < Base # === Roebe::CheckYaml
|
|
44
44
|
# ========================================================================= #
|
45
45
|
def run
|
46
46
|
_ = first_argument?
|
47
|
-
if
|
48
|
-
|
49
|
-
_dataset = YAML.load_file(_)
|
50
|
-
e "#{rev}All appears to be fine with the file `#{sfile(_)}`."
|
51
|
-
rescue Exception => error
|
52
|
-
e sfile(_)
|
53
|
-
pp error
|
54
|
-
end
|
47
|
+
if _.nil?
|
48
|
+
opne "#{rev}Please supply the path to a locally existing .yml file."
|
55
49
|
else
|
56
|
-
|
50
|
+
if File.exist? _
|
51
|
+
begin
|
52
|
+
_dataset = YAML.load_file(_)
|
53
|
+
e "#{rev}All appears to be fine with the file `#{sfile(_)}#{rev}`."
|
54
|
+
rescue Exception => error
|
55
|
+
e sfile(_)
|
56
|
+
pp error
|
57
|
+
end
|
58
|
+
else
|
59
|
+
no_file_exists_at(_)
|
60
|
+
end
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
60
64
|
# ========================================================================= #
|
61
65
|
# === Roebe::CheckYaml[]
|
62
66
|
# ========================================================================= #
|
63
|
-
def self.[](i =
|
67
|
+
def self.[](i = ARGV)
|
64
68
|
new(i)
|
65
69
|
end
|
66
70
|
|
@@ -68,4 +72,4 @@ end; end
|
|
68
72
|
|
69
73
|
if __FILE__ == $PROGRAM_NAME
|
70
74
|
Roebe::CheckYaml.new(ARGV)
|
71
|
-
end #
|
75
|
+
end # checkyaml
|
@@ -28,7 +28,9 @@ class CompileKernel < Base
|
|
28
28
|
|
29
29
|
include FileUtils::Verbose
|
30
30
|
|
31
|
-
|
31
|
+
begin
|
32
|
+
require 'rbt/toplevel_methods/archive_related_code.rb'
|
33
|
+
rescue LoadError; end
|
32
34
|
|
33
35
|
# ========================================================================= #
|
34
36
|
# === SRC_DIR
|
@@ -38,15 +38,17 @@ class CopyKernelConfig < Base # === Roebe::CopyKernelConfig
|
|
38
38
|
# === run
|
39
39
|
# ========================================================================= #
|
40
40
|
def run
|
41
|
-
opne steelblue('Copying')+
|
42
|
-
|
41
|
+
opne steelblue('Copying')+rev+
|
42
|
+
' the old kernel-config towards '+
|
43
|
+
sfile('/usr/src/linux/.config')+
|
44
|
+
rev+' next.'
|
43
45
|
if File.symlink? '/usr/src/linux'
|
44
46
|
version = File.readlink('/usr/src/linux').split('-').last
|
45
47
|
opne 'The linux kernel version is: '+
|
46
48
|
royalblue(version)
|
47
49
|
end
|
48
50
|
esystem 'zcat /proc/config.gz > /usr/src/linux/.config'
|
49
|
-
|
51
|
+
opne 'Now you could run:'
|
50
52
|
e
|
51
53
|
e royalblue('make oldconfig')
|
52
54
|
e
|
@@ -138,7 +138,7 @@ class CreateDesktopFile < Roebe::Base # === Roebe::CreateDesktopFile.new
|
|
138
138
|
# ========================================================================= #
|
139
139
|
def consider_creating_this_directory(i)
|
140
140
|
unless File.exist? i
|
141
|
-
opne "Creating #{sdir(i)} next."
|
141
|
+
opne "#{rev}Creating #{sdir(i)} #{rev}next."
|
142
142
|
FileUtils.mkdir_p(i)
|
143
143
|
end
|
144
144
|
end
|
@@ -69,21 +69,23 @@ class CreateMyDirectories < Base # === Roebe::CreateMyDirectories
|
|
69
69
|
#
|
70
70
|
# The input should be an Array.
|
71
71
|
# ========================================================================= #
|
72
|
-
def create_these_directories(
|
72
|
+
def create_these_directories(
|
73
|
+
these_directories
|
74
|
+
)
|
73
75
|
if these_directories
|
74
76
|
these_directories.each { |directory|
|
75
77
|
# =================================================================== #
|
76
78
|
# Only create directories if they do not yet exist.
|
77
79
|
# =================================================================== #
|
78
|
-
this_dir = (@base_prefix
|
80
|
+
this_dir = ("#{@base_prefix}#{directory}").squeeze('/')
|
79
81
|
unless File.exist?(this_dir)
|
80
82
|
if File.directory?(this_dir)
|
81
83
|
# =============================================================== #
|
82
84
|
# Be quiet in this case, as the directory already exists.
|
83
85
|
# =============================================================== #
|
84
86
|
elsif File.file?(this_dir)
|
85
|
-
opne "Can not create a directory a #{sfile(this_dir)}"
|
86
|
-
opne
|
87
|
+
opne "#{rev}Can not create a directory a #{sfile(this_dir)}"
|
88
|
+
opne "#{rev}as a file already exists at that location."
|
87
89
|
else
|
88
90
|
begin
|
89
91
|
opne "#{rev}Creating a directory at `#{sdir(this_dir)}#{rev}`."
|
@@ -101,11 +103,12 @@ class CreateMyDirectories < Base # === Roebe::CreateMyDirectories
|
|
101
103
|
end
|
102
104
|
|
103
105
|
# ========================================================================= #
|
104
|
-
# === show_help
|
106
|
+
# === show_help (help tag)
|
105
107
|
# ========================================================================= #
|
106
108
|
def show_help
|
107
109
|
e
|
108
|
-
e 'You can also specify the location where to create
|
110
|
+
e 'You can also specify the location where to create '\
|
111
|
+
'the directory layout.'
|
109
112
|
e
|
110
113
|
e 'Example:'
|
111
114
|
e
|
@@ -133,9 +136,8 @@ class CreateMyDirectories < Base # === Roebe::CreateMyDirectories
|
|
133
136
|
# === menu (menu tag)
|
134
137
|
# ========================================================================= #
|
135
138
|
def menu(
|
136
|
-
i =
|
139
|
+
i = commandline_arguments?
|
137
140
|
)
|
138
|
-
pp i
|
139
141
|
if i.is_a? Array
|
140
142
|
i.each {|entry| menu(entry) }
|
141
143
|
else
|
@@ -164,7 +166,7 @@ pp i
|
|
164
166
|
# ========================================================================= #
|
165
167
|
def consider_notifying_the_user_how_many_directories_have_been_created
|
166
168
|
if @created_n_directories == 0
|
167
|
-
e
|
169
|
+
e "#{rev}No directory has been created, which usually means that all"
|
168
170
|
e 'directories already exist. '+slateblue(cheerful_guy)
|
169
171
|
end
|
170
172
|
end
|
@@ -177,7 +179,7 @@ pp i
|
|
177
179
|
menu
|
178
180
|
my_directories = nil # Safeguard.
|
179
181
|
file_directory_structure = @use_this_file
|
180
|
-
e
|
182
|
+
e "#{rev}Creating my directories next by loading the dataset from"
|
181
183
|
e
|
182
184
|
e " #{sdir(file_directory_structure)}"
|
183
185
|
e
|